Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: madera: Add configuration for Cirrus Logic CS47L92

This adds the pinctrl configuration for the CS47L92 codec to
the madera pinctrl driver.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20190722091015.20884-3-ckeepax@opensource.cirrus.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Charles Keepax and committed by
Linus Walleij
a1db8da7 b0bca3e4

+63
+3
drivers/pinctrl/cirrus/Kconfig
··· 26 26 27 27 config PINCTRL_CS47L90 28 28 bool 29 + 30 + config PINCTRL_CS47L92 31 + bool
+3
drivers/pinctrl/cirrus/Makefile
··· 15 15 ifeq ($(CONFIG_PINCTRL_CS47L90),y) 16 16 pinctrl-madera-objs += pinctrl-cs47l90.o 17 17 endif 18 + ifeq ($(CONFIG_PINCTRL_CS47L92),y) 19 + pinctrl-madera-objs += pinctrl-cs47l92.o 20 + endif 18 21 19 22 obj-$(CONFIG_PINCTRL_MADERA) += pinctrl-madera.o
+40
drivers/pinctrl/cirrus/pinctrl-cs47l92.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Pinctrl for Cirrus Logic CS47L92 4 + * 5 + * Copyright (C) 2018-2019 Cirrus Logic, Inc. and 6 + * Cirrus Logic International Semiconductor Ltd. 7 + */ 8 + 9 + #include <linux/err.h> 10 + #include <linux/mfd/madera/core.h> 11 + 12 + #include "pinctrl-madera.h" 13 + 14 + /* 15 + * The alt func groups are the most commonly used functions we place these at 16 + * the lower function indexes for convenience, and the less commonly used gpio 17 + * functions at higher indexes. 18 + * 19 + * To stay consistent with the datasheet the function names are the same as 20 + * the group names for that function's pins 21 + * 22 + * Note - all 1 less than in datasheet because these are zero-indexed 23 + */ 24 + static const unsigned int cs47l92_spk1_pins[] = { 2, 3 }; 25 + static const unsigned int cs47l92_aif1_pins[] = { 4, 5, 6, 7 }; 26 + static const unsigned int cs47l92_aif2_pins[] = { 8, 9, 10, 11 }; 27 + static const unsigned int cs47l92_aif3_pins[] = { 12, 13, 14, 15 }; 28 + 29 + static const struct madera_pin_groups cs47l92_pin_groups[] = { 30 + { "aif1", cs47l92_aif1_pins, ARRAY_SIZE(cs47l92_aif1_pins) }, 31 + { "aif2", cs47l92_aif2_pins, ARRAY_SIZE(cs47l92_aif2_pins) }, 32 + { "aif3", cs47l92_aif3_pins, ARRAY_SIZE(cs47l92_aif3_pins) }, 33 + { "pdmspk1", cs47l92_spk1_pins, ARRAY_SIZE(cs47l92_spk1_pins) }, 34 + }; 35 + 36 + const struct madera_pin_chip cs47l92_pin_chip = { 37 + .n_pins = CS47L92_NUM_GPIOS, 38 + .pin_groups = cs47l92_pin_groups, 39 + .n_pin_groups = ARRAY_SIZE(cs47l92_pin_groups), 40 + };
+16
drivers/pinctrl/cirrus/pinctrl-madera-core.c
··· 396 396 .group_names = madera_pin_single_group_names, 397 397 .func = 0x157 398 398 }, 399 + { 400 + .name = "aux-pdm-clk", 401 + .group_names = madera_pin_single_group_names, 402 + .func = 0x280 403 + }, 404 + { 405 + .name = "aux-pdm-dat", 406 + .group_names = madera_pin_single_group_names, 407 + .func = 0x281 408 + }, 399 409 }; 400 410 401 411 static u16 madera_pin_make_drv_str(struct madera_pin_private *priv, ··· 1031 1021 case CS47L91: 1032 1022 if (IS_ENABLED(CONFIG_PINCTRL_CS47L90)) 1033 1023 priv->chip = &cs47l90_pin_chip; 1024 + break; 1025 + case CS42L92: 1026 + case CS47L92: 1027 + case CS47L93: 1028 + if (IS_ENABLED(CONFIG_PINCTRL_CS47L92)) 1029 + priv->chip = &cs47l92_pin_chip; 1034 1030 break; 1035 1031 default: 1036 1032 break;
+1
drivers/pinctrl/cirrus/pinctrl-madera.h
··· 34 34 extern const struct madera_pin_chip cs47l35_pin_chip; 35 35 extern const struct madera_pin_chip cs47l85_pin_chip; 36 36 extern const struct madera_pin_chip cs47l90_pin_chip; 37 + extern const struct madera_pin_chip cs47l92_pin_chip; 37 38 38 39 #endif