From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Preston Fick <pffick@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, preston.fick@silabs.com,
linux-serial@vger.kernel.org
Subject: Re: [PATCH] usb: cp210x: Added support for GPIO (CP2103/4/5)
Date: Sat, 28 Apr 2012 19:05:02 +0100 [thread overview]
Message-ID: <20120428190502.32eaf294@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <1335632134-2488-1-git-send-email-preston.fick@silabs.com>
> */
> @@ -424,8 +430,8 @@ static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
>
> dbg("%s - port %d", __func__, port->number);
>
> - result = cp210x_set_config_single(port, CP210X_IFC_ENABLE,
> - UART_ENABLE);
> + result = cp210x_set_config(port, REQTYPE_HOST_TO_INTERFACE,
> + CP210X_IFC_ENABLE, UART_ENABLE, NULL, 0);
These kind of unrelated changes make review hard. Why are they there ?
> + case IOCTL_GPIOGET:
> + if ((port_priv->bPartNumber == CP2103_PARTNUM) ||
All the part specific stuff in ifs rapidly gets unmaintainable. Better to
set up a port_priv->get_gpio/set_gpio.
> /*
> * cp210x_get_termios
> * Reads the baud rate, data bits, parity, stop bits and flow control mode
> @@ -490,14 +565,16 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
>
> dbg("%s - port %d", __func__, port->number);
>
> - cp210x_get_config(port, CP210X_GET_BAUDRATE, &baud, 4);
> + cp210x_get_config(port, REQTYPE_INTERFACE_TO_HOST,
> + CP210X_GET_BAUDRATE, 0, &baud, 4);
And again it disturbs all the rest of the code for no apparent good
reason.
The large number of changes all over the code for a single localised
feature change ought to be flagging up that it's not being done in a
clean way.
The other question is whether having some custom gpio poking interface is
actually a good idea. I suspect probably not. The kernel gpio layer can
help a bit but doesn't really solve the problem as there is no way to tie
a gpio to a port. Given how many devices seem to have gpios these days I
wonder if we need a gpio setting interface via termiox.
We could also the agree how that maps onto the extra gpio lines used with
SIM card readers and the like so we can standardise that.
Alan
next prev parent reply other threads:[~2012-04-28 18:05 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-28 16:55 [PATCH] usb: cp210x: Added support for GPIO (CP2103/4/5) Preston Fick
2012-04-28 18:05 ` Alan Cox [this message]
2012-04-28 18:17 ` Uwe Bonnes
2012-04-28 19:33 ` Alan Cox
2012-04-29 13:02 ` Uwe Bonnes
2012-04-29 14:35 ` Xiaofan Chen
[not found] ` <20120428190502.32eaf294-38n7/U1jhRXW96NNrWNlrekiAK3p4hvP@public.gmane.org>
2012-04-28 20:30 ` Preston Fick
2012-04-28 20:30 ` Preston Fick
2012-04-28 21:08 ` Alan Cox
[not found] ` <20120428220808.4674a8df-38n7/U1jhRXW96NNrWNlrekiAK3p4hvP@public.gmane.org>
2012-04-28 21:44 ` Preston Fick
2012-04-28 21:44 ` Preston Fick
-- strict thread matches above, loose matches on Subject: below --
2012-04-30 20:27 Preston Fick
[not found] ` <1335817637-2862-1-git-send-email-preston.fick-S6d6foEdJf7QT0dZR+AlfA@public.gmane.org>
2012-04-30 20:32 ` Greg KH
2012-04-30 20:32 ` Greg KH
2012-05-03 20:34 ` Alan Cox
2012-05-03 20:34 ` Alan Cox
[not found] ` <20120503213456.77c55c51-38n7/U1jhRXW96NNrWNlrekiAK3p4hvP@public.gmane.org>
2012-05-04 15:27 ` Preston Fick
2012-05-04 15:27 ` Preston Fick
2012-05-05 0:32 ` Greg KH
2012-05-05 0:32 ` Greg KH
2012-05-05 11:01 ` Alan Cox
2012-05-05 14:57 ` Greg KH
2012-05-16 15:33 ` Alan Cox
[not found] ` <20120516163347.1721406e-38n7/U1jhRXW96NNrWNlrekiAK3p4hvP@public.gmane.org>
2012-05-16 23:41 ` Greg KH
2012-05-16 23:41 ` Greg KH
2012-05-04 16:26 ` Alexander Stein
2012-05-04 16:33 ` Alan Cox
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=20120428190502.32eaf294@pyramind.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pffick@gmail.com \
--cc=preston.fick@silabs.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.