mbox series

[v5,0/6] Enhancements to AMD pinctrl and implementation of AMD pinmux

Message ID 20220601121438.999369-1-Basavaraj.Natikar@amd.com
Headers show
Series Enhancements to AMD pinctrl and implementation of AMD pinmux | expand

Message

Basavaraj Natikar June 1, 2022, 12:14 p.m. UTC
Changes include enhancements to pinctrl-amd and implementing
AMD pinmux functionalities.

v5:
	- removed parentheses around compound literals.
	- change platform_get_resource and devm_ioremap to 
	  devm_platform_ioremap_resource. 
	- change dev_warn to dev_err wherever returns invalid or error.

v4:
        - Fix kernel doc issue
        - change PINCTRL_GRP to PINCTRL_PINGROUP
        - change fwnode_property_match_string to
          device_property_match_string.
        - make slightly better indentation and code few lines shorter.

v3:
        - change amd_pingroup to pingroup and moved to pinctrl.h.
        - Add prefix AMD_ at appropriate places.
        - use _DSD property to get iomux resource.

v2:
        - Fix for initializer element is not a compile-time constant
          on riscv architecture reported by kernel test robot
          <lkp@intel.com>.

Link: https://lore.kernel.org/all/202205240107.bryIFhOh-lkp@intel.com/

Basavaraj Natikar (6):
  pinctrl: Add pingroup and define PINCTRL_PINGROUP
  pinctrl: amd: Remove amd_pingroup and use pingroup
  pinctrl: amd: Use PINCTRL_PINGROUP to manage pingroups
  pinctrl: amd: Define and use AMD_PINS macro
  pinctrl: amd: Add amd_get_iomux_res function
  pinctrl: amd: Implement pinmux functionality

 drivers/pinctrl/pinctrl-amd.c   |   98 +++
 drivers/pinctrl/pinctrl-amd.h   | 1376 ++++++++++++++++++++++++++++++-
 include/linux/pinctrl/pinctrl.h |   20 +
 3 files changed, 1450 insertions(+), 44 deletions(-)

Comments

Andy Shevchenko June 1, 2022, 1:23 p.m. UTC | #1
On Wed, Jun 01, 2022 at 05:44:33PM +0530, Basavaraj Natikar wrote:
> Add 'struct pingroup' to represent pingroup and 'PINCTRL_PINGROUP'
> macro for inline use. Both are used to manage and represent
> larger number of pingroups.

LGTM,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Thanks!

> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
> ---
>  include/linux/pinctrl/pinctrl.h | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
> index 70b45d28e7a9..487117ccb1bc 100644
> --- a/include/linux/pinctrl/pinctrl.h
> +++ b/include/linux/pinctrl/pinctrl.h
> @@ -26,6 +26,26 @@ struct pin_config_item;
>  struct gpio_chip;
>  struct device_node;
>  
> +/**
> + * struct pingroup - provides information on pingroup
> + * @name: a name for pingroup
> + * @pins: an array of pins in the pingroup
> + * @npins: number of pins in the pingroup
> + */
> +struct pingroup {
> +	const char *name;
> +	const unsigned int *pins;
> +	size_t npins;
> +};
> +
> +/* Convenience macro to define a single named or anonymous pingroup */
> +#define PINCTRL_PINGROUP(_name, _pins, _npins)	\
> +(struct pingroup){				\
> +	.name = _name,				\
> +	.pins = _pins,				\
> +	.npins = _npins,			\
> +}
> +
>  /**
>   * struct pinctrl_pin_desc - boards/machines provide information on their
>   * pins, pads or other muxable units in this struct
> -- 
> 2.25.1
>