Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Copyright (c) 2015, The Linux Foundation. All rights reserved.
0004  */
0005 
0006 #include <linux/module.h>
0007 #include <linux/of.h>
0008 #include <linux/platform_device.h>
0009 #include <linux/pinctrl/pinctrl.h>
0010 
0011 #include "pinctrl-msm.h"
0012 
0013 static const struct pinctrl_pin_desc msm8916_pins[] = {
0014     PINCTRL_PIN(0, "GPIO_0"),
0015     PINCTRL_PIN(1, "GPIO_1"),
0016     PINCTRL_PIN(2, "GPIO_2"),
0017     PINCTRL_PIN(3, "GPIO_3"),
0018     PINCTRL_PIN(4, "GPIO_4"),
0019     PINCTRL_PIN(5, "GPIO_5"),
0020     PINCTRL_PIN(6, "GPIO_6"),
0021     PINCTRL_PIN(7, "GPIO_7"),
0022     PINCTRL_PIN(8, "GPIO_8"),
0023     PINCTRL_PIN(9, "GPIO_9"),
0024     PINCTRL_PIN(10, "GPIO_10"),
0025     PINCTRL_PIN(11, "GPIO_11"),
0026     PINCTRL_PIN(12, "GPIO_12"),
0027     PINCTRL_PIN(13, "GPIO_13"),
0028     PINCTRL_PIN(14, "GPIO_14"),
0029     PINCTRL_PIN(15, "GPIO_15"),
0030     PINCTRL_PIN(16, "GPIO_16"),
0031     PINCTRL_PIN(17, "GPIO_17"),
0032     PINCTRL_PIN(18, "GPIO_18"),
0033     PINCTRL_PIN(19, "GPIO_19"),
0034     PINCTRL_PIN(20, "GPIO_20"),
0035     PINCTRL_PIN(21, "GPIO_21"),
0036     PINCTRL_PIN(22, "GPIO_22"),
0037     PINCTRL_PIN(23, "GPIO_23"),
0038     PINCTRL_PIN(24, "GPIO_24"),
0039     PINCTRL_PIN(25, "GPIO_25"),
0040     PINCTRL_PIN(26, "GPIO_26"),
0041     PINCTRL_PIN(27, "GPIO_27"),
0042     PINCTRL_PIN(28, "GPIO_28"),
0043     PINCTRL_PIN(29, "GPIO_29"),
0044     PINCTRL_PIN(30, "GPIO_30"),
0045     PINCTRL_PIN(31, "GPIO_31"),
0046     PINCTRL_PIN(32, "GPIO_32"),
0047     PINCTRL_PIN(33, "GPIO_33"),
0048     PINCTRL_PIN(34, "GPIO_34"),
0049     PINCTRL_PIN(35, "GPIO_35"),
0050     PINCTRL_PIN(36, "GPIO_36"),
0051     PINCTRL_PIN(37, "GPIO_37"),
0052     PINCTRL_PIN(38, "GPIO_38"),
0053     PINCTRL_PIN(39, "GPIO_39"),
0054     PINCTRL_PIN(40, "GPIO_40"),
0055     PINCTRL_PIN(41, "GPIO_41"),
0056     PINCTRL_PIN(42, "GPIO_42"),
0057     PINCTRL_PIN(43, "GPIO_43"),
0058     PINCTRL_PIN(44, "GPIO_44"),
0059     PINCTRL_PIN(45, "GPIO_45"),
0060     PINCTRL_PIN(46, "GPIO_46"),
0061     PINCTRL_PIN(47, "GPIO_47"),
0062     PINCTRL_PIN(48, "GPIO_48"),
0063     PINCTRL_PIN(49, "GPIO_49"),
0064     PINCTRL_PIN(50, "GPIO_50"),
0065     PINCTRL_PIN(51, "GPIO_51"),
0066     PINCTRL_PIN(52, "GPIO_52"),
0067     PINCTRL_PIN(53, "GPIO_53"),
0068     PINCTRL_PIN(54, "GPIO_54"),
0069     PINCTRL_PIN(55, "GPIO_55"),
0070     PINCTRL_PIN(56, "GPIO_56"),
0071     PINCTRL_PIN(57, "GPIO_57"),
0072     PINCTRL_PIN(58, "GPIO_58"),
0073     PINCTRL_PIN(59, "GPIO_59"),
0074     PINCTRL_PIN(60, "GPIO_60"),
0075     PINCTRL_PIN(61, "GPIO_61"),
0076     PINCTRL_PIN(62, "GPIO_62"),
0077     PINCTRL_PIN(63, "GPIO_63"),
0078     PINCTRL_PIN(64, "GPIO_64"),
0079     PINCTRL_PIN(65, "GPIO_65"),
0080     PINCTRL_PIN(66, "GPIO_66"),
0081     PINCTRL_PIN(67, "GPIO_67"),
0082     PINCTRL_PIN(68, "GPIO_68"),
0083     PINCTRL_PIN(69, "GPIO_69"),
0084     PINCTRL_PIN(70, "GPIO_70"),
0085     PINCTRL_PIN(71, "GPIO_71"),
0086     PINCTRL_PIN(72, "GPIO_72"),
0087     PINCTRL_PIN(73, "GPIO_73"),
0088     PINCTRL_PIN(74, "GPIO_74"),
0089     PINCTRL_PIN(75, "GPIO_75"),
0090     PINCTRL_PIN(76, "GPIO_76"),
0091     PINCTRL_PIN(77, "GPIO_77"),
0092     PINCTRL_PIN(78, "GPIO_78"),
0093     PINCTRL_PIN(79, "GPIO_79"),
0094     PINCTRL_PIN(80, "GPIO_80"),
0095     PINCTRL_PIN(81, "GPIO_81"),
0096     PINCTRL_PIN(82, "GPIO_82"),
0097     PINCTRL_PIN(83, "GPIO_83"),
0098     PINCTRL_PIN(84, "GPIO_84"),
0099     PINCTRL_PIN(85, "GPIO_85"),
0100     PINCTRL_PIN(86, "GPIO_86"),
0101     PINCTRL_PIN(87, "GPIO_87"),
0102     PINCTRL_PIN(88, "GPIO_88"),
0103     PINCTRL_PIN(89, "GPIO_89"),
0104     PINCTRL_PIN(90, "GPIO_90"),
0105     PINCTRL_PIN(91, "GPIO_91"),
0106     PINCTRL_PIN(92, "GPIO_92"),
0107     PINCTRL_PIN(93, "GPIO_93"),
0108     PINCTRL_PIN(94, "GPIO_94"),
0109     PINCTRL_PIN(95, "GPIO_95"),
0110     PINCTRL_PIN(96, "GPIO_96"),
0111     PINCTRL_PIN(97, "GPIO_97"),
0112     PINCTRL_PIN(98, "GPIO_98"),
0113     PINCTRL_PIN(99, "GPIO_99"),
0114     PINCTRL_PIN(100, "GPIO_100"),
0115     PINCTRL_PIN(101, "GPIO_101"),
0116     PINCTRL_PIN(102, "GPIO_102"),
0117     PINCTRL_PIN(103, "GPIO_103"),
0118     PINCTRL_PIN(104, "GPIO_104"),
0119     PINCTRL_PIN(105, "GPIO_105"),
0120     PINCTRL_PIN(106, "GPIO_106"),
0121     PINCTRL_PIN(107, "GPIO_107"),
0122     PINCTRL_PIN(108, "GPIO_108"),
0123     PINCTRL_PIN(109, "GPIO_109"),
0124     PINCTRL_PIN(110, "GPIO_110"),
0125     PINCTRL_PIN(111, "GPIO_111"),
0126     PINCTRL_PIN(112, "GPIO_112"),
0127     PINCTRL_PIN(113, "GPIO_113"),
0128     PINCTRL_PIN(114, "GPIO_114"),
0129     PINCTRL_PIN(115, "GPIO_115"),
0130     PINCTRL_PIN(116, "GPIO_116"),
0131     PINCTRL_PIN(117, "GPIO_117"),
0132     PINCTRL_PIN(118, "GPIO_118"),
0133     PINCTRL_PIN(119, "GPIO_119"),
0134     PINCTRL_PIN(120, "GPIO_120"),
0135     PINCTRL_PIN(121, "GPIO_121"),
0136     PINCTRL_PIN(122, "SDC1_CLK"),
0137     PINCTRL_PIN(123, "SDC1_CMD"),
0138     PINCTRL_PIN(124, "SDC1_DATA"),
0139     PINCTRL_PIN(125, "SDC2_CLK"),
0140     PINCTRL_PIN(126, "SDC2_CMD"),
0141     PINCTRL_PIN(127, "SDC2_DATA"),
0142     PINCTRL_PIN(128, "QDSD_CLK"),
0143     PINCTRL_PIN(129, "QDSD_CMD"),
0144     PINCTRL_PIN(130, "QDSD_DATA0"),
0145     PINCTRL_PIN(131, "QDSD_DATA1"),
0146     PINCTRL_PIN(132, "QDSD_DATA2"),
0147     PINCTRL_PIN(133, "QDSD_DATA3"),
0148 };
0149 
0150 #define DECLARE_MSM_GPIO_PINS(pin)  \
0151     static const unsigned int gpio##pin##_pins[] = { pin }
0152 
0153 DECLARE_MSM_GPIO_PINS(0);
0154 DECLARE_MSM_GPIO_PINS(1);
0155 DECLARE_MSM_GPIO_PINS(2);
0156 DECLARE_MSM_GPIO_PINS(3);
0157 DECLARE_MSM_GPIO_PINS(4);
0158 DECLARE_MSM_GPIO_PINS(5);
0159 DECLARE_MSM_GPIO_PINS(6);
0160 DECLARE_MSM_GPIO_PINS(7);
0161 DECLARE_MSM_GPIO_PINS(8);
0162 DECLARE_MSM_GPIO_PINS(9);
0163 DECLARE_MSM_GPIO_PINS(10);
0164 DECLARE_MSM_GPIO_PINS(11);
0165 DECLARE_MSM_GPIO_PINS(12);
0166 DECLARE_MSM_GPIO_PINS(13);
0167 DECLARE_MSM_GPIO_PINS(14);
0168 DECLARE_MSM_GPIO_PINS(15);
0169 DECLARE_MSM_GPIO_PINS(16);
0170 DECLARE_MSM_GPIO_PINS(17);
0171 DECLARE_MSM_GPIO_PINS(18);
0172 DECLARE_MSM_GPIO_PINS(19);
0173 DECLARE_MSM_GPIO_PINS(20);
0174 DECLARE_MSM_GPIO_PINS(21);
0175 DECLARE_MSM_GPIO_PINS(22);
0176 DECLARE_MSM_GPIO_PINS(23);
0177 DECLARE_MSM_GPIO_PINS(24);
0178 DECLARE_MSM_GPIO_PINS(25);
0179 DECLARE_MSM_GPIO_PINS(26);
0180 DECLARE_MSM_GPIO_PINS(27);
0181 DECLARE_MSM_GPIO_PINS(28);
0182 DECLARE_MSM_GPIO_PINS(29);
0183 DECLARE_MSM_GPIO_PINS(30);
0184 DECLARE_MSM_GPIO_PINS(31);
0185 DECLARE_MSM_GPIO_PINS(32);
0186 DECLARE_MSM_GPIO_PINS(33);
0187 DECLARE_MSM_GPIO_PINS(34);
0188 DECLARE_MSM_GPIO_PINS(35);
0189 DECLARE_MSM_GPIO_PINS(36);
0190 DECLARE_MSM_GPIO_PINS(37);
0191 DECLARE_MSM_GPIO_PINS(38);
0192 DECLARE_MSM_GPIO_PINS(39);
0193 DECLARE_MSM_GPIO_PINS(40);
0194 DECLARE_MSM_GPIO_PINS(41);
0195 DECLARE_MSM_GPIO_PINS(42);
0196 DECLARE_MSM_GPIO_PINS(43);
0197 DECLARE_MSM_GPIO_PINS(44);
0198 DECLARE_MSM_GPIO_PINS(45);
0199 DECLARE_MSM_GPIO_PINS(46);
0200 DECLARE_MSM_GPIO_PINS(47);
0201 DECLARE_MSM_GPIO_PINS(48);
0202 DECLARE_MSM_GPIO_PINS(49);
0203 DECLARE_MSM_GPIO_PINS(50);
0204 DECLARE_MSM_GPIO_PINS(51);
0205 DECLARE_MSM_GPIO_PINS(52);
0206 DECLARE_MSM_GPIO_PINS(53);
0207 DECLARE_MSM_GPIO_PINS(54);
0208 DECLARE_MSM_GPIO_PINS(55);
0209 DECLARE_MSM_GPIO_PINS(56);
0210 DECLARE_MSM_GPIO_PINS(57);
0211 DECLARE_MSM_GPIO_PINS(58);
0212 DECLARE_MSM_GPIO_PINS(59);
0213 DECLARE_MSM_GPIO_PINS(60);
0214 DECLARE_MSM_GPIO_PINS(61);
0215 DECLARE_MSM_GPIO_PINS(62);
0216 DECLARE_MSM_GPIO_PINS(63);
0217 DECLARE_MSM_GPIO_PINS(64);
0218 DECLARE_MSM_GPIO_PINS(65);
0219 DECLARE_MSM_GPIO_PINS(66);
0220 DECLARE_MSM_GPIO_PINS(67);
0221 DECLARE_MSM_GPIO_PINS(68);
0222 DECLARE_MSM_GPIO_PINS(69);
0223 DECLARE_MSM_GPIO_PINS(70);
0224 DECLARE_MSM_GPIO_PINS(71);
0225 DECLARE_MSM_GPIO_PINS(72);
0226 DECLARE_MSM_GPIO_PINS(73);
0227 DECLARE_MSM_GPIO_PINS(74);
0228 DECLARE_MSM_GPIO_PINS(75);
0229 DECLARE_MSM_GPIO_PINS(76);
0230 DECLARE_MSM_GPIO_PINS(77);
0231 DECLARE_MSM_GPIO_PINS(78);
0232 DECLARE_MSM_GPIO_PINS(79);
0233 DECLARE_MSM_GPIO_PINS(80);
0234 DECLARE_MSM_GPIO_PINS(81);
0235 DECLARE_MSM_GPIO_PINS(82);
0236 DECLARE_MSM_GPIO_PINS(83);
0237 DECLARE_MSM_GPIO_PINS(84);
0238 DECLARE_MSM_GPIO_PINS(85);
0239 DECLARE_MSM_GPIO_PINS(86);
0240 DECLARE_MSM_GPIO_PINS(87);
0241 DECLARE_MSM_GPIO_PINS(88);
0242 DECLARE_MSM_GPIO_PINS(89);
0243 DECLARE_MSM_GPIO_PINS(90);
0244 DECLARE_MSM_GPIO_PINS(91);
0245 DECLARE_MSM_GPIO_PINS(92);
0246 DECLARE_MSM_GPIO_PINS(93);
0247 DECLARE_MSM_GPIO_PINS(94);
0248 DECLARE_MSM_GPIO_PINS(95);
0249 DECLARE_MSM_GPIO_PINS(96);
0250 DECLARE_MSM_GPIO_PINS(97);
0251 DECLARE_MSM_GPIO_PINS(98);
0252 DECLARE_MSM_GPIO_PINS(99);
0253 DECLARE_MSM_GPIO_PINS(100);
0254 DECLARE_MSM_GPIO_PINS(101);
0255 DECLARE_MSM_GPIO_PINS(102);
0256 DECLARE_MSM_GPIO_PINS(103);
0257 DECLARE_MSM_GPIO_PINS(104);
0258 DECLARE_MSM_GPIO_PINS(105);
0259 DECLARE_MSM_GPIO_PINS(106);
0260 DECLARE_MSM_GPIO_PINS(107);
0261 DECLARE_MSM_GPIO_PINS(108);
0262 DECLARE_MSM_GPIO_PINS(109);
0263 DECLARE_MSM_GPIO_PINS(110);
0264 DECLARE_MSM_GPIO_PINS(111);
0265 DECLARE_MSM_GPIO_PINS(112);
0266 DECLARE_MSM_GPIO_PINS(113);
0267 DECLARE_MSM_GPIO_PINS(114);
0268 DECLARE_MSM_GPIO_PINS(115);
0269 DECLARE_MSM_GPIO_PINS(116);
0270 DECLARE_MSM_GPIO_PINS(117);
0271 DECLARE_MSM_GPIO_PINS(118);
0272 DECLARE_MSM_GPIO_PINS(119);
0273 DECLARE_MSM_GPIO_PINS(120);
0274 DECLARE_MSM_GPIO_PINS(121);
0275 
0276 static const unsigned int sdc1_clk_pins[] = { 122 };
0277 static const unsigned int sdc1_cmd_pins[] = { 123 };
0278 static const unsigned int sdc1_data_pins[] = { 124 };
0279 static const unsigned int sdc2_clk_pins[] = { 125 };
0280 static const unsigned int sdc2_cmd_pins[] = { 126 };
0281 static const unsigned int sdc2_data_pins[] = { 127 };
0282 static const unsigned int qdsd_clk_pins[] = { 128 };
0283 static const unsigned int qdsd_cmd_pins[] = { 129 };
0284 static const unsigned int qdsd_data0_pins[] = { 130 };
0285 static const unsigned int qdsd_data1_pins[] = { 131 };
0286 static const unsigned int qdsd_data2_pins[] = { 132 };
0287 static const unsigned int qdsd_data3_pins[] = { 133 };
0288 
0289 #define FUNCTION(fname)                         \
0290     [MSM_MUX_##fname] = {                       \
0291         .name = #fname,             \
0292         .groups = fname##_groups,               \
0293         .ngroups = ARRAY_SIZE(fname##_groups),  \
0294     }
0295 
0296 #define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9)    \
0297     {                           \
0298         .name = "gpio" #id,             \
0299         .pins = gpio##id##_pins,            \
0300         .npins = ARRAY_SIZE(gpio##id##_pins),       \
0301         .funcs = (int[]){               \
0302             MSM_MUX_gpio,               \
0303             MSM_MUX_##f1,               \
0304             MSM_MUX_##f2,               \
0305             MSM_MUX_##f3,               \
0306             MSM_MUX_##f4,               \
0307             MSM_MUX_##f5,               \
0308             MSM_MUX_##f6,               \
0309             MSM_MUX_##f7,               \
0310             MSM_MUX_##f8,               \
0311             MSM_MUX_##f9                \
0312         },                          \
0313         .nfuncs = 10,                   \
0314         .ctl_reg = 0x1000 * id,                 \
0315         .io_reg = 0x4 + 0x1000 * id,            \
0316         .intr_cfg_reg = 0x8 + 0x1000 * id,      \
0317         .intr_status_reg = 0xc + 0x1000 * id,       \
0318         .intr_target_reg = 0x8 + 0x1000 * id,       \
0319         .mux_bit = 2,                   \
0320         .pull_bit = 0,                  \
0321         .drv_bit = 6,                   \
0322         .oe_bit = 9,                    \
0323         .in_bit = 0,                    \
0324         .out_bit = 1,                   \
0325         .intr_enable_bit = 0,               \
0326         .intr_status_bit = 0,               \
0327         .intr_target_bit = 5,               \
0328         .intr_target_kpss_val = 4,          \
0329         .intr_raw_status_bit = 4,           \
0330         .intr_polarity_bit = 1,             \
0331         .intr_detection_bit = 2,            \
0332         .intr_detection_width = 2,          \
0333     }
0334 
0335 #define SDC_PINGROUP(pg_name, ctl, pull, drv)   \
0336     {                           \
0337         .name = #pg_name,           \
0338         .pins = pg_name##_pins,         \
0339         .npins = ARRAY_SIZE(pg_name##_pins),    \
0340         .ctl_reg = ctl,             \
0341         .io_reg = 0,                \
0342         .intr_cfg_reg = 0,          \
0343         .intr_status_reg = 0,           \
0344         .intr_target_reg = 0,           \
0345         .mux_bit = -1,              \
0346         .pull_bit = pull,           \
0347         .drv_bit = drv,             \
0348         .oe_bit = -1,               \
0349         .in_bit = -1,               \
0350         .out_bit = -1,              \
0351         .intr_enable_bit = -1,          \
0352         .intr_status_bit = -1,          \
0353         .intr_target_bit = -1,          \
0354         .intr_target_kpss_val = -1,     \
0355         .intr_raw_status_bit = -1,      \
0356         .intr_polarity_bit = -1,        \
0357         .intr_detection_bit = -1,       \
0358         .intr_detection_width = -1,     \
0359     }
0360 
0361 enum msm8916_functions {
0362     MSM_MUX_adsp_ext,
0363     MSM_MUX_alsp_int,
0364     MSM_MUX_atest_bbrx0,
0365     MSM_MUX_atest_bbrx1,
0366     MSM_MUX_atest_char,
0367     MSM_MUX_atest_char0,
0368     MSM_MUX_atest_char1,
0369     MSM_MUX_atest_char2,
0370     MSM_MUX_atest_char3,
0371     MSM_MUX_atest_combodac,
0372     MSM_MUX_atest_gpsadc0,
0373     MSM_MUX_atest_gpsadc1,
0374     MSM_MUX_atest_tsens,
0375     MSM_MUX_atest_wlan0,
0376     MSM_MUX_atest_wlan1,
0377     MSM_MUX_backlight_en,
0378     MSM_MUX_bimc_dte0,
0379     MSM_MUX_bimc_dte1,
0380     MSM_MUX_blsp_i2c1,
0381     MSM_MUX_blsp_i2c2,
0382     MSM_MUX_blsp_i2c3,
0383     MSM_MUX_blsp_i2c4,
0384     MSM_MUX_blsp_i2c5,
0385     MSM_MUX_blsp_i2c6,
0386     MSM_MUX_blsp_spi1,
0387     MSM_MUX_blsp_spi1_cs1,
0388     MSM_MUX_blsp_spi1_cs2,
0389     MSM_MUX_blsp_spi1_cs3,
0390     MSM_MUX_blsp_spi2,
0391     MSM_MUX_blsp_spi2_cs1,
0392     MSM_MUX_blsp_spi2_cs2,
0393     MSM_MUX_blsp_spi2_cs3,
0394     MSM_MUX_blsp_spi3,
0395     MSM_MUX_blsp_spi3_cs1,
0396     MSM_MUX_blsp_spi3_cs2,
0397     MSM_MUX_blsp_spi3_cs3,
0398     MSM_MUX_blsp_spi4,
0399     MSM_MUX_blsp_spi5,
0400     MSM_MUX_blsp_spi6,
0401     MSM_MUX_blsp_uart1,
0402     MSM_MUX_blsp_uart2,
0403     MSM_MUX_blsp_uim1,
0404     MSM_MUX_blsp_uim2,
0405     MSM_MUX_cam1_rst,
0406     MSM_MUX_cam1_standby,
0407     MSM_MUX_cam_mclk0,
0408     MSM_MUX_cam_mclk1,
0409     MSM_MUX_cci_async,
0410     MSM_MUX_cci_i2c,
0411     MSM_MUX_cci_timer0,
0412     MSM_MUX_cci_timer1,
0413     MSM_MUX_cci_timer2,
0414     MSM_MUX_cdc_pdm0,
0415     MSM_MUX_codec_mad,
0416     MSM_MUX_dbg_out,
0417     MSM_MUX_display_5v,
0418     MSM_MUX_dmic0_clk,
0419     MSM_MUX_dmic0_data,
0420     MSM_MUX_dsi_rst,
0421     MSM_MUX_ebi0_wrcdc,
0422     MSM_MUX_euro_us,
0423     MSM_MUX_ext_lpass,
0424     MSM_MUX_flash_strobe,
0425     MSM_MUX_gcc_gp1_clk_a,
0426     MSM_MUX_gcc_gp1_clk_b,
0427     MSM_MUX_gcc_gp2_clk_a,
0428     MSM_MUX_gcc_gp2_clk_b,
0429     MSM_MUX_gcc_gp3_clk_a,
0430     MSM_MUX_gcc_gp3_clk_b,
0431     MSM_MUX_gpio,
0432     MSM_MUX_gsm0_tx0,
0433     MSM_MUX_gsm0_tx1,
0434     MSM_MUX_gsm1_tx0,
0435     MSM_MUX_gsm1_tx1,
0436     MSM_MUX_gyro_accl,
0437     MSM_MUX_kpsns0,
0438     MSM_MUX_kpsns1,
0439     MSM_MUX_kpsns2,
0440     MSM_MUX_ldo_en,
0441     MSM_MUX_ldo_update,
0442     MSM_MUX_mag_int,
0443     MSM_MUX_mdp_vsync,
0444     MSM_MUX_modem_tsync,
0445     MSM_MUX_m_voc,
0446     MSM_MUX_nav_pps,
0447     MSM_MUX_nav_tsync,
0448     MSM_MUX_pa_indicator,
0449     MSM_MUX_pbs0,
0450     MSM_MUX_pbs1,
0451     MSM_MUX_pbs2,
0452     MSM_MUX_pri_mi2s,
0453     MSM_MUX_pri_mi2s_ws,
0454     MSM_MUX_prng_rosc,
0455     MSM_MUX_pwr_crypto_enabled_a,
0456     MSM_MUX_pwr_crypto_enabled_b,
0457     MSM_MUX_pwr_modem_enabled_a,
0458     MSM_MUX_pwr_modem_enabled_b,
0459     MSM_MUX_pwr_nav_enabled_a,
0460     MSM_MUX_pwr_nav_enabled_b,
0461     MSM_MUX_qdss_ctitrig_in_a0,
0462     MSM_MUX_qdss_ctitrig_in_a1,
0463     MSM_MUX_qdss_ctitrig_in_b0,
0464     MSM_MUX_qdss_ctitrig_in_b1,
0465     MSM_MUX_qdss_ctitrig_out_a0,
0466     MSM_MUX_qdss_ctitrig_out_a1,
0467     MSM_MUX_qdss_ctitrig_out_b0,
0468     MSM_MUX_qdss_ctitrig_out_b1,
0469     MSM_MUX_qdss_traceclk_a,
0470     MSM_MUX_qdss_traceclk_b,
0471     MSM_MUX_qdss_tracectl_a,
0472     MSM_MUX_qdss_tracectl_b,
0473     MSM_MUX_qdss_tracedata_a,
0474     MSM_MUX_qdss_tracedata_b,
0475     MSM_MUX_reset_n,
0476     MSM_MUX_sd_card,
0477     MSM_MUX_sd_write,
0478     MSM_MUX_sec_mi2s,
0479     MSM_MUX_smb_int,
0480     MSM_MUX_ssbi_wtr0,
0481     MSM_MUX_ssbi_wtr1,
0482     MSM_MUX_uim1,
0483     MSM_MUX_uim2,
0484     MSM_MUX_uim3,
0485     MSM_MUX_uim_batt,
0486     MSM_MUX_wcss_bt,
0487     MSM_MUX_wcss_fm,
0488     MSM_MUX_wcss_wlan,
0489     MSM_MUX_webcam1_rst,
0490     MSM_MUX_NA,
0491 };
0492 
0493 static const char * const gpio_groups[] = {
0494     "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
0495     "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
0496     "gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
0497     "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
0498     "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
0499     "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
0500     "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
0501     "gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56",
0502     "gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
0503     "gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70",
0504     "gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77",
0505     "gpio78", "gpio79", "gpio80", "gpio81", "gpio82", "gpio83", "gpio84",
0506     "gpio85", "gpio86", "gpio87", "gpio88", "gpio89", "gpio90", "gpio91",
0507     "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98",
0508     "gpio99", "gpio100", "gpio101", "gpio102", "gpio103", "gpio104",
0509     "gpio105", "gpio106", "gpio107", "gpio108", "gpio109", "gpio110",
0510     "gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116",
0511     "gpio117", "gpio118", "gpio119", "gpio120", "gpio121"
0512 };
0513 static const char * const adsp_ext_groups[] = { "gpio38" };
0514 static const char * const alsp_int_groups[] = { "gpio113" };
0515 static const char * const atest_bbrx0_groups[] = { "gpio17" };
0516 static const char * const atest_bbrx1_groups[] = { "gpio16" };
0517 static const char * const atest_char_groups[] = { "gpio62" };
0518 static const char * const atest_char0_groups[] = { "gpio60" };
0519 static const char * const atest_char1_groups[] = { "gpio59" };
0520 static const char * const atest_char2_groups[] = { "gpio58" };
0521 static const char * const atest_char3_groups[] = { "gpio57" };
0522 static const char * const atest_combodac_groups[] = {
0523     "gpio4", "gpio12", "gpio13", "gpio20", "gpio21", "gpio28", "gpio29",
0524     "gpio30", "gpio39", "gpio40", "gpio41", "gpio42", "gpio43", "gpio44",
0525     "gpio45", "gpio46", "gpio47", "gpio48", "gpio69", "gpio107"
0526 };
0527 static const char * const atest_gpsadc0_groups[] = { "gpio7" };
0528 static const char * const atest_gpsadc1_groups[] = { "gpio18" };
0529 static const char * const atest_tsens_groups[] = { "gpio112" };
0530 static const char * const atest_wlan0_groups[] = { "gpio22" };
0531 static const char * const atest_wlan1_groups[] = { "gpio23" };
0532 static const char * const backlight_en_groups[] = { "gpio98" };
0533 static const char * const bimc_dte0_groups[] = { "gpio63", "gpio65" };
0534 static const char * const bimc_dte1_groups[] = { "gpio64", "gpio66" };
0535 static const char * const blsp_i2c1_groups[] = { "gpio2", "gpio3" };
0536 static const char * const blsp_i2c2_groups[] = { "gpio6", "gpio7" };
0537 static const char * const blsp_i2c3_groups[] = { "gpio10", "gpio11" };
0538 static const char * const blsp_i2c4_groups[] = { "gpio14", "gpio15" };
0539 static const char * const blsp_i2c5_groups[] = { "gpio18", "gpio19" };
0540 static const char * const blsp_i2c6_groups[] = { "gpio22", "gpio23" };
0541 static const char * const blsp_spi1_groups[] = {
0542     "gpio0", "gpio1", "gpio2", "gpio3"
0543 };
0544 static const char * const blsp_spi1_cs1_groups[] = { "gpio110" };
0545 static const char * const blsp_spi1_cs2_groups[] = { "gpio16" };
0546 static const char * const blsp_spi1_cs3_groups[] = { "gpio4" };
0547 static const char * const blsp_spi2_groups[] = {
0548     "gpio4", "gpio5", "gpio6", "gpio7"
0549 };
0550 static const char * const blsp_spi2_cs1_groups[] = { "gpio121" };
0551 static const char * const blsp_spi2_cs2_groups[] = { "gpio17" };
0552 static const char * const blsp_spi2_cs3_groups[] = { "gpio5" };
0553 static const char * const blsp_spi3_groups[] = {
0554     "gpio8", "gpio9", "gpio10", "gpio11"
0555 };
0556 static const char * const blsp_spi3_cs1_groups[] = { "gpio120" };
0557 static const char * const blsp_spi3_cs2_groups[] = { "gpio37" };
0558 static const char * const blsp_spi3_cs3_groups[] = { "gpio69" };
0559 static const char * const blsp_spi4_groups[] = {
0560     "gpio12", "gpio13", "gpio14", "gpio15"
0561 };
0562 static const char * const blsp_spi5_groups[] = {
0563     "gpio16", "gpio17", "gpio18", "gpio19"
0564 };
0565 static const char * const blsp_spi6_groups[] = {
0566     "gpio20", "gpio21", "gpio22", "gpio23"
0567 };
0568 static const char * const blsp_uart1_groups[] = {
0569     "gpio0", "gpio1", "gpio2", "gpio3"
0570 };
0571 static const char * const blsp_uart2_groups[] = {
0572     "gpio4", "gpio5", "gpio6", "gpio7"
0573 };
0574 static const char * const blsp_uim1_groups[] = { "gpio0", "gpio1" };
0575 static const char * const blsp_uim2_groups[] = { "gpio4", "gpio5" };
0576 static const char * const cam1_rst_groups[] = { "gpio35" };
0577 static const char * const cam1_standby_groups[] = { "gpio34" };
0578 static const char * const cam_mclk0_groups[] = { "gpio26" };
0579 static const char * const cam_mclk1_groups[] = { "gpio27" };
0580 static const char * const cci_async_groups[] = { "gpio33" };
0581 static const char * const cci_i2c_groups[] = { "gpio29", "gpio30" };
0582 static const char * const cci_timer0_groups[] = { "gpio31" };
0583 static const char * const cci_timer1_groups[] = { "gpio32" };
0584 static const char * const cci_timer2_groups[] = { "gpio38" };
0585 static const char * const cdc_pdm0_groups[] = {
0586     "gpio63", "gpio64", "gpio65", "gpio66", "gpio67", "gpio68"
0587 };
0588 static const char * const codec_mad_groups[] = { "gpio16" };
0589 static const char * const dbg_out_groups[] = { "gpio47" };
0590 static const char * const display_5v_groups[] = { "gpio97" };
0591 static const char * const dmic0_clk_groups[] = { "gpio0" };
0592 static const char * const dmic0_data_groups[] = { "gpio1" };
0593 static const char * const dsi_rst_groups[] = { "gpio25" };
0594 static const char * const ebi0_wrcdc_groups[] = { "gpio67" };
0595 static const char * const euro_us_groups[] = { "gpio120" };
0596 static const char * const ext_lpass_groups[] = { "gpio45" };
0597 static const char * const flash_strobe_groups[] = { "gpio31", "gpio32" };
0598 static const char * const gcc_gp1_clk_a_groups[] = { "gpio49" };
0599 static const char * const gcc_gp1_clk_b_groups[] = { "gpio97" };
0600 static const char * const gcc_gp2_clk_a_groups[] = { "gpio50" };
0601 static const char * const gcc_gp2_clk_b_groups[] = { "gpio12" };
0602 static const char * const gcc_gp3_clk_a_groups[] = { "gpio51" };
0603 static const char * const gcc_gp3_clk_b_groups[] = { "gpio13" };
0604 static const char * const gsm0_tx0_groups[] = { "gpio99" };
0605 static const char * const gsm0_tx1_groups[] = { "gpio100" };
0606 static const char * const gsm1_tx0_groups[] = { "gpio101" };
0607 static const char * const gsm1_tx1_groups[] = { "gpio102" };
0608 static const char * const gyro_accl_groups[] = {"gpio115" };
0609 static const char * const kpsns0_groups[] = { "gpio107" };
0610 static const char * const kpsns1_groups[] = { "gpio108" };
0611 static const char * const kpsns2_groups[] = { "gpio109" };
0612 static const char * const ldo_en_groups[] = { "gpio121" };
0613 static const char * const ldo_update_groups[] = { "gpio120" };
0614 static const char * const mag_int_groups[] = { "gpio69" };
0615 static const char * const mdp_vsync_groups[] = { "gpio24", "gpio25" };
0616 static const char * const modem_tsync_groups[] = { "gpio95" };
0617 static const char * const m_voc_groups[] = { "gpio8", "gpio119" };
0618 static const char * const nav_pps_groups[] = { "gpio95" };
0619 static const char * const nav_tsync_groups[] = { "gpio95" };
0620 static const char * const pa_indicator_groups[] = { "gpio86" };
0621 static const char * const pbs0_groups[] = { "gpio107" };
0622 static const char * const pbs1_groups[] = { "gpio108" };
0623 static const char * const pbs2_groups[] = { "gpio109" };
0624 static const char * const pri_mi2s_groups[] = {
0625     "gpio113", "gpio114", "gpio115", "gpio116"
0626 };
0627 static const char * const pri_mi2s_ws_groups[] = { "gpio110" };
0628 static const char * const prng_rosc_groups[] = { "gpio43" };
0629 static const char * const pwr_crypto_enabled_a_groups[] = { "gpio35" };
0630 static const char * const pwr_crypto_enabled_b_groups[] = { "gpio115" };
0631 static const char * const pwr_modem_enabled_a_groups[] = { "gpio28" };
0632 static const char * const pwr_modem_enabled_b_groups[] = { "gpio113" };
0633 static const char * const pwr_nav_enabled_a_groups[] = { "gpio34" };
0634 static const char * const pwr_nav_enabled_b_groups[] = { "gpio114" };
0635 static const char * const qdss_ctitrig_in_a0_groups[] = { "gpio20" };
0636 static const char * const qdss_ctitrig_in_a1_groups[] = { "gpio49" };
0637 static const char * const qdss_ctitrig_in_b0_groups[] = { "gpio21" };
0638 static const char * const qdss_ctitrig_in_b1_groups[] = { "gpio50" };
0639 static const char * const qdss_ctitrig_out_a0_groups[] = { "gpio23" };
0640 static const char * const qdss_ctitrig_out_a1_groups[] = { "gpio52" };
0641 static const char * const qdss_ctitrig_out_b0_groups[] = { "gpio22" };
0642 static const char * const qdss_ctitrig_out_b1_groups[] = { "gpio51" };
0643 static const char * const qdss_traceclk_a_groups[] = { "gpio46" };
0644 static const char * const qdss_traceclk_b_groups[] = { "gpio5" };
0645 static const char * const qdss_tracectl_a_groups[] = { "gpio45" };
0646 static const char * const qdss_tracectl_b_groups[] = { "gpio4" };
0647 static const char * const qdss_tracedata_a_groups[] = {
0648     "gpio8", "gpio9", "gpio10", "gpio39", "gpio40", "gpio41", "gpio42",
0649     "gpio43", "gpio47", "gpio48", "gpio62", "gpio69", "gpio112", "gpio113",
0650     "gpio114", "gpio115"
0651 };
0652 static const char * const qdss_tracedata_b_groups[] = {
0653     "gpio26", "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
0654     "gpio33", "gpio34", "gpio35", "gpio36", "gpio37", "gpio110", "gpio111",
0655     "gpio120", "gpio121"
0656 };
0657 static const char * const reset_n_groups[] = { "gpio36" };
0658 static const char * const sd_card_groups[] = { "gpio38" };
0659 static const char * const sd_write_groups[] = { "gpio121" };
0660 static const char * const sec_mi2s_groups[] = {
0661     "gpio112", "gpio117", "gpio118", "gpio119"
0662 };
0663 static const char * const smb_int_groups[] = { "gpio62" };
0664 static const char * const ssbi_wtr0_groups[] = { "gpio103", "gpio104" };
0665 static const char * const ssbi_wtr1_groups[] = { "gpio105", "gpio106" };
0666 static const char * const uim1_groups[] = {
0667     "gpio57", "gpio58", "gpio59", "gpio60"
0668 };
0669 
0670 static const char * const uim2_groups[] = {
0671     "gpio53", "gpio54", "gpio55", "gpio56"
0672 };
0673 static const char * const uim3_groups[] = {
0674     "gpio49",  "gpio50", "gpio51", "gpio52"
0675 };
0676 static const char * const uim_batt_groups[] = { "gpio61" };
0677 static const char * const wcss_bt_groups[] = { "gpio39", "gpio47", "gpio48" };
0678 static const char * const wcss_fm_groups[] = { "gpio45", "gpio46" };
0679 static const char * const wcss_wlan_groups[] = {
0680     "gpio40", "gpio41", "gpio42", "gpio43", "gpio44"
0681 };
0682 static const char * const webcam1_rst_groups[] = { "gpio28" };
0683 
0684 static const struct msm_function msm8916_functions[] = {
0685     FUNCTION(adsp_ext),
0686     FUNCTION(alsp_int),
0687     FUNCTION(atest_bbrx0),
0688     FUNCTION(atest_bbrx1),
0689     FUNCTION(atest_char),
0690     FUNCTION(atest_char0),
0691     FUNCTION(atest_char1),
0692     FUNCTION(atest_char2),
0693     FUNCTION(atest_char3),
0694     FUNCTION(atest_combodac),
0695     FUNCTION(atest_gpsadc0),
0696     FUNCTION(atest_gpsadc1),
0697     FUNCTION(atest_tsens),
0698     FUNCTION(atest_wlan0),
0699     FUNCTION(atest_wlan1),
0700     FUNCTION(backlight_en),
0701     FUNCTION(bimc_dte0),
0702     FUNCTION(bimc_dte1),
0703     FUNCTION(blsp_i2c1),
0704     FUNCTION(blsp_i2c2),
0705     FUNCTION(blsp_i2c3),
0706     FUNCTION(blsp_i2c4),
0707     FUNCTION(blsp_i2c5),
0708     FUNCTION(blsp_i2c6),
0709     FUNCTION(blsp_spi1),
0710     FUNCTION(blsp_spi1_cs1),
0711     FUNCTION(blsp_spi1_cs2),
0712     FUNCTION(blsp_spi1_cs3),
0713     FUNCTION(blsp_spi2),
0714     FUNCTION(blsp_spi2_cs1),
0715     FUNCTION(blsp_spi2_cs2),
0716     FUNCTION(blsp_spi2_cs3),
0717     FUNCTION(blsp_spi3),
0718     FUNCTION(blsp_spi3_cs1),
0719     FUNCTION(blsp_spi3_cs2),
0720     FUNCTION(blsp_spi3_cs3),
0721     FUNCTION(blsp_spi4),
0722     FUNCTION(blsp_spi5),
0723     FUNCTION(blsp_spi6),
0724     FUNCTION(blsp_uart1),
0725     FUNCTION(blsp_uart2),
0726     FUNCTION(blsp_uim1),
0727     FUNCTION(blsp_uim2),
0728     FUNCTION(cam1_rst),
0729     FUNCTION(cam1_standby),
0730     FUNCTION(cam_mclk0),
0731     FUNCTION(cam_mclk1),
0732     FUNCTION(cci_async),
0733     FUNCTION(cci_i2c),
0734     FUNCTION(cci_timer0),
0735     FUNCTION(cci_timer1),
0736     FUNCTION(cci_timer2),
0737     FUNCTION(cdc_pdm0),
0738     FUNCTION(codec_mad),
0739     FUNCTION(dbg_out),
0740     FUNCTION(display_5v),
0741     FUNCTION(dmic0_clk),
0742     FUNCTION(dmic0_data),
0743     FUNCTION(dsi_rst),
0744     FUNCTION(ebi0_wrcdc),
0745     FUNCTION(euro_us),
0746     FUNCTION(ext_lpass),
0747     FUNCTION(flash_strobe),
0748     FUNCTION(gcc_gp1_clk_a),
0749     FUNCTION(gcc_gp1_clk_b),
0750     FUNCTION(gcc_gp2_clk_a),
0751     FUNCTION(gcc_gp2_clk_b),
0752     FUNCTION(gcc_gp3_clk_a),
0753     FUNCTION(gcc_gp3_clk_b),
0754     FUNCTION(gpio),
0755     FUNCTION(gsm0_tx0),
0756     FUNCTION(gsm0_tx1),
0757     FUNCTION(gsm1_tx0),
0758     FUNCTION(gsm1_tx1),
0759     FUNCTION(gyro_accl),
0760     FUNCTION(kpsns0),
0761     FUNCTION(kpsns1),
0762     FUNCTION(kpsns2),
0763     FUNCTION(ldo_en),
0764     FUNCTION(ldo_update),
0765     FUNCTION(mag_int),
0766     FUNCTION(mdp_vsync),
0767     FUNCTION(modem_tsync),
0768     FUNCTION(m_voc),
0769     FUNCTION(nav_pps),
0770     FUNCTION(nav_tsync),
0771     FUNCTION(pa_indicator),
0772     FUNCTION(pbs0),
0773     FUNCTION(pbs1),
0774     FUNCTION(pbs2),
0775     FUNCTION(pri_mi2s),
0776     FUNCTION(pri_mi2s_ws),
0777     FUNCTION(prng_rosc),
0778     FUNCTION(pwr_crypto_enabled_a),
0779     FUNCTION(pwr_crypto_enabled_b),
0780     FUNCTION(pwr_modem_enabled_a),
0781     FUNCTION(pwr_modem_enabled_b),
0782     FUNCTION(pwr_nav_enabled_a),
0783     FUNCTION(pwr_nav_enabled_b),
0784     FUNCTION(qdss_ctitrig_in_a0),
0785     FUNCTION(qdss_ctitrig_in_a1),
0786     FUNCTION(qdss_ctitrig_in_b0),
0787     FUNCTION(qdss_ctitrig_in_b1),
0788     FUNCTION(qdss_ctitrig_out_a0),
0789     FUNCTION(qdss_ctitrig_out_a1),
0790     FUNCTION(qdss_ctitrig_out_b0),
0791     FUNCTION(qdss_ctitrig_out_b1),
0792     FUNCTION(qdss_traceclk_a),
0793     FUNCTION(qdss_traceclk_b),
0794     FUNCTION(qdss_tracectl_a),
0795     FUNCTION(qdss_tracectl_b),
0796     FUNCTION(qdss_tracedata_a),
0797     FUNCTION(qdss_tracedata_b),
0798     FUNCTION(reset_n),
0799     FUNCTION(sd_card),
0800     FUNCTION(sd_write),
0801     FUNCTION(sec_mi2s),
0802     FUNCTION(smb_int),
0803     FUNCTION(ssbi_wtr0),
0804     FUNCTION(ssbi_wtr1),
0805     FUNCTION(uim1),
0806     FUNCTION(uim2),
0807     FUNCTION(uim3),
0808     FUNCTION(uim_batt),
0809     FUNCTION(wcss_bt),
0810     FUNCTION(wcss_fm),
0811     FUNCTION(wcss_wlan),
0812     FUNCTION(webcam1_rst)
0813 };
0814 
0815 static const struct msm_pingroup msm8916_groups[] = {
0816     PINGROUP(0, blsp_spi1, blsp_uart1, blsp_uim1, dmic0_clk, NA, NA, NA, NA, NA),
0817     PINGROUP(1, blsp_spi1, blsp_uart1, blsp_uim1, dmic0_data, NA, NA, NA, NA, NA),
0818     PINGROUP(2, blsp_spi1, blsp_uart1, blsp_i2c1, NA, NA, NA, NA, NA, NA),
0819     PINGROUP(3, blsp_spi1, blsp_uart1, blsp_i2c1, NA, NA, NA, NA, NA, NA),
0820     PINGROUP(4, blsp_spi2, blsp_uart2, blsp_uim2, blsp_spi1_cs3, qdss_tracectl_b, NA, atest_combodac, NA, NA),
0821     PINGROUP(5, blsp_spi2, blsp_uart2, blsp_uim2, blsp_spi2_cs3, qdss_traceclk_b, NA, NA, NA, NA),
0822     PINGROUP(6, blsp_spi2, blsp_uart2, blsp_i2c2, NA, NA, NA, NA, NA, NA),
0823     PINGROUP(7, blsp_spi2, blsp_uart2, blsp_i2c2, NA, NA, NA, NA, NA, NA),
0824     PINGROUP(8, blsp_spi3, m_voc, qdss_tracedata_a, NA, NA, NA, NA, NA, NA),
0825     PINGROUP(9, blsp_spi3, qdss_tracedata_a, NA, NA, NA, NA, NA, NA, NA),
0826     PINGROUP(10, blsp_spi3, blsp_i2c3, qdss_tracedata_a, NA, NA, NA, NA, NA, NA),
0827     PINGROUP(11, blsp_spi3, blsp_i2c3, NA, NA, NA, NA, NA, NA, NA),
0828     PINGROUP(12, blsp_spi4, gcc_gp2_clk_b, NA, atest_combodac, NA, NA, NA, NA, NA),
0829     PINGROUP(13, blsp_spi4, gcc_gp3_clk_b, NA, atest_combodac, NA, NA, NA, NA, NA),
0830     PINGROUP(14, blsp_spi4, blsp_i2c4, NA, NA, NA, NA, NA, NA, NA),
0831     PINGROUP(15, blsp_spi4, blsp_i2c4, NA, NA, NA, NA, NA, NA, NA),
0832     PINGROUP(16, blsp_spi5, blsp_spi1_cs2, NA, atest_bbrx1, NA, NA, NA, NA, NA),
0833     PINGROUP(17, blsp_spi5, blsp_spi2_cs2, NA, atest_bbrx0, NA, NA, NA, NA, NA),
0834     PINGROUP(18, blsp_spi5, blsp_i2c5, NA, atest_gpsadc1, NA, NA, NA, NA, NA),
0835     PINGROUP(19, blsp_spi5, blsp_i2c5, NA, NA, NA, NA, NA, NA, NA),
0836     PINGROUP(20, blsp_spi6, NA, NA, NA, NA, NA, NA, qdss_ctitrig_in_a0, NA),
0837     PINGROUP(21, blsp_spi6, NA, NA, NA, NA, NA, NA, qdss_ctitrig_in_b0, NA),
0838     PINGROUP(22, blsp_spi6, blsp_i2c6, NA, NA, NA, NA, NA, NA, NA),
0839     PINGROUP(23, blsp_spi6, blsp_i2c6, NA, NA, NA, NA, NA, NA, NA),
0840     PINGROUP(24, mdp_vsync, NA, NA, NA, NA, NA, NA, NA, NA),
0841     PINGROUP(25, mdp_vsync, NA, NA, NA, NA, NA, NA, NA, NA),
0842     PINGROUP(26, cam_mclk0, NA, NA, NA, NA, NA, qdss_tracedata_b, NA, NA),
0843     PINGROUP(27, cam_mclk1, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b),
0844     PINGROUP(28, pwr_modem_enabled_a, NA, NA, NA, NA, NA, qdss_tracedata_b, NA, atest_combodac),
0845     PINGROUP(29, cci_i2c, NA, NA, NA, NA, NA, qdss_tracedata_b, NA, atest_combodac),
0846     PINGROUP(30, cci_i2c, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b),
0847     PINGROUP(31, cci_timer0, flash_strobe, NA, NA, NA, NA, NA, NA, NA),
0848     PINGROUP(32, cci_timer1, flash_strobe, NA, NA, NA, NA, NA, NA, NA),
0849     PINGROUP(33, cci_async, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b),
0850     PINGROUP(34, pwr_nav_enabled_a, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b),
0851     PINGROUP(35, pwr_crypto_enabled_a, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b),
0852     PINGROUP(36, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b, NA),
0853     PINGROUP(37, blsp_spi3_cs2, NA, NA, NA, NA, NA, qdss_tracedata_b, NA, NA),
0854     PINGROUP(38, cci_timer2, adsp_ext, NA, NA, NA, NA, NA, NA, NA),
0855     PINGROUP(39, wcss_bt, qdss_tracedata_a, NA, atest_combodac, NA, NA, NA, NA, NA),
0856     PINGROUP(40, wcss_wlan, qdss_tracedata_a, NA, atest_combodac, NA, NA, NA, NA, NA),
0857     PINGROUP(41, wcss_wlan, qdss_tracedata_a, NA, atest_combodac, NA, NA, NA, NA, NA),
0858     PINGROUP(42, wcss_wlan, qdss_tracedata_a, NA, atest_combodac, NA, NA, NA, NA, NA),
0859     PINGROUP(43, wcss_wlan, prng_rosc, qdss_tracedata_a, NA, atest_combodac, NA, NA, NA, NA),
0860     PINGROUP(44, wcss_wlan, NA, atest_combodac, NA, NA, NA, NA, NA, NA),
0861     PINGROUP(45, wcss_fm, ext_lpass, qdss_tracectl_a, NA, atest_combodac, NA, NA, NA, NA),
0862     PINGROUP(46, wcss_fm, qdss_traceclk_a, NA, atest_combodac, NA, NA, NA, NA, NA),
0863     PINGROUP(47, wcss_bt, dbg_out, qdss_tracedata_a, NA, atest_combodac, NA, NA, NA, NA),
0864     PINGROUP(48, wcss_bt, qdss_tracedata_a, NA, atest_combodac, NA, NA, NA, NA, NA),
0865     PINGROUP(49, uim3, gcc_gp1_clk_a, qdss_ctitrig_in_a1, NA, NA, NA, NA, NA, NA),
0866     PINGROUP(50, uim3, gcc_gp2_clk_a, qdss_ctitrig_in_b1, NA, NA, NA, NA, NA, NA),
0867     PINGROUP(51, uim3, gcc_gp3_clk_a, qdss_ctitrig_out_b1, NA, NA, NA, NA, NA, NA),
0868     PINGROUP(52, uim3, NA, qdss_ctitrig_out_a1, NA, NA, NA, NA, NA, NA),
0869     PINGROUP(53, uim2, NA, NA, NA, NA, NA, NA, NA, NA),
0870     PINGROUP(54, uim2, NA, NA, NA, NA, NA, NA, NA, NA),
0871     PINGROUP(55, uim2, NA, NA, NA, NA, NA, NA, NA, NA),
0872     PINGROUP(56, uim2, NA, NA, NA, NA, NA, NA, NA, NA),
0873     PINGROUP(57, uim1, atest_char3, NA, NA, NA, NA, NA, NA, NA),
0874     PINGROUP(58, uim1, atest_char2, NA, NA, NA, NA, NA, NA, NA),
0875     PINGROUP(59, uim1, atest_char1, NA, NA, NA, NA, NA, NA, NA),
0876     PINGROUP(60, uim1, atest_char0, NA, NA, NA, NA, NA, NA, NA),
0877     PINGROUP(61, uim_batt, NA, NA, NA, NA, NA, NA, NA, NA),
0878     PINGROUP(62, atest_char, qdss_tracedata_a, NA, NA, NA, NA, NA, NA, NA),
0879     PINGROUP(63, cdc_pdm0, bimc_dte0, NA, NA, NA, NA, NA, NA, NA),
0880     PINGROUP(64, cdc_pdm0, bimc_dte1, NA, NA, NA, NA, NA, NA, NA),
0881     PINGROUP(65, cdc_pdm0, bimc_dte0, NA, NA, NA, NA, NA, NA, NA),
0882     PINGROUP(66, cdc_pdm0, bimc_dte1, NA, NA, NA, NA, NA, NA, NA),
0883     PINGROUP(67, cdc_pdm0, ebi0_wrcdc, NA, NA, NA, NA, NA, NA, NA),
0884     PINGROUP(68, cdc_pdm0, NA, NA, NA, NA, NA, NA, NA, NA),
0885     PINGROUP(69, blsp_spi3_cs3, qdss_tracedata_a, NA, atest_combodac, NA, NA, NA, NA, NA),
0886     PINGROUP(70, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0887     PINGROUP(71, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0888     PINGROUP(72, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0889     PINGROUP(73, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0890     PINGROUP(74, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0891     PINGROUP(75, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0892     PINGROUP(76, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0893     PINGROUP(77, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0894     PINGROUP(78, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0895     PINGROUP(79, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0896     PINGROUP(80, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0897     PINGROUP(81, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0898     PINGROUP(82, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0899     PINGROUP(83, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0900     PINGROUP(84, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0901     PINGROUP(85, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0902     PINGROUP(86, NA, pa_indicator, NA, NA, NA, NA, NA, NA, NA),
0903     PINGROUP(87, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0904     PINGROUP(88, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0905     PINGROUP(89, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0906     PINGROUP(90, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0907     PINGROUP(91, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0908     PINGROUP(92, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0909     PINGROUP(93, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0910     PINGROUP(94, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0911     PINGROUP(95, NA, modem_tsync, nav_tsync, nav_pps, NA, NA, NA, NA, NA),
0912     PINGROUP(96, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0913     PINGROUP(97, gcc_gp1_clk_b, NA, NA, NA, NA, NA, NA, NA, NA),
0914     PINGROUP(98, NA, NA, NA, NA, NA, NA, NA, NA, NA),
0915     PINGROUP(99, gsm0_tx0, NA, NA, NA, NA, NA, NA, NA, NA),
0916     PINGROUP(100, gsm0_tx1, NA, NA, NA, NA, NA, NA, NA, NA),
0917     PINGROUP(101, gsm1_tx0, NA, NA, NA, NA, NA, NA, NA, NA),
0918     PINGROUP(102, gsm1_tx1, NA, NA, NA, NA, NA, NA, NA, NA),
0919     PINGROUP(103, ssbi_wtr0, NA, NA, NA, NA, NA, NA, NA, NA),
0920     PINGROUP(104, ssbi_wtr0, NA, NA, NA, NA, NA, NA, NA, NA),
0921     PINGROUP(105, ssbi_wtr1, NA, NA, NA, NA, NA, NA, NA, NA),
0922     PINGROUP(106, ssbi_wtr1, NA, NA, NA, NA, NA, NA, NA, NA),
0923     PINGROUP(107, pbs0, NA, atest_combodac, NA, NA, NA, NA, NA, NA),
0924     PINGROUP(108, pbs1, NA, NA, NA, NA, NA, NA, NA, NA),
0925     PINGROUP(109, pbs2, NA, NA, NA, NA, NA, NA, NA, NA),
0926     PINGROUP(110, blsp_spi1_cs1, pri_mi2s_ws, NA, qdss_tracedata_b, NA, NA, NA, NA, NA),
0927     PINGROUP(111, qdss_tracedata_b, NA, NA, NA, NA, NA, NA, NA, NA),
0928     PINGROUP(112, sec_mi2s, NA, NA, NA, qdss_tracedata_a, NA, atest_tsens, NA, NA),
0929     PINGROUP(113, pri_mi2s, NA, pwr_modem_enabled_b, NA, NA, NA, NA, NA, qdss_tracedata_a),
0930     PINGROUP(114, pri_mi2s, pwr_nav_enabled_b, NA, NA, NA, NA, NA, qdss_tracedata_a, NA),
0931     PINGROUP(115, pri_mi2s, pwr_crypto_enabled_b, NA, NA, NA, NA, NA, qdss_tracedata_a, NA),
0932     PINGROUP(116, pri_mi2s, NA, NA, NA, NA, NA, NA, NA, NA),
0933     PINGROUP(117, sec_mi2s, NA, NA, NA, NA, NA, NA, NA, NA),
0934     PINGROUP(118, sec_mi2s, NA, NA, NA, NA, NA, NA, NA, NA),
0935     PINGROUP(119, sec_mi2s, m_voc, NA, NA, NA, NA, NA, NA, NA),
0936     PINGROUP(120, blsp_spi3_cs1, ldo_update, NA, NA, NA, NA, NA, NA, NA),
0937     PINGROUP(121, sd_write, blsp_spi2_cs1, ldo_en, NA, NA, NA, NA, NA, NA),
0938     SDC_PINGROUP(sdc1_clk, 0x10a000, 13, 6),
0939     SDC_PINGROUP(sdc1_cmd, 0x10a000, 11, 3),
0940     SDC_PINGROUP(sdc1_data, 0x10a000, 9, 0),
0941     SDC_PINGROUP(sdc2_clk, 0x109000, 14, 6),
0942     SDC_PINGROUP(sdc2_cmd, 0x109000, 11, 3),
0943     SDC_PINGROUP(sdc2_data, 0x109000, 9, 0),
0944     SDC_PINGROUP(qdsd_clk, 0x19c000, 3, 0),
0945     SDC_PINGROUP(qdsd_cmd, 0x19c000, 8, 5),
0946     SDC_PINGROUP(qdsd_data0, 0x19c000, 13, 10),
0947     SDC_PINGROUP(qdsd_data1, 0x19c000, 18, 15),
0948     SDC_PINGROUP(qdsd_data2, 0x19c000, 23, 20),
0949     SDC_PINGROUP(qdsd_data3, 0x19c000, 28, 25),
0950 };
0951 
0952 #define NUM_GPIO_PINGROUPS  122
0953 
0954 static const struct msm_pinctrl_soc_data msm8916_pinctrl = {
0955     .pins = msm8916_pins,
0956     .npins = ARRAY_SIZE(msm8916_pins),
0957     .functions = msm8916_functions,
0958     .nfunctions = ARRAY_SIZE(msm8916_functions),
0959     .groups = msm8916_groups,
0960     .ngroups = ARRAY_SIZE(msm8916_groups),
0961     .ngpios = NUM_GPIO_PINGROUPS,
0962 };
0963 
0964 static int msm8916_pinctrl_probe(struct platform_device *pdev)
0965 {
0966     return msm_pinctrl_probe(pdev, &msm8916_pinctrl);
0967 }
0968 
0969 static const struct of_device_id msm8916_pinctrl_of_match[] = {
0970     { .compatible = "qcom,msm8916-pinctrl", },
0971     { },
0972 };
0973 
0974 static struct platform_driver msm8916_pinctrl_driver = {
0975     .driver = {
0976         .name = "msm8916-pinctrl",
0977         .of_match_table = msm8916_pinctrl_of_match,
0978     },
0979     .probe = msm8916_pinctrl_probe,
0980     .remove = msm_pinctrl_remove,
0981 };
0982 
0983 static int __init msm8916_pinctrl_init(void)
0984 {
0985     return platform_driver_register(&msm8916_pinctrl_driver);
0986 }
0987 arch_initcall(msm8916_pinctrl_init);
0988 
0989 static void __exit msm8916_pinctrl_exit(void)
0990 {
0991     platform_driver_unregister(&msm8916_pinctrl_driver);
0992 }
0993 module_exit(msm8916_pinctrl_exit);
0994 
0995 MODULE_DESCRIPTION("Qualcomm msm8916 pinctrl driver");
0996 MODULE_LICENSE("GPL v2");
0997 MODULE_DEVICE_TABLE(of, msm8916_pinctrl_of_match);