Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1641531 authored by Shawn Guo's avatar Shawn Guo
Browse files

pinctrl: imx: move hard-coding data into device tree



Currently, all imx pinctrl drivers maintain a big array of struct
imx_pin_reg which hard-codes data like register offset and mux mode
setting for each pin function.  Every time a new imx SoC support is
added, we need to add such a big mount of data.  With moving to single
kernel build, it's only matter of time to be blamed on memory consuming.

With DTC pre-processor support in place, the patch moves all these data
into device tree by redefining the PIN_FUNC_ID in imxXX-pinfunc.h and
changing the PIN_FUNC_ID parsing code a little bit.

The pin id gets re-numbered based on mux register offset, or config
register offset if the pin has no mux register, so that kernel can
identify the pin id from register offsets provided by device tree.

As a bonus point of the change, those arbitrary magic numbers standing
for particular PIN_FUNC_ID in device tree sources are now replaced by
macros to improve the readability of dts files.

Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
Acked-by: default avatarDong Aisheng <dong.aisheng@linaro.org>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 36dffd8f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -24,9 +24,9 @@ Required properties for iomux controller:
Required properties for pin configuration node:
- fsl,pins: two integers array, represents a group of pins mux and config
  setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a
  pin working on a specific function, CONFIG is the pad setting value like
  pull-up on this pin. Please refer to fsl,<soc>-pinctrl.txt for the valid
  pins and functions of each SoC.
  pin working on a specific function, which consists of a tuple of
  <mux_reg conf_reg input_reg mux_val input_val>.  CONFIG is the pad setting
  value like pull-up on this pin.

Bits used for CONFIG:
NO_PAD_CTL(1 << 31): indicate this pin does not need config.
+2 −953

File changed.

Preview size limit exceeded, changes collapsed.

+2 −757

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1172

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1594

File changed.

Preview size limit exceeded, changes collapsed.

Loading