From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Zapolskiy Subject: Re: [PATCH v2 5/5] misc: eeprom_93xx46: Add support for a GPIO 'select' line. Date: Thu, 19 Nov 2015 18:52:57 +0200 Message-ID: <564DFE69.6000203@mleia.com> References: <1447903781-3910-1-git-send-email-cory.tusar@pid1solutions.com> <1447903781-3910-6-git-send-email-cory.tusar@pid1solutions.com> <564D66BF.5010601@mleia.com> <20151119141810.GA30828@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20151119141810.GA30828-g2DYL2Zd6BY@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Andrew Lunn Cc: Cory Tusar , robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, pawel.moll-5wv7dgnIgG8@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org, galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, agust-ynQEQJNshbs@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, afd-l0cyMroinI0@public.gmane.org, Chris.Healy-c8ZVq/bFV1I@public.gmane.org, Keith.Vennel-c8ZVq/bFV1I@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org On 19.11.2015 16:18, Andrew Lunn wrote: >>> #ifdef CONFIG_OF >>> +static void select_assert(void *context) >>> +{ >>> + struct eeprom_93xx46_dev *edev = context; >>> + >>> + gpiod_set_value_cansleep(gpio_to_desc(edev->pdata->select_gpio), 1); >> >> I would suggest to use gpio_set_value() > > Could you explain why? > > Maybe this gpio is on an SPI GPIO expander? My point is that gpio_*() interface, gpio_set_value() or gpio_set_value_cansleep(), might be preferred is this particular case. I know it is legacy, but in this case there is no difference, if the target have gpiolib, and the interface is broken, if the target does not have gpiolib. > >>> static const struct of_device_id eeprom_93xx46_of_table[] = { >>> { .compatible = "eeprom-93xx46", }, >>> { .compatible = "atmel,at93c46d", .data = &atmel_at93c46d_data, }, >>> @@ -385,6 +402,15 @@ static int eeprom_93xx46_probe_dt(struct spi_device *spi) >>> if (of_property_read_bool(np, "read-only")) >>> pd->flags |= EE_READONLY; >>> >>> + ret = of_get_named_gpio(np, "select-gpios", 0); >> >> gpios or gpio? I see only one requested gpio. > > DT always uses the plural. Go read some bindins in Documentation/devicetree/bindings/ > Ok. -- With best wishes, Vladimir -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758896AbbKSQxD (ORCPT ); Thu, 19 Nov 2015 11:53:03 -0500 Received: from mleia.com ([178.79.152.223]:40554 "EHLO mail.mleia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758857AbbKSQxA (ORCPT ); Thu, 19 Nov 2015 11:53:00 -0500 Message-ID: <564DFE69.6000203@mleia.com> Date: Thu, 19 Nov 2015 18:52:57 +0200 From: Vladimir Zapolskiy User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: Andrew Lunn CC: Cory Tusar , robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, agust@denx.de, gregkh@linuxfoundation.org, jic23@kernel.org, broonie@kernel.org, afd@ti.com, Chris.Healy@zii.aero, Keith.Vennel@zii.aero, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 5/5] misc: eeprom_93xx46: Add support for a GPIO 'select' line. References: <1447903781-3910-1-git-send-email-cory.tusar@pid1solutions.com> <1447903781-3910-6-git-send-email-cory.tusar@pid1solutions.com> <564D66BF.5010601@mleia.com> <20151119141810.GA30828@lunn.ch> In-Reply-To: <20151119141810.GA30828@lunn.ch> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20151119_165415_503761_56AB721F X-CRM114-Status: GOOD ( 17.31 ) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19.11.2015 16:18, Andrew Lunn wrote: >>> #ifdef CONFIG_OF >>> +static void select_assert(void *context) >>> +{ >>> + struct eeprom_93xx46_dev *edev = context; >>> + >>> + gpiod_set_value_cansleep(gpio_to_desc(edev->pdata->select_gpio), 1); >> >> I would suggest to use gpio_set_value() > > Could you explain why? > > Maybe this gpio is on an SPI GPIO expander? My point is that gpio_*() interface, gpio_set_value() or gpio_set_value_cansleep(), might be preferred is this particular case. I know it is legacy, but in this case there is no difference, if the target have gpiolib, and the interface is broken, if the target does not have gpiolib. > >>> static const struct of_device_id eeprom_93xx46_of_table[] = { >>> { .compatible = "eeprom-93xx46", }, >>> { .compatible = "atmel,at93c46d", .data = &atmel_at93c46d_data, }, >>> @@ -385,6 +402,15 @@ static int eeprom_93xx46_probe_dt(struct spi_device *spi) >>> if (of_property_read_bool(np, "read-only")) >>> pd->flags |= EE_READONLY; >>> >>> + ret = of_get_named_gpio(np, "select-gpios", 0); >> >> gpios or gpio? I see only one requested gpio. > > DT always uses the plural. Go read some bindins in Documentation/devicetree/bindings/ > Ok. -- With best wishes, Vladimir