openbouffalo / linux

Linux kernel source tree
Other
6 stars 4 forks source link

pinctrl: bflb: fix the numeric function values #5

Open kadamski opened 1 year ago

kadamski commented 1 year ago

The function values to be written to the register are not consecutive (like there are no functions for values 12-15). The pinctrl subsystem assigns the indexes (selectors) for each function as they are added so the selector for pwm0 was 12, not 16. Since bflb_gpio_pinmux_set was using those selectors as a register value, all of the functions 12+ were not set correctly. For example for i2c2, the value of 15 was written to the register instead of 19.

This patch fixes this problem by introducing a new struct that contains the name and the correct function value for each pin.

alexhorner commented 1 year ago

LGTM, testing required, #6 seems preferrable as then we'll remain equal to U-Boot's list, but that is just my personal opinion. Group discussion required.