Page MenuHomeFreeBSD

Add GPIO support for QorIQ boards.
ClosedPublic

Authored by dgr_semihalf.com on Apr 9 2020, 3:04 PM.
Tags
None
Referenced Files
F80144480: D24353.id71655.diff
Thu, Mar 28, 1:04 PM
Unknown Object (File)
Jan 16 2024, 9:09 PM
Unknown Object (File)
Dec 26 2023, 8:57 AM
Unknown Object (File)
Dec 26 2023, 8:57 AM
Unknown Object (File)
Dec 26 2023, 8:57 AM
Unknown Object (File)
Dec 24 2023, 11:06 PM
Unknown Object (File)
Dec 24 2023, 2:15 AM
Unknown Object (File)
Dec 20 2023, 3:27 AM
Subscribers

Details

Summary

Tested on and targeted for LS1046A.
The driver implements the following features:

  • setting direction of each pin (IN or OUT)
  • setting the mode of output pins (PUSHPULL or OPENDRAIN)
  • setting the state of each output pin (1 or 0)
  • reading the state of each input pin (1 or 0)

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/conf/files.arm64
196

Do not depend on gpio, add a new driver name to GENERIC and depend on this (and the SOC_ option).

Added SOC_NXP_LS1046A dependency.

sys/arm64/qoriq/ls1046_gpio.c
127

Could you add the gpio_pin_access_32/gpio_pin_config_32 while you're at it please ?

268

You have DEFAULT_CAPS as a mask to check against.

288

gp_flags = flags and remove the line above.

322

I don't see this property in the binding docs

369

You should right the pin name, as a default do :
snprintf(name, GPIOMAXNAME, "pin %d", pin);

469

You should lock and use the internal function to avoid any race.

Thanks, I'll prepare patch in the coming days.

Added pin_access_32 and pin_config_32 functions.
Changed get_name function to generate "pin <pin_number>" as name.
Additional minor fixes.

sys/arm64/qoriq/ls1046_gpio.c
268

This part did not check if capabilities are supported but checked if some impossible condition doesn't happen, such as both input and output flag set.
Since this could have gotten confusing I moved the check outside pin count check and added comment.

322

I removed it.

Hi, if you have any more comments or remarks, please let me know. Thanks.

sys/conf/files.arm64
196

This comment still applies, add a new ls1046_gpio driver in GENERIC and depend on it here.

Add ls1046_gpio device in kernel config. Replace SOC_NXP_LS1046 with SOC_NXP_LS.

This revision is now accepted and ready to land.May 22 2020, 8:32 PM
This revision was automatically updated to reflect the committed changes.