[v5,0/2] Support Nvidia BlueField-3 GPIO driver and pin controller

Message ID 20230314221609.22433-1-asmaa@nvidia.com
Headers
Series Support Nvidia BlueField-3 GPIO driver and pin controller |

Message

Asmaa Mnebhi March 14, 2023, 10:16 p.m. UTC
  Support the BlueField-3 SoC GPIO driver for handling interrupts and
providing the option to change the direction and value of a GPIO.
Support the BlueField-3 SoC pin controller driver for allowing a
select number of GPIO pins to be manipulated from userspace or
the kernel.

The gpio-mlxbf3.c driver handles hardware registers and logic
that are different from gpio-mlxbf.c and gpio-mlxbf2.c.
For that reason, we have separate drivers for each generation.

Changes from v4->v5:

gpio-mlxbf3.c:
- Update Kconfig dependency in gpio
- remove version.h header
- use irq_hw_number_t
- release lock in mlxbf3_gpio_irq_set_type
- add IRQCHIP_IMMUTABLE and GPIOCHIP_IRQ_RESOURCE_HELPERS
- remove npins property to use ngpios instead
- Assign handle_bad_irq() in probe
- Use handle_edge_irq instead  

pinctrl-mlxbf3.c:
- change the driver name to pinctrl-mlxbf3
- alignment cleanup
- use PINCTRL_PINFUNCTION
- use pinctrl_add_gpio_ranges
- use devm_platform_ioremap_resource


Asmaa Mnebhi (2):
  gpio: gpio-mlxbf3: Add gpio driver support
  pinctrl: pinctrl-mlxbf: Add pinctrl driver support

 drivers/gpio/Kconfig             |  13 ++
 drivers/gpio/Makefile            |   1 +
 drivers/gpio/gpio-mlxbf3.c       | 245 ++++++++++++++++++++++++
 drivers/pinctrl/Kconfig          |  13 ++
 drivers/pinctrl/Makefile         |   1 +
 drivers/pinctrl/pinctrl-mlxbf3.c | 318 +++++++++++++++++++++++++++++++
 6 files changed, 591 insertions(+)
 create mode 100644 drivers/gpio/gpio-mlxbf3.c
 create mode 100644 drivers/pinctrl/pinctrl-mlxbf3.c
  

Comments

Andy Shevchenko March 15, 2023, 9:22 a.m. UTC | #1
On Wed, Mar 15, 2023 at 12:16 AM Asmaa Mnebhi <asmaa@nvidia.com> wrote:
>
> Support the BlueField-3 SoC GPIO driver for handling interrupts and
> providing the option to change the direction and value of a GPIO.
> Support the BlueField-3 SoC pin controller driver for allowing a
> select number of GPIO pins to be manipulated from userspace or
> the kernel.
>
> The gpio-mlxbf3.c driver handles hardware registers and logic
> that are different from gpio-mlxbf.c and gpio-mlxbf2.c.
> For that reason, we have separate drivers for each generation.

This one is in pretty good shape, a few minor things to be addressed
and the v6 I believe will be ready to go.
  
Linus Walleij March 15, 2023, 10:12 a.m. UTC | #2
Hi Asamaa,

thanks for your patches!

Once you have addressed the final review comments from Andy,
do these drivers have compile time depenencies so we need to merge
them both at the same time or can the two patches be applied
individually to GPIO and pin control?

BTW: big thanks to Andy for the big investment in reviewing this
driver!

Yours,
Linus Walleij
  
Asmaa Mnebhi March 15, 2023, 1:11 p.m. UTC | #3
> Hi Asamaa,
> 
> thanks for your patches!
> 
> Once you have addressed the final review comments from Andy, do these
> drivers have compile time depenencies so we need to merge them both at
> the same time or can the two patches be applied individually to GPIO and
> pin control?
> 
> BTW: big thanks to Andy for the big investment in reviewing this driver!

Hi Linus,

These drivers don’t have any compile dependency on each other.

And yes! Thank you Andy for your review, I learned a lot!

Thanks.
Asmaa