Re: [PATCH v4 2/2] pinctrl: pinmux: Add pinmux-select debugfs file

2021-02-17 Thread Dan Carpenter
On Thu, Feb 11, 2021 at 07:35:33PM -0800, Drew Fustini wrote: > On Thu, Feb 11, 2021 at 10:39:38AM +0300, Dan Carpenter wrote: > > On Wed, Feb 10, 2021 at 11:24:23PM -0800, Joe Perches wrote: > > > On Thu, 2021-02-11 at 10:11 +0300, Dan Carpenter wrote: > > > > On Wed, Feb 10, 2021 at 02:28:54PM

Re: [PATCH v4 2/2] pinctrl: pinmux: Add pinmux-select debugfs file

2021-02-11 Thread Drew Fustini
On Thu, Feb 11, 2021 at 03:00:51PM +0300, Dan Carpenter wrote: > On Wed, Feb 10, 2021 at 02:28:54PM -0800, Drew Fustini wrote: > > Add "pinmux-select" to debugfs which will activate a function and group > > when "" are written to the file. The write > > operation pinmux_select() handles this by

Re: [PATCH v4 2/2] pinctrl: pinmux: Add pinmux-select debugfs file

2021-02-11 Thread Drew Fustini
On Thu, Feb 11, 2021 at 11:53:24AM +0200, Andy Shevchenko wrote: > On Thu, Feb 11, 2021 at 10:09 AM Geert Uytterhoeven > wrote: > > On Wed, Feb 10, 2021 at 11:33 PM Drew Fustini wrote: > > > > > +#define PINMUX_MAX_NAME 64 > > > > + if (len > (PINMUX_MAX_NAME * 2)) { > > > +

Re: [PATCH v4 2/2] pinctrl: pinmux: Add pinmux-select debugfs file

2021-02-11 Thread Drew Fustini
On Thu, Feb 11, 2021 at 09:09:03AM +0100, Geert Uytterhoeven wrote: > Hi Drew, > > On Wed, Feb 10, 2021 at 11:33 PM Drew Fustini wrote: > > Add "pinmux-select" to debugfs which will activate a function and group > > when "" are written to the file. The write > > operation pinmux_select() handles

Re: [PATCH v4 2/2] pinctrl: pinmux: Add pinmux-select debugfs file

2021-02-11 Thread Drew Fustini
On Thu, Feb 11, 2021 at 10:39:38AM +0300, Dan Carpenter wrote: > On Wed, Feb 10, 2021 at 11:24:23PM -0800, Joe Perches wrote: > > On Thu, 2021-02-11 at 10:11 +0300, Dan Carpenter wrote: > > > On Wed, Feb 10, 2021 at 02:28:54PM -0800, Drew Fustini wrote: > > > > + ret = strncpy_from_user(buf,

Re: [PATCH v4 2/2] pinctrl: pinmux: Add pinmux-select debugfs file

2021-02-11 Thread Dan Carpenter
On Wed, Feb 10, 2021 at 02:28:54PM -0800, Drew Fustini wrote: > Add "pinmux-select" to debugfs which will activate a function and group > when "" are written to the file. The write > operation pinmux_select() handles this by checking that the names map to > valid selectors and then calling

Re: [PATCH v4 2/2] pinctrl: pinmux: Add pinmux-select debugfs file

2021-02-11 Thread Andy Shevchenko
On Thu, Feb 11, 2021 at 10:09 AM Geert Uytterhoeven wrote: > On Wed, Feb 10, 2021 at 11:33 PM Drew Fustini wrote: > > +#define PINMUX_MAX_NAME 64 > > + if (len > (PINMUX_MAX_NAME * 2)) { > > + dev_err(pctldev->dev, "write too big for buffer"); > > + return

Re: [PATCH v4 2/2] pinctrl: pinmux: Add pinmux-select debugfs file

2021-02-11 Thread Geert Uytterhoeven
Hi Drew, On Wed, Feb 10, 2021 at 11:33 PM Drew Fustini wrote: > Add "pinmux-select" to debugfs which will activate a function and group > when "" are written to the file. The write > operation pinmux_select() handles this by checking that the names map to > valid selectors and then calling

Re: [PATCH v4 2/2] pinctrl: pinmux: Add pinmux-select debugfs file

2021-02-10 Thread Dan Carpenter
On Wed, Feb 10, 2021 at 11:24:23PM -0800, Joe Perches wrote: > On Thu, 2021-02-11 at 10:11 +0300, Dan Carpenter wrote: > > On Wed, Feb 10, 2021 at 02:28:54PM -0800, Drew Fustini wrote: > > > + ret = strncpy_from_user(buf, user_buf, PINMUX_MAX_NAME * 2); > > > + if (ret < 0) { > > > +

Re: [PATCH v4 2/2] pinctrl: pinmux: Add pinmux-select debugfs file

2021-02-10 Thread Joe Perches
On Thu, 2021-02-11 at 10:11 +0300, Dan Carpenter wrote: > On Wed, Feb 10, 2021 at 02:28:54PM -0800, Drew Fustini wrote: > > + ret = strncpy_from_user(buf, user_buf, PINMUX_MAX_NAME * 2); > > + if (ret < 0) { > > + dev_err(pctldev->dev, "failed to copy buffer from userspace"); > > +

Re: [PATCH v4 2/2] pinctrl: pinmux: Add pinmux-select debugfs file

2021-02-10 Thread Dan Carpenter
On Wed, Feb 10, 2021 at 02:28:54PM -0800, Drew Fustini wrote: > + ret = strncpy_from_user(buf, user_buf, PINMUX_MAX_NAME * 2); > + if (ret < 0) { > + dev_err(pctldev->dev, "failed to copy buffer from userspace"); > + goto free_gname; > + } > + buf[len-1] =

[PATCH v4 2/2] pinctrl: pinmux: Add pinmux-select debugfs file

2021-02-10 Thread Drew Fustini
Add "pinmux-select" to debugfs which will activate a function and group when "" are written to the file. The write operation pinmux_select() handles this by checking that the names map to valid selectors and then calling ops->set_mux(). The existing "pinmux-functions" debugfs file lists the pin