mbox series

[net-next,00/11] Modernize mdio-gpio

Message ID 1524092579-15625-1-git-send-email-andrew@lunn.ch
Headers show
Series Modernize mdio-gpio | expand

Message

Andrew Lunn April 18, 2018, 11:02 p.m. UTC
This patchset is inspired by a previous version by Linus Walleij

It reworks the mdio-gpio code to make use of gpio descriptors instead
of gpio numbers. However compared to the previous version, it retains
support for platform devices. It does however remove the platform_data
header file. The needed GPIOs are now passed by making use of a gpiod
lookup table. e.g:

static struct gpiod_lookup_table zii_scu_mdio_gpiod_table = {
	.dev_id = "mdio-gpio.0",
	.table = {
		GPIO_LOOKUP_IDX("gpio_ich", 17, NULL, MDIO_GPIO_MDC,
				GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP_IDX("gpio_ich", 2, NULL, MDIO_GPIO_MDIO,
				GPIO_ACTIVE_HIGH),
		GPIO_LOOKUP_IDX("gpio_ich", 21, NULL, MDIO_GPIO_MDO,
				GPIO_ACTIVE_LOW),
	},
};

Andrew Lunn (11):
  net: phy_ mdio-gpio: Fixup , which should be ;
  net: phy: mdio-gpio: Remove reset function
  net: phy: mdio-bitbang: Remove reset support
  net: phy: mdio-gpio: remove support for ignoring turn around
  net: phy: mdio-gpio: remove support for phy mask
  net: phy: mdio-gpio: Remove support for IRQs in platform data
  net: phy: mdio-gpio: Swap to using gpio descriptors
  net: phy: mdio-gpio: Move allocation for bitbanging data
  net: phy: mdio-gpio: Parse properties directly into bitbang structure
  net: phy: mdio-gpio: Add #defines for the GPIO index's
  net: phy: mdio-gpio: Remove redundant platform data header

 MAINTAINERS                             |   1 -
 drivers/net/phy/mdio-bitbang.c          |   9 --
 drivers/net/phy/mdio-gpio.c             | 122 ++++++------------------
 include/linux/mdio-bitbang.h            |   2 -
 include/linux/mdio-gpio.h               |   9 ++
 include/linux/platform_data/mdio-gpio.h |  33 -------
 6 files changed, 40 insertions(+), 136 deletions(-)
 create mode 100644 include/linux/mdio-gpio.h
 delete mode 100644 include/linux/platform_data/mdio-gpio.h

Comments

Linus Walleij April 19, 2018, 7:52 p.m. UTC | #1
On Thu, Apr 19, 2018 at 1:02 AM, Andrew Lunn <andrew@lunn.ch> wrote:

> This patchset is inspired by a previous version by Linus Walleij
>
> It reworks the mdio-gpio code to make use of gpio descriptors instead
> of gpio numbers. However compared to the previous version, it retains
> support for platform devices. It does however remove the platform_data
> header file. The needed GPIOs are now passed by making use of a gpiod
> lookup table. e.g:

Looks good to me, but wasn't this what Florian was NACKing?

I thought he was going to add some x86 MDIO using platform data,
and then I suppose he wanted to use something more than some
GPIO descriptors, maybe IRQ etc (who knows)?

If he only needs to put in GPIO descriptors then this is fine of
course.

Anyway the series has a solid:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Thanks,
Linus Walleij
David Miller April 19, 2018, 7:59 p.m. UTC | #2
From: Andrew Lunn <andrew@lunn.ch>
Date: Thu, 19 Apr 2018 01:02:48 +0200

> This patchset is inspired by a previous version by Linus Walleij
> 
> It reworks the mdio-gpio code to make use of gpio descriptors instead
> of gpio numbers. However compared to the previous version, it retains
> support for platform devices. It does however remove the platform_data
> header file. The needed GPIOs are now passed by making use of a gpiod
> lookup table. e.g:
> 
> static struct gpiod_lookup_table zii_scu_mdio_gpiod_table = {
> 	.dev_id = "mdio-gpio.0",
> 	.table = {
> 		GPIO_LOOKUP_IDX("gpio_ich", 17, NULL, MDIO_GPIO_MDC,
> 				GPIO_ACTIVE_HIGH),
> 		GPIO_LOOKUP_IDX("gpio_ich", 2, NULL, MDIO_GPIO_MDIO,
> 				GPIO_ACTIVE_HIGH),
> 		GPIO_LOOKUP_IDX("gpio_ich", 21, NULL, MDIO_GPIO_MDO,
> 				GPIO_ACTIVE_LOW),
> 	},
> };

Nice set of simplifications, applied.
Andrew Lunn April 19, 2018, 8:20 p.m. UTC | #3
On Thu, Apr 19, 2018 at 09:52:09PM +0200, Linus Walleij wrote:
> On Thu, Apr 19, 2018 at 1:02 AM, Andrew Lunn <andrew@lunn.ch> wrote:
> 
> > This patchset is inspired by a previous version by Linus Walleij
> >
> > It reworks the mdio-gpio code to make use of gpio descriptors instead
> > of gpio numbers. However compared to the previous version, it retains
> > support for platform devices. It does however remove the platform_data
> > header file. The needed GPIOs are now passed by making use of a gpiod
> > lookup table. e.g:
> 
> Looks good to me, but wasn't this what Florian was NACKing?

Hi Linus

At the time, i don't think either Florian or i knew about gpiod lookup
tables. It was only when i got deep into this patchset i found them.

> I thought he was going to add some x86 MDIO using platform data,
> and then I suppose he wanted to use something more than some
> GPIO descriptors, maybe IRQ etc (who knows)?

I now have said x86 MDIO device, connecting to an Ethernet switch. It
works :-)

      Andrew