From: Evgeny Boger <boger-hVk9LwgH4SrGCOCKMErq+g@public•gmane.org>
To: Daniele Forsi <dforsi-Re5JQEeQqe8AvxtiuMwx3w@public•gmane.org>
Cc: Steve Glendinning
<steve.glendinning-nksJyM/082jR7s880joybQ@public•gmane.org>,
David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public•gmane.org>,
netdev-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
USB list <linux-usb-u79uwXL29TY76Z2rM5mHXA@public•gmane.org>
Subject: Re: [PATCH v2] Add support for GPIOs for SMSC LAN95xx chips.
Date: Wed, 25 Jun 2014 21:54:00 +0400 [thread overview]
Message-ID: <53AB0CB8.2090007@contactless.ru> (raw)
In-Reply-To: <CAN_we7MbMywYzysn_Q_iRAOZZuE+KU_jDJxMW-Qz0KK0RHwSRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
06/25/2014 02:34 PM, Daniele Forsi пишет:
> 2014-06-25 6:46 GMT+02:00 Evgeny Boger:
>
>> There might be 11 GPIOs in total.
> do you mean "12 GPIOs"? You say later they are 0-based and the last one is "11"
>
>> Last three GPIOs (offsets 8-11, 0-based) are shared with FDX, LNKA, SPD
>> LEDs respectively.
> so you mean the last "four"?
> and you may want to remove the extra space before the open parenthesis
My mistake. 11 GPIOs in total, eight of them (0-7) are normal GPIOs,
while three other are multiplexed with link activity LEDs.
So it should read like "offset 8-10, 0-based".
Actually, the numbering scheme according to datasheets differs a bit
between LAN9500 and LAN951x:
For LAN951x:
GPIOs with offsets 0-7 are named "GPIO3" - "GPIO7", offsets 8-10 are for
"GPIO0" - "GPIO2" (these three are multiplexed with nFDX_LED, nLNKA_LED,
nSPD_LED).
For LAN9500:
The datasheet name is the same as the corresponding offset, i.e. offsets
0-10 are for "GPIO0"-"GPIO10".
What do you think, shoud I write some note about this numbering scheme?
If so, where it would be better to place such a note?
>
> also there are still several unneeded newlines
>
>> diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
>> @@ -68,6 +70,15 @@ struct smsc95xx_priv {
>> spinlock_t mac_cr_lock;
>> u8 features;
>> u8 suspend_flags;
>> +
>> + struct usbnet *dev;
>> +static int smsc95xx_gpio_request(struct gpio_chip *gpio, unsigned offset)
>> + mutex_unlock(&pdata->gpio_lock);
>> +
>> +
>> + return (ret < 0) ? ret : 0;
>> +}
>> +
>> +static void smsc95xx_gpio_free(struct gpio_chip *gpio, unsigned offset)
>> + if (ret < 0)
>> + netif_err(pdata->dev, ifdown, pdata->dev->net,
>> + "error freeing gpio %d\n", offset);
>> +
>> +}
> and in other places
>
>> +static void smsc95xx_gpio_set(struct gpio_chip *gpio, unsigned offset,
>> + int value)
>> +{
>> + if (ret < 0) {
>> + netif_err(pdata->dev, ifdown, pdata->dev->net,
>> + "error writing gpio %d=%d\n", offset, value);
>> + return;
>> + }
>> +}
> no need to put a "return" there at he end of the function (if it's
> defensive programming then you didn't put return in similar code in a
> previous function)
>
--
С уважением,
Евгений Богер
ООО Бесконтактные устройства
http://contactless.ru
+7 (919) 965 88 36
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public•gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-06-25 17:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-11 13:34 [PATCH 1/1] Add support for GPIOs for SMSC LAN95xx chips Evgeny Boger
[not found] ` <1399815254-30229-1-git-send-email-boger-hVk9LwgH4SrGCOCKMErq+g@public.gmane.org>
2014-05-13 22:01 ` David Miller
2014-06-24 1:27 ` Evgeny Boger
[not found] ` <53A8D40E.4060608-hVk9LwgH4SrGCOCKMErq+g@public.gmane.org>
2014-06-24 5:19 ` David Miller
2014-06-25 4:46 ` [PATCH v2] " Evgeny Boger
2014-06-25 10:34 ` Daniele Forsi
[not found] ` <CAN_we7MbMywYzysn_Q_iRAOZZuE+KU_jDJxMW-Qz0KK0RHwSRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-25 17:54 ` Evgeny Boger [this message]
2014-10-08 22:14 ` [PATCH v3] " Evgeny Boger
[not found] ` <1412806498-22556-1-git-send-email-boger-hVk9LwgH4SrGCOCKMErq+g@public.gmane.org>
2014-10-09 22:45 ` David Miller
2014-10-10 12:02 ` Bjørn Mork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53AB0CB8.2090007@contactless.ru \
--to=boger-hvk9lwgh4srgcockmerq+g@public$(echo .)gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public$(echo .)gmane.org \
--cc=dforsi-Re5JQEeQqe8AvxtiuMwx3w@public$(echo .)gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
--cc=steve.glendinning-nksJyM/082jR7s880joybQ@public$(echo .)gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox