From patchwork Mon Jan 30 18:33:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Breathitt Gray X-Patchwork-Id: 721680 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vBys608FMz9t1Q for ; Tue, 31 Jan 2017 05:41:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EXAnFZIa"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753819AbdA3Sk3 (ORCPT ); Mon, 30 Jan 2017 13:40:29 -0500 Received: from mail-yb0-f196.google.com ([209.85.213.196]:34018 "EHLO mail-yb0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752390AbdA3Sk0 (ORCPT ); Mon, 30 Jan 2017 13:40:26 -0500 Received: by mail-yb0-f196.google.com with SMTP id w194so27059569ybe.1; Mon, 30 Jan 2017 10:40:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=b4gmxtkedyVeP9GdKIGbnqWdo2SHTS2X0uyXfuDRnvo=; b=EXAnFZIakas7J6wsTSH+eJUElQYmxNcunBrlBHTrLxh3XSEa+vQr1YMxKxSBO+s5J5 GPHEUYJe0Q9rcjeWY5Z+QCv19XNsPID3PC4jq6EkwSGVo9vM480RZYwJdZB2r5O1glke McVBJWDEuaiHzvse9HK4lkThv3EXJULRU1J9+ahRdttPPLwIxoJOB9rbOYg7sB9XRTCA gaWm/mlPgFtKZVOmK1gg1A8ssECPvgnUTdhv+lQp/oHI5jNa/BBGcQJ4Hdi8GpJuaUve afTLyeNJUNhOu5LX5/mVPh6Tf14fR4uoW0sc18To9mLe4icJCTUuXjdCBy28Y+FNZ7m4 q8QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=b4gmxtkedyVeP9GdKIGbnqWdo2SHTS2X0uyXfuDRnvo=; b=DnxBhFS/tjKyUMCQE5oPiNNRM0NaPIcapJotlUKfOCnpRoYhNvOcfm9PIPZVhRwKlC 53pspBcyhMOyCyrGZCfpP0BHGAk1b5nKwp87/N2+wBFDCBGLP9DURvk4jrpZQuj+NIEB 9nYGHgH2IENzvukDVMmhyAfJ7OnseEAfOxO8PDDFwMyl3EYLkM6h/TodjYUT60vs7oVx 6y8QrgL5VCpKPVJ5rSKcVaz9y/bC+DNeA70C5C4jR8XRoy5WaHqolB3thoHzmuVDfC6l AWY944ckzO5oPmfF1anWvw4BHjXMfN3dn9Ig/9R8EDMd7rOBH/TS0Vq9gpPUOuYciCJR psMw== X-Gm-Message-State: AIkVDXID00sG7h8YV0GSP7MaKdh2Cx7cjuadpJBTHg1i2d9pUcTC8g8lf5MSb5zOdc4MBA== X-Received: by 10.13.203.135 with SMTP id n129mr15396067ywd.220.1485801206818; Mon, 30 Jan 2017 10:33:26 -0800 (PST) Received: from localhost (50-88-177-90.res.bhn.net. [50.88.177.90]) by smtp.gmail.com with ESMTPSA id q14sm7643192ywa.53.2017.01.30.10.33.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 10:33:26 -0800 (PST) From: William Breathitt Gray To: linus.walleij@linaro.org, gnurou@gmail.com Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, William Breathitt Gray Subject: [PATCH v2 3/5] gpio: 104-idio-16: Add support for GPIO names Date: Mon, 30 Jan 2017 13:33:21 -0500 Message-Id: <5ab304050d7a9b849bd2585df8718f6d16aa6096.1485800977.git.vilhelm.gray@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This patch sets the gpio_chip names option with an array of GPIO line names that match the manual documentation for the ACCES 104-IDIO-16. This should make it easier for users to identify which GPIO line corresponds to a respective GPIO pin on the device. Signed-off-by: William Breathitt Gray --- drivers/gpio/gpio-104-idio-16.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-104-idio-16.c b/drivers/gpio/gpio-104-idio-16.c index 01a091e17614..96e740551976 100644 --- a/drivers/gpio/gpio-104-idio-16.c +++ b/drivers/gpio/gpio-104-idio-16.c @@ -210,6 +210,14 @@ static irqreturn_t idio_16_irq_handler(int irq, void *dev_id) return IRQ_HANDLED; } +#define IDIO_16_NGPIO 32 +static const char *idio_16_names[IDIO_16_NGPIO] = { + "OUT0", "OUT1", "OUT2", "OUT3", "OUT4", "OUT5", "OUT6", "OUT7", + "OUT8", "OUT9", "OUT10", "OUT11", "OUT12", "OUT13", "OUT14", "OUT15", + "IIN0", "IIN1", "IIN2", "IIN3", "IIN4", "IIN5", "IIN6", "IIN7", + "IIN8", "IIN9", "IIN10", "IIN11", "IIN12", "IIN13", "IIN14", "IIN15" +}; + static int idio_16_probe(struct device *dev, unsigned int id) { struct idio_16_gpio *idio16gpio; @@ -230,7 +238,8 @@ static int idio_16_probe(struct device *dev, unsigned int id) idio16gpio->chip.parent = dev; idio16gpio->chip.owner = THIS_MODULE; idio16gpio->chip.base = -1; - idio16gpio->chip.ngpio = 32; + idio16gpio->chip.ngpio = IDIO_16_NGPIO; + idio16gpio->chip.names = idio_16_names; idio16gpio->chip.get_direction = idio_16_gpio_get_direction; idio16gpio->chip.direction_input = idio_16_gpio_direction_input; idio16gpio->chip.direction_output = idio_16_gpio_direction_output;