Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Pinctrl for Cirrus Logic CS47L90
0004  *
0005  * Copyright (C) 2016-2017 Cirrus Logic
0006  */
0007 
0008 #include <linux/err.h>
0009 #include <linux/mfd/madera/core.h>
0010 
0011 #include "pinctrl-madera.h"
0012 
0013 /*
0014  * The alt func groups are the most commonly used functions we place these at
0015  * the lower function indexes for convenience, and the less commonly used gpio
0016  * functions at higher indexes.
0017  *
0018  * To stay consistent with the datasheet the function names are the same as
0019  * the group names for that function's pins
0020  *
0021  * Note - all 1 less than in datasheet because these are zero-indexed
0022  */
0023 static const unsigned int cs47l90_mif1_pins[] = { 8, 9 };
0024 static const unsigned int cs47l90_mif2_pins[] = { 10, 11 };
0025 static const unsigned int cs47l90_mif3_pins[] = { 12, 13 };
0026 static const unsigned int cs47l90_aif1_pins[] = { 14, 15, 16, 17 };
0027 static const unsigned int cs47l90_aif2_pins[] = { 18, 19, 20, 21 };
0028 static const unsigned int cs47l90_aif3_pins[] = { 22, 23, 24, 25 };
0029 static const unsigned int cs47l90_aif4_pins[] = { 26, 27, 28, 29 };
0030 static const unsigned int cs47l90_dmic4_pins[] = { 30, 31 };
0031 static const unsigned int cs47l90_dmic5_pins[] = { 32, 33 };
0032 static const unsigned int cs47l90_dmic3_pins[] = { 34, 35 };
0033 static const unsigned int cs47l90_spk1_pins[] = { 36, 37 };
0034 
0035 static const struct madera_pin_groups cs47l90_pin_groups[] = {
0036     { "aif1", cs47l90_aif1_pins, ARRAY_SIZE(cs47l90_aif1_pins) },
0037     { "aif2", cs47l90_aif2_pins, ARRAY_SIZE(cs47l90_aif2_pins) },
0038     { "aif3", cs47l90_aif3_pins, ARRAY_SIZE(cs47l90_aif3_pins) },
0039     { "aif4", cs47l90_aif4_pins, ARRAY_SIZE(cs47l90_aif4_pins) },
0040     { "mif1", cs47l90_mif1_pins, ARRAY_SIZE(cs47l90_mif1_pins) },
0041     { "mif2", cs47l90_mif2_pins, ARRAY_SIZE(cs47l90_mif2_pins) },
0042     { "mif3", cs47l90_mif3_pins, ARRAY_SIZE(cs47l90_mif3_pins) },
0043     { "dmic3", cs47l90_dmic3_pins, ARRAY_SIZE(cs47l90_dmic3_pins) },
0044     { "dmic4", cs47l90_dmic4_pins, ARRAY_SIZE(cs47l90_dmic4_pins) },
0045     { "dmic5", cs47l90_dmic5_pins, ARRAY_SIZE(cs47l90_dmic5_pins) },
0046     { "pdmspk1", cs47l90_spk1_pins, ARRAY_SIZE(cs47l90_spk1_pins) },
0047 };
0048 
0049 const struct madera_pin_chip cs47l90_pin_chip = {
0050     .n_pins = CS47L90_NUM_GPIOS,
0051     .pin_groups = cs47l90_pin_groups,
0052     .n_pin_groups = ARRAY_SIZE(cs47l90_pin_groups),
0053 };