diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 10:05:51 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 10:05:51 +0000 |
commit | 5d1646d90e1f2cceb9f0828f4b28318cd0ec7744 (patch) | |
tree | a94efe259b9009378be6d90eb30d2b019d95c194 /drivers/pinctrl/cirrus/pinctrl-cs47l92.c | |
parent | Initial commit. (diff) | |
download | linux-5d1646d90e1f2cceb9f0828f4b28318cd0ec7744.tar.xz linux-5d1646d90e1f2cceb9f0828f4b28318cd0ec7744.zip |
Adding upstream version 5.10.209.upstream/5.10.209upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/pinctrl/cirrus/pinctrl-cs47l92.c')
-rw-r--r-- | drivers/pinctrl/cirrus/pinctrl-cs47l92.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/pinctrl/cirrus/pinctrl-cs47l92.c b/drivers/pinctrl/cirrus/pinctrl-cs47l92.c new file mode 100644 index 000000000..4e4097343 --- /dev/null +++ b/drivers/pinctrl/cirrus/pinctrl-cs47l92.c @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Pinctrl for Cirrus Logic CS47L92 + * + * Copyright (C) 2018-2019 Cirrus Logic, Inc. and + * Cirrus Logic International Semiconductor Ltd. + */ + +#include <linux/err.h> +#include <linux/mfd/madera/core.h> + +#include "pinctrl-madera.h" + +/* + * The alt func groups are the most commonly used functions we place these at + * the lower function indexes for convenience, and the less commonly used gpio + * functions at higher indexes. + * + * To stay consistent with the datasheet the function names are the same as + * the group names for that function's pins + * + * Note - all 1 less than in datasheet because these are zero-indexed + */ +static const unsigned int cs47l92_spk1_pins[] = { 2, 3 }; +static const unsigned int cs47l92_aif1_pins[] = { 4, 5, 6, 7 }; +static const unsigned int cs47l92_aif2_pins[] = { 8, 9, 10, 11 }; +static const unsigned int cs47l92_aif3_pins[] = { 12, 13, 14, 15 }; + +static const struct madera_pin_groups cs47l92_pin_groups[] = { + { "aif1", cs47l92_aif1_pins, ARRAY_SIZE(cs47l92_aif1_pins) }, + { "aif2", cs47l92_aif2_pins, ARRAY_SIZE(cs47l92_aif2_pins) }, + { "aif3", cs47l92_aif3_pins, ARRAY_SIZE(cs47l92_aif3_pins) }, + { "pdmspk1", cs47l92_spk1_pins, ARRAY_SIZE(cs47l92_spk1_pins) }, +}; + +const struct madera_pin_chip cs47l92_pin_chip = { + .n_pins = CS47L92_NUM_GPIOS, + .pin_groups = cs47l92_pin_groups, + .n_pin_groups = ARRAY_SIZE(cs47l92_pin_groups), +}; |