
On 26 August 2015 at 21:44, Masahiro Yamada yamada.masahiro@socionext.com wrote:
This creates a new framework for handling of pin control devices, i.e. devices that control different aspects of package pins.
This uclass handles pinmuxing and pin configuration; pinmuxing controls switching among silicon blocks that share certain physical pins, pin configuration handles electronic properties such as pin- biasing, load capacitance etc.
This framework can support the same device tree bindings, but if you do not need full interface support, you can disable some features to reduce memory foot print. Typically around 1.5KB is necessary to include full-featured uclass support on ARM board (CONFIG_PINCTRL + CONFIG_PINCTRL_FULL + CONFIG_PINCTRL_GENERIC + CONFIG_PINCTRL_PINMUX), for example.
We are often limited on code size for SPL. Besides, we still have many boards that do not support device tree configuration. The full pinctrl, which requires OF_CONTROL, does not make sense for those boards. So, this framework also has a Do-It-Yourself (let's say simple pinctrl) interface. With CONFIG_PINCTRL_FULL disabled, the uclass itself provides no systematic mechanism for identifying the peripheral device, applying pinctrl settings, etc. They must be done in each low-level driver. In return, you can save much memory footprint and it might be useful especially for SPL.
Signed-off-by: Masahiro Yamada yamada.masahiro@socionext.com Acked-by: Simon Glass sjg@chromium.org
Changes in v5:
- Delete vogus "select PINCTRL_SIMPLE"
- Make PINCTRL depends on DM
- Make SPL_PINCTRL depends on SPL_DM
- Replace ENOTSUPP with ENOSYS
- Do not bind child nodes as pinconfig nodes if they have "compatible"
Changes in v4:
- Squash 01 and 02 into a single commit
- Flip the logic of CONFIG_PINCTRL_SIMPLE into CONFIG_PINCTRL_FULL
- Fix build error: pinconf_ops -> pinctrl_ops
- Add pinctrl_get_ops() macro
- Add help to Kconfig entries
- Return -ENOTSUPP rather than -EINVAL for unsupported operations
drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/core/device.c | 4 + drivers/pinctrl/Kconfig | 101 +++++++++++ drivers/pinctrl/Makefile | 2 + drivers/pinctrl/pinctrl-generic.c | 359 ++++++++++++++++++++++++++++++++++++++ drivers/pinctrl/pinctrl-uclass.c | 240 +++++++++++++++++++++++++ include/dm/pinctrl.h | 227 ++++++++++++++++++++++++ include/dm/uclass-id.h | 2 + 9 files changed, 938 insertions(+) create mode 100644 drivers/pinctrl/Kconfig create mode 100644 drivers/pinctrl/Makefile create mode 100644 drivers/pinctrl/pinctrl-generic.c create mode 100644 drivers/pinctrl/pinctrl-uclass.c create mode 100644 include/dm/pinctrl.h
Applied to u-boot-dm, thanks!