[U-Boot] [PATCH v4 2/3] pinctrl: add pin control uclass support

Simon Glass sjg at chromium.org
Wed Aug 26 05:06:10 CEST 2015


On 24 August 2015 at 22:51, Masahiro Yamada
<yamada.masahiro at 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 at socionext.com>
> ---
>
> 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  | 229 ++++++++++++++++++++++++
>  include/dm/pinctrl.h              | 227 ++++++++++++++++++++++++
>  include/dm/uclass-id.h            |   2 +
>  9 files changed, 927 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

Acked-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list