* [PATCH] dm: pinctrl: Use explicit values for enums
@ 2022-02-23 14:02 Michal Simek
2022-02-23 22:59 ` Simon Glass
2022-03-07 7:50 ` Michal Simek
0 siblings, 2 replies; 3+ messages in thread
From: Michal Simek @ 2022-02-23 14:02 UTC (permalink / raw)
To: u-boot, git; +Cc: Ashok Reddy Soma, Simon Glass
From: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Based on discussion at
https://lore.kernel.org/r/20200318125003.GA2727094@kroah.com we got
recommendation to use explicit values for all enums.
So, add explicit values to all pinctrl related enums for readability.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
include/dm/pinctrl.h | 48 ++++++++++++++++++++++----------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/include/dm/pinctrl.h b/include/dm/pinctrl.h
index 8b869c4fbfb7..0c461e56bb48 100644
--- a/include/dm/pinctrl.h
+++ b/include/dm/pinctrl.h
@@ -453,30 +453,30 @@ struct pinctrl_ops {
* presented using the packed format.
*/
enum pin_config_param {
- PIN_CONFIG_BIAS_BUS_HOLD,
- PIN_CONFIG_BIAS_DISABLE,
- PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
- PIN_CONFIG_BIAS_PULL_DOWN,
- PIN_CONFIG_BIAS_PULL_PIN_DEFAULT,
- PIN_CONFIG_BIAS_PULL_UP,
- PIN_CONFIG_DRIVE_OPEN_DRAIN,
- PIN_CONFIG_DRIVE_OPEN_SOURCE,
- PIN_CONFIG_DRIVE_PUSH_PULL,
- PIN_CONFIG_DRIVE_STRENGTH,
- PIN_CONFIG_DRIVE_STRENGTH_UA,
- PIN_CONFIG_INPUT_DEBOUNCE,
- PIN_CONFIG_INPUT_ENABLE,
- PIN_CONFIG_INPUT_SCHMITT,
- PIN_CONFIG_INPUT_SCHMITT_ENABLE,
- PIN_CONFIG_LOW_POWER_MODE,
- PIN_CONFIG_OUTPUT_ENABLE,
- PIN_CONFIG_OUTPUT,
- PIN_CONFIG_POWER_SOURCE,
- PIN_CONFIG_SLEEP_HARDWARE_STATE,
- PIN_CONFIG_SLEW_RATE,
- PIN_CONFIG_SKEW_DELAY,
- PIN_CONFIG_END = 0x7F,
- PIN_CONFIG_MAX = 0xFF,
+ PIN_CONFIG_BIAS_BUS_HOLD = 0,
+ PIN_CONFIG_BIAS_DISABLE = 1,
+ PIN_CONFIG_BIAS_HIGH_IMPEDANCE = 2,
+ PIN_CONFIG_BIAS_PULL_DOWN = 3,
+ PIN_CONFIG_BIAS_PULL_PIN_DEFAULT = 4,
+ PIN_CONFIG_BIAS_PULL_UP = 5,
+ PIN_CONFIG_DRIVE_OPEN_DRAIN = 6,
+ PIN_CONFIG_DRIVE_OPEN_SOURCE = 7,
+ PIN_CONFIG_DRIVE_PUSH_PULL = 8,
+ PIN_CONFIG_DRIVE_STRENGTH = 9,
+ PIN_CONFIG_DRIVE_STRENGTH_UA = 10,
+ PIN_CONFIG_INPUT_DEBOUNCE = 11,
+ PIN_CONFIG_INPUT_ENABLE = 12,
+ PIN_CONFIG_INPUT_SCHMITT = 13,
+ PIN_CONFIG_INPUT_SCHMITT_ENABLE = 14,
+ PIN_CONFIG_LOW_POWER_MODE = 15,
+ PIN_CONFIG_OUTPUT_ENABLE = 16,
+ PIN_CONFIG_OUTPUT = 17,
+ PIN_CONFIG_POWER_SOURCE = 18,
+ PIN_CONFIG_SLEEP_HARDWARE_STATE = 19,
+ PIN_CONFIG_SLEW_RATE = 20,
+ PIN_CONFIG_SKEW_DELAY = 21,
+ PIN_CONFIG_END = 127, /* 0x7F */
+ PIN_CONFIG_MAX = 255, /* 0xFF */
};
#if CONFIG_IS_ENABLED(PINCTRL_GENERIC)
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] dm: pinctrl: Use explicit values for enums
2022-02-23 14:02 [PATCH] dm: pinctrl: Use explicit values for enums Michal Simek
@ 2022-02-23 22:59 ` Simon Glass
2022-03-07 7:50 ` Michal Simek
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2022-02-23 22:59 UTC (permalink / raw)
To: Michal Simek; +Cc: U-Boot Mailing List, git, Ashok Reddy Soma
On Wed, 23 Feb 2022 at 07:02, Michal Simek <michal.simek@xilinx.com> wrote:
>
> From: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
>
> Based on discussion at
> https://lore.kernel.org/r/20200318125003.GA2727094@kroah.com we got
> recommendation to use explicit values for all enums.
>
> So, add explicit values to all pinctrl related enums for readability.
>
> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> include/dm/pinctrl.h | 48 ++++++++++++++++++++++----------------------
> 1 file changed, 24 insertions(+), 24 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dm: pinctrl: Use explicit values for enums
2022-02-23 14:02 [PATCH] dm: pinctrl: Use explicit values for enums Michal Simek
2022-02-23 22:59 ` Simon Glass
@ 2022-03-07 7:50 ` Michal Simek
1 sibling, 0 replies; 3+ messages in thread
From: Michal Simek @ 2022-03-07 7:50 UTC (permalink / raw)
To: U-Boot, git; +Cc: Ashok Reddy Soma, Simon Glass
st 23. 2. 2022 v 15:02 odesílatel Michal Simek <michal.simek@xilinx.com> napsal:
>
> From: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
>
> Based on discussion at
> https://lore.kernel.org/r/20200318125003.GA2727094@kroah.com we got
> recommendation to use explicit values for all enums.
>
> So, add explicit values to all pinctrl related enums for readability.
>
> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> include/dm/pinctrl.h | 48 ++++++++++++++++++++++----------------------
> 1 file changed, 24 insertions(+), 24 deletions(-)
>
> diff --git a/include/dm/pinctrl.h b/include/dm/pinctrl.h
> index 8b869c4fbfb7..0c461e56bb48 100644
> --- a/include/dm/pinctrl.h
> +++ b/include/dm/pinctrl.h
> @@ -453,30 +453,30 @@ struct pinctrl_ops {
> * presented using the packed format.
> */
> enum pin_config_param {
> - PIN_CONFIG_BIAS_BUS_HOLD,
> - PIN_CONFIG_BIAS_DISABLE,
> - PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
> - PIN_CONFIG_BIAS_PULL_DOWN,
> - PIN_CONFIG_BIAS_PULL_PIN_DEFAULT,
> - PIN_CONFIG_BIAS_PULL_UP,
> - PIN_CONFIG_DRIVE_OPEN_DRAIN,
> - PIN_CONFIG_DRIVE_OPEN_SOURCE,
> - PIN_CONFIG_DRIVE_PUSH_PULL,
> - PIN_CONFIG_DRIVE_STRENGTH,
> - PIN_CONFIG_DRIVE_STRENGTH_UA,
> - PIN_CONFIG_INPUT_DEBOUNCE,
> - PIN_CONFIG_INPUT_ENABLE,
> - PIN_CONFIG_INPUT_SCHMITT,
> - PIN_CONFIG_INPUT_SCHMITT_ENABLE,
> - PIN_CONFIG_LOW_POWER_MODE,
> - PIN_CONFIG_OUTPUT_ENABLE,
> - PIN_CONFIG_OUTPUT,
> - PIN_CONFIG_POWER_SOURCE,
> - PIN_CONFIG_SLEEP_HARDWARE_STATE,
> - PIN_CONFIG_SLEW_RATE,
> - PIN_CONFIG_SKEW_DELAY,
> - PIN_CONFIG_END = 0x7F,
> - PIN_CONFIG_MAX = 0xFF,
> + PIN_CONFIG_BIAS_BUS_HOLD = 0,
> + PIN_CONFIG_BIAS_DISABLE = 1,
> + PIN_CONFIG_BIAS_HIGH_IMPEDANCE = 2,
> + PIN_CONFIG_BIAS_PULL_DOWN = 3,
> + PIN_CONFIG_BIAS_PULL_PIN_DEFAULT = 4,
> + PIN_CONFIG_BIAS_PULL_UP = 5,
> + PIN_CONFIG_DRIVE_OPEN_DRAIN = 6,
> + PIN_CONFIG_DRIVE_OPEN_SOURCE = 7,
> + PIN_CONFIG_DRIVE_PUSH_PULL = 8,
> + PIN_CONFIG_DRIVE_STRENGTH = 9,
> + PIN_CONFIG_DRIVE_STRENGTH_UA = 10,
> + PIN_CONFIG_INPUT_DEBOUNCE = 11,
> + PIN_CONFIG_INPUT_ENABLE = 12,
> + PIN_CONFIG_INPUT_SCHMITT = 13,
> + PIN_CONFIG_INPUT_SCHMITT_ENABLE = 14,
> + PIN_CONFIG_LOW_POWER_MODE = 15,
> + PIN_CONFIG_OUTPUT_ENABLE = 16,
> + PIN_CONFIG_OUTPUT = 17,
> + PIN_CONFIG_POWER_SOURCE = 18,
> + PIN_CONFIG_SLEEP_HARDWARE_STATE = 19,
> + PIN_CONFIG_SLEW_RATE = 20,
> + PIN_CONFIG_SKEW_DELAY = 21,
> + PIN_CONFIG_END = 127, /* 0x7F */
> + PIN_CONFIG_MAX = 255, /* 0xFF */
> };
>
> #if CONFIG_IS_ENABLED(PINCTRL_GENERIC)
> --
> 2.35.1
>
Applied.
M
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-07 7:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-23 14:02 [PATCH] dm: pinctrl: Use explicit values for enums Michal Simek
2022-02-23 22:59 ` Simon Glass
2022-03-07 7:50 ` Michal Simek
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.