PageRenderTime 129ms CodeModel.GetById 9ms app.highlight 113ms RepoModel.GetById 1ms app.codeStats 0ms

/arch/arm/mach-msm/board-8064-gpiomux.c

https://github.com/AICP/kernel_google_msm
C | 1480 lines | 1328 code | 108 blank | 44 comment | 25 complexity | b735e5d00c4be51b57eabceac496ea8f MD5 | raw file
   1/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
   2 *
   3 * This program is free software; you can redistribute it and/or modify
   4 * it under the terms of the GNU General Public License version 2 and
   5 * only version 2 as published by the Free Software Foundation.
   6 *
   7 * This program is distributed in the hope that it will be useful,
   8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
   9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10 * GNU General Public License for more details.
  11 *
  12 */
  13
  14#include <linux/init.h>
  15#include <linux/ioport.h>
  16#include <linux/platform_device.h>
  17#include <linux/bootmem.h>
  18#include <linux/gpio.h>
  19#include <asm/mach-types.h>
  20#include <asm/mach/mmc.h>
  21#include <mach/msm_bus_board.h>
  22#include <mach/board.h>
  23#include <mach/gpiomux.h>
  24#include <mach/socinfo.h>
  25#include "devices.h"
  26#include "board-8064.h"
  27
  28#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
  29static struct gpiomux_setting gpio_eth_config = {
  30	.pull = GPIOMUX_PULL_NONE,
  31	.drv = GPIOMUX_DRV_8MA,
  32	.func = GPIOMUX_FUNC_GPIO,
  33};
  34
  35/* The SPI configurations apply to GSBI 5*/
  36static struct gpiomux_setting gpio_spi_config = {
  37	.func = GPIOMUX_FUNC_2,
  38	.drv = GPIOMUX_DRV_12MA,
  39	.pull = GPIOMUX_PULL_NONE,
  40};
  41
  42/* The SPI configurations apply to GSBI 5 chip select 2*/
  43static struct gpiomux_setting gpio_spi_cs2_config = {
  44	.func = GPIOMUX_FUNC_3,
  45	.drv = GPIOMUX_DRV_12MA,
  46	.pull = GPIOMUX_PULL_NONE,
  47};
  48
  49
  50struct msm_gpiomux_config apq8064_ethernet_configs[] = {
  51	{
  52		.gpio = 43,
  53		.settings = {
  54			[GPIOMUX_SUSPENDED] = &gpio_eth_config,
  55			[GPIOMUX_ACTIVE] = &gpio_eth_config,
  56		}
  57	},
  58};
  59#endif
  60/* Chip selects for SPI clients */
  61static struct gpiomux_setting gpio_spi_cs_config = {
  62	.func = GPIOMUX_FUNC_GPIO,
  63	.drv = GPIOMUX_DRV_12MA,
  64	.pull = GPIOMUX_PULL_UP,
  65};
  66
  67/* Chip selects for EPM SPI clients */
  68static struct gpiomux_setting gpio_epm_spi_cs_config = {
  69	.func = GPIOMUX_FUNC_6,
  70	.drv = GPIOMUX_DRV_12MA,
  71	.pull = GPIOMUX_PULL_UP,
  72};
  73
  74#ifdef CONFIG_MSM_VCAP
  75static struct gpiomux_setting gpio_vcap_config[] = {
  76	{
  77		.func = GPIOMUX_FUNC_GPIO,
  78		.drv = GPIOMUX_DRV_2MA,
  79		.pull = GPIOMUX_PULL_DOWN,
  80	},
  81	{
  82		.func = GPIOMUX_FUNC_1,
  83		.drv = GPIOMUX_DRV_2MA,
  84		.pull = GPIOMUX_PULL_DOWN,
  85	},
  86	{
  87		.func = GPIOMUX_FUNC_2,
  88		.drv = GPIOMUX_DRV_2MA,
  89		.pull = GPIOMUX_PULL_DOWN,
  90	},
  91	{
  92		.func = GPIOMUX_FUNC_3,
  93		.drv = GPIOMUX_DRV_2MA,
  94		.pull = GPIOMUX_PULL_DOWN,
  95	},
  96	{
  97		.func = GPIOMUX_FUNC_4,
  98		.drv = GPIOMUX_DRV_2MA,
  99		.pull = GPIOMUX_PULL_DOWN,
 100	},
 101	{
 102		.func = GPIOMUX_FUNC_5,
 103		.drv = GPIOMUX_DRV_2MA,
 104		.pull = GPIOMUX_PULL_DOWN,
 105	},
 106	{
 107		.func = GPIOMUX_FUNC_6,
 108		.drv = GPIOMUX_DRV_2MA,
 109		.pull = GPIOMUX_PULL_DOWN,
 110	},
 111	{
 112		.func = GPIOMUX_FUNC_7,
 113		.drv = GPIOMUX_DRV_2MA,
 114		.pull = GPIOMUX_PULL_DOWN,
 115	},
 116	{
 117		.func = GPIOMUX_FUNC_8,
 118		.drv = GPIOMUX_DRV_2MA,
 119		.pull = GPIOMUX_PULL_DOWN,
 120	},
 121	{
 122		.func = GPIOMUX_FUNC_9,
 123		.drv = GPIOMUX_DRV_2MA,
 124		.pull = GPIOMUX_PULL_DOWN,
 125	},
 126	{
 127		.func = GPIOMUX_FUNC_A,
 128		.drv = GPIOMUX_DRV_2MA,
 129		.pull = GPIOMUX_PULL_DOWN,
 130	},
 131};
 132
 133struct msm_gpiomux_config vcap_configs[] = {
 134	{
 135		.gpio = 20,
 136		.settings = {
 137			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[7],
 138			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[7],
 139		}
 140	},
 141	{
 142		.gpio = 25,
 143		.settings = {
 144			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[2],
 145			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[2],
 146		}
 147	},
 148	{
 149		.gpio = 24,
 150		.settings = {
 151			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[1],
 152			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[1],
 153		}
 154	},
 155	{
 156		.gpio = 23,
 157		.settings = {
 158			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[2],
 159			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[2],
 160		}
 161	},
 162	{
 163		.gpio = 19,
 164		.settings = {
 165			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[8],
 166			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[8],
 167		}
 168	},
 169	{
 170		.gpio = 22,
 171		.settings = {
 172			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[2],
 173			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[2],
 174		}
 175	},
 176	{
 177		.gpio = 21,
 178		.settings = {
 179			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[7],
 180			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[7],
 181		}
 182	},
 183	{
 184		.gpio = 12,
 185		.settings = {
 186			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[6],
 187			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[6],
 188		}
 189	},
 190	{
 191		.gpio = 18,
 192		.settings = {
 193			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[9],
 194			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[9],
 195		}
 196	},
 197	{
 198		.gpio = 11,
 199		.settings = {
 200			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[10],
 201			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[10],
 202		}
 203	},
 204	{
 205		.gpio = 10,
 206		.settings = {
 207			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[9],
 208			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[9],
 209		}
 210	},
 211	{
 212		.gpio = 9,
 213		.settings = {
 214			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[2],
 215			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[2],
 216		}
 217	},
 218	{
 219		.gpio = 26,
 220		.settings = {
 221			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[1],
 222			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[1],
 223		}
 224	},
 225	{
 226		.gpio = 8,
 227		.settings = {
 228			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[3],
 229			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[3],
 230		}
 231	},
 232	{
 233		.gpio = 7,
 234		.settings = {
 235			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[7],
 236			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[7],
 237		}
 238	},
 239	{
 240		.gpio = 6,
 241		.settings = {
 242			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[7],
 243			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[7],
 244		}
 245	},
 246	{
 247		.gpio = 80,
 248		.settings = {
 249			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[2],
 250			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[2],
 251		}
 252	},
 253	{
 254		.gpio = 86,
 255		.settings = {
 256			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[1],
 257			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[1],
 258		}
 259	},
 260	{
 261		.gpio = 85,
 262		.settings = {
 263			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[4],
 264			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[4],
 265		}
 266	},
 267	{
 268		.gpio = 84,
 269		.settings = {
 270			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[3],
 271			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[3],
 272		}
 273	},
 274	{
 275		.gpio = 5,
 276		.settings = {
 277			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[2],
 278			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[2],
 279		}
 280	},
 281	{
 282		.gpio = 4,
 283		.settings = {
 284			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[3],
 285			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[3],
 286		}
 287	},
 288	{
 289		.gpio = 3,
 290		.settings = {
 291			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[6],
 292			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[6],
 293		}
 294	},
 295	{
 296		.gpio = 2,
 297		.settings = {
 298			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[5],
 299			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[5],
 300		}
 301	},
 302	{
 303		.gpio = 82,
 304		.settings = {
 305			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[4],
 306			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[4],
 307		}
 308	},
 309	{
 310		.gpio = 83,
 311		.settings = {
 312			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[4],
 313			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[4],
 314		}
 315	},
 316	{
 317		.gpio = 87,
 318		.settings = {
 319			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[2],
 320			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[2],
 321		}
 322	},
 323	{
 324		.gpio = 13,
 325		.settings = {
 326			[GPIOMUX_SUSPENDED] =	&gpio_vcap_config[6],
 327			[GPIOMUX_ACTIVE] =		&gpio_vcap_config[6],
 328		}
 329	},
 330};
 331#endif
 332
 333static struct gpiomux_setting gpio_i2c_config = {
 334	.func = GPIOMUX_FUNC_1,
 335	.drv = GPIOMUX_DRV_8MA,
 336	.pull = GPIOMUX_PULL_NONE,
 337};
 338
 339static struct gpiomux_setting gpio_i2c_config_sus = {
 340	.func = GPIOMUX_FUNC_1,
 341	.drv = GPIOMUX_DRV_2MA,
 342	.pull = GPIOMUX_PULL_KEEPER,
 343};
 344
 345static struct gpiomux_setting mbhc_hs_detect = {
 346	.func = GPIOMUX_FUNC_1,
 347	.drv = GPIOMUX_DRV_2MA,
 348	.pull = GPIOMUX_PULL_NONE,
 349};
 350
 351static struct gpiomux_setting cdc_mclk = {
 352	.func = GPIOMUX_FUNC_1,
 353	.drv = GPIOMUX_DRV_8MA,
 354	.pull = GPIOMUX_PULL_NONE,
 355};
 356
 357static struct gpiomux_setting wcnss_5wire_suspend_cfg = {
 358	.func = GPIOMUX_FUNC_GPIO,
 359	.drv  = GPIOMUX_DRV_2MA,
 360	.pull = GPIOMUX_PULL_UP,
 361};
 362
 363static struct gpiomux_setting wcnss_5wire_active_cfg = {
 364	.func = GPIOMUX_FUNC_1,
 365	.drv  = GPIOMUX_DRV_6MA,
 366	.pull = GPIOMUX_PULL_DOWN,
 367};
 368
 369
 370static struct gpiomux_setting slimbus = {
 371	.func = GPIOMUX_FUNC_1,
 372	.drv = GPIOMUX_DRV_8MA,
 373	.pull = GPIOMUX_PULL_KEEPER,
 374};
 375
 376static struct gpiomux_setting gsbi1_uart_config = {
 377	.func = GPIOMUX_FUNC_1,
 378	.drv = GPIOMUX_DRV_16MA,
 379	.pull = GPIOMUX_PULL_NONE,
 380};
 381
 382static struct gpiomux_setting ext_regulator_config = {
 383	.func = GPIOMUX_FUNC_GPIO,
 384	.drv = GPIOMUX_DRV_8MA,
 385	.pull = GPIOMUX_PULL_NONE,
 386	.dir = GPIOMUX_OUT_LOW,
 387};
 388
 389static struct gpiomux_setting gsbi7_func1_cfg = {
 390	.func = GPIOMUX_FUNC_1,
 391	.drv = GPIOMUX_DRV_8MA,
 392	.pull = GPIOMUX_PULL_NONE,
 393};
 394
 395static struct gpiomux_setting gsbi7_func2_cfg = {
 396	.func = GPIOMUX_FUNC_2,
 397	.drv = GPIOMUX_DRV_8MA,
 398	.pull = GPIOMUX_PULL_NONE,
 399};
 400
 401static struct gpiomux_setting gsbi3_suspended_cfg = {
 402	.func = GPIOMUX_FUNC_1,
 403	.drv = GPIOMUX_DRV_2MA,
 404	.pull = GPIOMUX_PULL_KEEPER,
 405};
 406
 407static struct gpiomux_setting gsbi3_active_cfg = {
 408	.func = GPIOMUX_FUNC_1,
 409	.drv = GPIOMUX_DRV_8MA,
 410	.pull = GPIOMUX_PULL_NONE,
 411};
 412
 413static struct gpiomux_setting hdmi_suspend_cfg = {
 414	.func = GPIOMUX_FUNC_GPIO,
 415	.drv = GPIOMUX_DRV_2MA,
 416	.pull = GPIOMUX_PULL_DOWN,
 417};
 418
 419static struct gpiomux_setting hdmi_active_1_cfg = {
 420	.func = GPIOMUX_FUNC_1,
 421	.drv = GPIOMUX_DRV_2MA,
 422	.pull = GPIOMUX_PULL_UP,
 423};
 424
 425static struct gpiomux_setting hdmi_active_2_cfg = {
 426	.func = GPIOMUX_FUNC_1,
 427	.drv = GPIOMUX_DRV_16MA,
 428	.pull = GPIOMUX_PULL_DOWN,
 429};
 430
 431static struct gpiomux_setting gsbi5_suspended_cfg = {
 432	.func = GPIOMUX_FUNC_2,
 433	.drv = GPIOMUX_DRV_12MA,
 434	.pull = GPIOMUX_PULL_NONE,
 435};
 436
 437static struct gpiomux_setting gsbi5_active_cfg = {
 438	.func = GPIOMUX_FUNC_2,
 439	.drv = GPIOMUX_DRV_12MA,
 440	.pull = GPIOMUX_PULL_NONE,
 441};
 442
 443static struct gpiomux_setting sx150x_suspended_cfg = {
 444	.func = GPIOMUX_FUNC_GPIO,
 445	.drv = GPIOMUX_DRV_8MA,
 446	.pull = GPIOMUX_PULL_NONE,
 447};
 448
 449static struct gpiomux_setting sx150x_active_cfg = {
 450	.func = GPIOMUX_FUNC_GPIO,
 451	.drv = GPIOMUX_DRV_8MA,
 452	.pull = GPIOMUX_PULL_NONE,
 453};
 454
 455#ifdef CONFIG_USB_EHCI_MSM_HSIC
 456static struct gpiomux_setting cyts_sleep_sus_cfg = {
 457	.func = GPIOMUX_FUNC_GPIO,
 458	.drv = GPIOMUX_DRV_6MA,
 459	.pull = GPIOMUX_PULL_DOWN,
 460};
 461
 462static struct gpiomux_setting cyts_sleep_act_cfg = {
 463	.func = GPIOMUX_FUNC_GPIO,
 464	.drv = GPIOMUX_DRV_6MA,
 465	.pull = GPIOMUX_PULL_DOWN,
 466};
 467
 468static struct gpiomux_setting cyts_int_act_cfg = {
 469	.func = GPIOMUX_FUNC_GPIO,
 470	.drv = GPIOMUX_DRV_8MA,
 471	.pull = GPIOMUX_PULL_UP,
 472};
 473
 474static struct gpiomux_setting cyts_int_sus_cfg = {
 475	.func = GPIOMUX_FUNC_GPIO,
 476	.drv = GPIOMUX_DRV_2MA,
 477	.pull = GPIOMUX_PULL_DOWN,
 478};
 479
 480static struct msm_gpiomux_config cyts_gpio_configs[] __initdata = {
 481	{	/* TS INTERRUPT */
 482		.gpio = 6,
 483		.settings = {
 484			[GPIOMUX_ACTIVE]    = &cyts_int_act_cfg,
 485			[GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
 486		},
 487	},
 488	{	/* TS SLEEP */
 489		.gpio = 33,
 490		.settings = {
 491			[GPIOMUX_ACTIVE]    = &cyts_sleep_act_cfg,
 492			[GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
 493		},
 494	},
 495};
 496static struct msm_gpiomux_config cyts_gpio_alt_config[] __initdata = {
 497	{	/* TS INTERRUPT */
 498		.gpio = 6,
 499		.settings = {
 500			[GPIOMUX_ACTIVE]    = &cyts_int_act_cfg,
 501			[GPIOMUX_SUSPENDED] = &cyts_int_sus_cfg,
 502		},
 503	},
 504	{	/* TS SLEEP */
 505		.gpio = 12,
 506		.settings = {
 507			[GPIOMUX_ACTIVE]    = &cyts_sleep_act_cfg,
 508			[GPIOMUX_SUSPENDED] = &cyts_sleep_sus_cfg,
 509		},
 510	},
 511};
 512
 513static struct gpiomux_setting hsic_act_cfg = {
 514	.func = GPIOMUX_FUNC_1,
 515	.drv = GPIOMUX_DRV_8MA,
 516	.pull = GPIOMUX_PULL_NONE,
 517};
 518
 519static struct gpiomux_setting hsic_sus_cfg = {
 520	.func = GPIOMUX_FUNC_GPIO,
 521	.drv = GPIOMUX_DRV_2MA,
 522	.pull = GPIOMUX_PULL_DOWN,
 523	.dir = GPIOMUX_OUT_LOW,
 524};
 525
 526static struct gpiomux_setting hsic_wakeup_act_cfg = {
 527	.func = GPIOMUX_FUNC_GPIO,
 528	.drv = GPIOMUX_DRV_8MA,
 529	.pull = GPIOMUX_PULL_DOWN,
 530	.dir = GPIOMUX_IN,
 531};
 532
 533static struct gpiomux_setting hsic_wakeup_sus_cfg = {
 534	.func = GPIOMUX_FUNC_GPIO,
 535	.drv = GPIOMUX_DRV_2MA,
 536	.pull = GPIOMUX_PULL_DOWN,
 537	.dir = GPIOMUX_IN,
 538};
 539
 540static struct msm_gpiomux_config apq8064_hsic_configs[] = {
 541	{
 542		.gpio = 88,               /*HSIC_STROBE */
 543		.settings = {
 544			[GPIOMUX_ACTIVE] = &hsic_act_cfg,
 545			[GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
 546		},
 547	},
 548	{
 549		.gpio = 89,               /* HSIC_DATA */
 550		.settings = {
 551			[GPIOMUX_ACTIVE] = &hsic_act_cfg,
 552			[GPIOMUX_SUSPENDED] = &hsic_sus_cfg,
 553		},
 554	},
 555	{
 556		.gpio = 47,              /* wake up */
 557		.settings = {
 558			[GPIOMUX_ACTIVE] = &hsic_wakeup_act_cfg,
 559			[GPIOMUX_SUSPENDED] = &hsic_wakeup_sus_cfg,
 560		},
 561	},
 562};
 563#endif
 564
 565static struct gpiomux_setting mxt_reset_sus_cfg = {
 566	.func = GPIOMUX_FUNC_GPIO,
 567	.drv = GPIOMUX_DRV_6MA,
 568	.pull = GPIOMUX_PULL_DOWN,
 569};
 570
 571static struct gpiomux_setting mxt_reset_act_cfg = {
 572	.func = GPIOMUX_FUNC_GPIO,
 573	.drv = GPIOMUX_DRV_6MA,
 574	.pull = GPIOMUX_PULL_UP,
 575};
 576
 577static struct gpiomux_setting mxt_int_sus_cfg = {
 578	.func = GPIOMUX_FUNC_GPIO,
 579	.drv = GPIOMUX_DRV_2MA,
 580	.pull = GPIOMUX_PULL_DOWN,
 581};
 582
 583static struct gpiomux_setting mxt_int_act_cfg = {
 584	.func = GPIOMUX_FUNC_GPIO,
 585	.drv = GPIOMUX_DRV_8MA,
 586	.pull = GPIOMUX_PULL_UP,
 587};
 588
 589static struct msm_gpiomux_config apq8064_hdmi_configs[] __initdata = {
 590	{
 591		.gpio = 69,
 592		.settings = {
 593			[GPIOMUX_ACTIVE]    = &hdmi_active_1_cfg,
 594			[GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
 595		},
 596	},
 597	{
 598		.gpio = 70,
 599		.settings = {
 600			[GPIOMUX_ACTIVE]    = &hdmi_active_1_cfg,
 601			[GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
 602		},
 603	},
 604	{
 605		.gpio = 71,
 606		.settings = {
 607			[GPIOMUX_ACTIVE]    = &hdmi_active_1_cfg,
 608			[GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
 609		},
 610	},
 611	{
 612		.gpio = 72,
 613		.settings = {
 614			[GPIOMUX_ACTIVE]    = &hdmi_active_2_cfg,
 615			[GPIOMUX_SUSPENDED] = &hdmi_suspend_cfg,
 616		},
 617	},
 618};
 619
 620static struct msm_gpiomux_config apq8064_gsbi_configs[] __initdata = {
 621	{
 622		.gpio      = 8,			/* GSBI3 I2C QUP SDA */
 623		.settings = {
 624			[GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
 625			[GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
 626		},
 627	},
 628	{
 629		.gpio      = 9,			/* GSBI3 I2C QUP SCL */
 630		.settings = {
 631			[GPIOMUX_SUSPENDED] = &gsbi3_suspended_cfg,
 632			[GPIOMUX_ACTIVE] = &gsbi3_active_cfg,
 633		},
 634	},
 635	{
 636		.gpio      = 18,		/* GSBI1 UART TX */
 637		.settings = {
 638			[GPIOMUX_SUSPENDED] = &gsbi1_uart_config,
 639		},
 640	},
 641	{
 642		.gpio      = 19,		/* GSBI1 UART RX */
 643		.settings = {
 644			[GPIOMUX_SUSPENDED] = &gsbi1_uart_config,
 645		},
 646	},
 647#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
 648	{
 649		.gpio      = 51,		/* GSBI5 QUP SPI_DATA_MOSI */
 650		.settings = {
 651			[GPIOMUX_SUSPENDED] = &gpio_spi_config,
 652		},
 653	},
 654	{
 655		.gpio      = 52,		/* GSBI5 QUP SPI_DATA_MISO */
 656		.settings = {
 657			[GPIOMUX_SUSPENDED] = &gpio_spi_config,
 658		},
 659	},
 660	{
 661		.gpio      = 53,		/* Funny CS0 */
 662		.settings = {
 663			[GPIOMUX_SUSPENDED] = &gpio_spi_config,
 664		},
 665	},
 666	{
 667		.gpio      = 31,		/* GSBI5 QUP SPI_CS2_N */
 668		.settings = {
 669			[GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config,
 670		},
 671	},
 672	{
 673		.gpio      = 54,		/* GSBI5 QUP SPI_CLK */
 674		.settings = {
 675			[GPIOMUX_SUSPENDED] = &gpio_spi_config,
 676		},
 677	},
 678#endif
 679	{
 680		.gpio      = 30,		/* FP CS */
 681		.settings = {
 682			[GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
 683		},
 684	},
 685	{
 686		.gpio      = 32,		/* EPM CS */
 687		.settings = {
 688			[GPIOMUX_SUSPENDED] = &gpio_epm_spi_cs_config,
 689		},
 690	},
 691	{
 692		.gpio      = 53,		/* NOR CS */
 693		.settings = {
 694			[GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
 695		},
 696	},
 697	{
 698		.gpio      = 82,	/* GSBI7 UART2 TX */
 699		.settings = {
 700			[GPIOMUX_SUSPENDED] = &gsbi7_func2_cfg,
 701		},
 702	},
 703	{
 704		.gpio      = 83,	/* GSBI7 UART2 RX */
 705		.settings = {
 706			[GPIOMUX_SUSPENDED] = &gsbi7_func1_cfg,
 707		},
 708	},
 709	{
 710		.gpio      = 21,		/* GSBI1 QUP I2C_CLK */
 711		.settings = {
 712			[GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
 713			[GPIOMUX_ACTIVE] = &gpio_i2c_config,
 714		},
 715	},
 716	{
 717		.gpio      = 20,		/* GSBI1 QUP I2C_DATA */
 718		.settings = {
 719			[GPIOMUX_SUSPENDED] = &gpio_i2c_config_sus,
 720			[GPIOMUX_ACTIVE] = &gpio_i2c_config,
 721		},
 722	},
 723};
 724
 725static struct msm_gpiomux_config apq8064_slimbus_config[] __initdata = {
 726	{
 727		.gpio   = 40,           /* slimbus clk */
 728		.settings = {
 729			[GPIOMUX_SUSPENDED] = &slimbus,
 730		},
 731	},
 732	{
 733		.gpio   = 41,           /* slimbus data */
 734		.settings = {
 735			[GPIOMUX_SUSPENDED] = &slimbus,
 736		},
 737	},
 738};
 739
 740static struct gpiomux_setting spkr_i2c = {
 741	.func = GPIOMUX_FUNC_1,
 742	.drv = GPIOMUX_DRV_8MA,
 743	.pull = GPIOMUX_PULL_KEEPER,
 744};
 745
 746static struct msm_gpiomux_config mpq8064_spkr_i2s_config[] __initdata = {
 747	{
 748		.gpio   = 47,           /* spkr i2c sck */
 749		.settings = {
 750			[GPIOMUX_SUSPENDED] = &spkr_i2c,
 751		},
 752	},
 753	{
 754		.gpio   = 48,           /* spkr_i2s_ws */
 755		.settings = {
 756			[GPIOMUX_SUSPENDED] = &spkr_i2c,
 757		},
 758	},
 759	{
 760		.gpio   = 49,           /* spkr_i2s_dout */
 761		.settings = {
 762			[GPIOMUX_SUSPENDED] = &spkr_i2c,
 763		},
 764	},
 765	{
 766		.gpio   = 50,           /* spkr_i2s_mclk */
 767		.settings = {
 768			[GPIOMUX_SUSPENDED] = &spkr_i2c,
 769		},
 770	},
 771};
 772
 773static struct msm_gpiomux_config apq8064_audio_codec_configs[] __initdata = {
 774	{
 775		.gpio = 38,
 776		.settings = {
 777			[GPIOMUX_SUSPENDED] = &mbhc_hs_detect,
 778		},
 779	},
 780	{
 781		.gpio = 39,
 782		.settings = {
 783			[GPIOMUX_SUSPENDED] = &cdc_mclk,
 784		},
 785	},
 786};
 787
 788/* External 3.3 V regulator enable */
 789static struct msm_gpiomux_config apq8064_ext_regulator_configs[] __initdata = {
 790	{
 791		.gpio = APQ8064_EXT_3P3V_REG_EN_GPIO,
 792		.settings = {
 793			[GPIOMUX_SUSPENDED] = &ext_regulator_config,
 794		},
 795	},
 796};
 797
 798static struct gpiomux_setting ap2mdm_cfg = {
 799	.func = GPIOMUX_FUNC_GPIO,
 800	.drv = GPIOMUX_DRV_8MA,
 801	.pull = GPIOMUX_PULL_DOWN,
 802};
 803
 804static struct gpiomux_setting mdm2ap_status_cfg = {
 805	.func = GPIOMUX_FUNC_GPIO,
 806	.drv = GPIOMUX_DRV_8MA,
 807	.pull = GPIOMUX_PULL_DOWN,
 808};
 809
 810static struct gpiomux_setting mdm2ap_errfatal_cfg = {
 811	.func = GPIOMUX_FUNC_GPIO,
 812	.drv = GPIOMUX_DRV_16MA,
 813	.pull = GPIOMUX_PULL_DOWN,
 814};
 815
 816static struct gpiomux_setting mdm2ap_pblrdy = {
 817	.func = GPIOMUX_FUNC_GPIO,
 818	.drv = GPIOMUX_DRV_16MA,
 819	.pull = GPIOMUX_PULL_DOWN,
 820};
 821
 822
 823static struct gpiomux_setting ap2mdm_soft_reset_cfg = {
 824	.func = GPIOMUX_FUNC_GPIO,
 825	.drv = GPIOMUX_DRV_8MA,
 826	.pull = GPIOMUX_PULL_DOWN,
 827};
 828
 829static struct gpiomux_setting ap2mdm_wakeup = {
 830	.func = GPIOMUX_FUNC_GPIO,
 831	.drv = GPIOMUX_DRV_8MA,
 832	.pull = GPIOMUX_PULL_DOWN,
 833};
 834
 835static struct msm_gpiomux_config mdm_configs[] __initdata = {
 836	/* AP2MDM_STATUS */
 837	{
 838		.gpio = 48,
 839		.settings = {
 840			[GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
 841		}
 842	},
 843	/* MDM2AP_STATUS */
 844	{
 845		.gpio = 49,
 846		.settings = {
 847			[GPIOMUX_ACTIVE] = &mdm2ap_status_cfg,
 848			[GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
 849		}
 850	},
 851	/* MDM2AP_ERRFATAL */
 852	{
 853		.gpio = 19,
 854		.settings = {
 855			[GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
 856		}
 857	},
 858	/* AP2MDM_ERRFATAL */
 859	{
 860		.gpio = 18,
 861		.settings = {
 862			[GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
 863		}
 864	},
 865	/* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */
 866	{
 867		.gpio = 27,
 868		.settings = {
 869			[GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
 870		}
 871	},
 872	/* AP2MDM_WAKEUP */
 873	{
 874		.gpio = 35,
 875		.settings = {
 876			[GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
 877		}
 878	},
 879	/* MDM2AP_PBL_READY*/
 880	{
 881		.gpio = 46,
 882		.settings = {
 883			[GPIOMUX_SUSPENDED] = &mdm2ap_pblrdy,
 884		}
 885	},
 886};
 887
 888static struct msm_gpiomux_config amdm_configs[] __initdata = {
 889	/* AP2MDM_STATUS */
 890	{
 891		.gpio = 48,
 892		.settings = {
 893			[GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
 894		}
 895	},
 896	/* MDM2AP_STATUS */
 897	{
 898		.gpio = 49,
 899		.settings = {
 900			[GPIOMUX_ACTIVE] = &mdm2ap_status_cfg,
 901			[GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
 902		}
 903	},
 904	/* MDM2AP_ERRFATAL */
 905	{
 906		.gpio = 19,
 907		.settings = {
 908			[GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
 909		}
 910	},
 911	/* AP2MDM_ERRFATAL */
 912	{
 913		.gpio = 18,
 914		.settings = {
 915			[GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
 916		}
 917	},
 918	/* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */
 919	{
 920		.gpio = 27,
 921		.settings = {
 922			[GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
 923		}
 924	},
 925	/* AP2MDM_WAKEUP */
 926	{
 927		.gpio = 35,
 928		.settings = {
 929			[GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
 930		}
 931	},
 932	/* MDM2AP_PBL_READY*/
 933	{
 934		.gpio = 31,
 935		.settings = {
 936			[GPIOMUX_SUSPENDED] = &mdm2ap_pblrdy,
 937		}
 938	},
 939};
 940
 941static struct msm_gpiomux_config bmdm_configs[] __initdata = {
 942	/* AP2MDM_STATUS */
 943	{
 944		.gpio = 56,
 945		.settings = {
 946			[GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
 947		}
 948	},
 949	/* MDM2AP_STATUS */
 950	{
 951		.gpio = 32,
 952		.settings = {
 953			[GPIOMUX_ACTIVE] = &mdm2ap_status_cfg,
 954			[GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
 955		}
 956	},
 957	/* MDM2AP_ERRFATAL */
 958	{
 959		.gpio = 81,
 960		.settings = {
 961			[GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
 962		}
 963	},
 964	/* AP2MDM_ERRFATAL */
 965	{
 966		.gpio = 18,
 967		.settings = {
 968			[GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
 969		}
 970	},
 971	/* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */
 972	{
 973		.gpio = 3,
 974		.settings = {
 975			[GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
 976		}
 977	},
 978	/* AP2MDM_WAKEUP */
 979	{
 980		.gpio = 29,
 981		.settings = {
 982			[GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
 983		}
 984	},
 985};
 986
 987static struct msm_gpiomux_config mdm_i2s_configs[] __initdata = {
 988	/* AP2MDM_STATUS */
 989	{
 990		.gpio = 48,
 991		.settings = {
 992			[GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
 993		}
 994	},
 995	/* MDM2AP_STATUS */
 996	{
 997		.gpio = 49,
 998		.settings = {
 999			[GPIOMUX_SUSPENDED] = &mdm2ap_status_cfg,
1000		}
1001	},
1002	/* MDM2AP_ERRFATAL */
1003	{
1004		.gpio = 19,
1005		.settings = {
1006			[GPIOMUX_SUSPENDED] = &mdm2ap_errfatal_cfg,
1007		}
1008	},
1009	/* AP2MDM_ERRFATAL */
1010	{
1011		.gpio = 18,
1012		.settings = {
1013			[GPIOMUX_SUSPENDED] = &ap2mdm_cfg,
1014		}
1015	},
1016	/* AP2MDM_SOFT_RESET, aka AP2MDM_PON_RESET_N */
1017	{
1018		.gpio = 0,
1019		.settings = {
1020			[GPIOMUX_SUSPENDED] = &ap2mdm_soft_reset_cfg,
1021		}
1022	},
1023	/* AP2MDM_WAKEUP */
1024	{
1025		.gpio = 44,
1026		.settings = {
1027			[GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
1028		}
1029	},
1030	/* MDM2AP_PBL_READY*/
1031	{
1032		.gpio = 81,
1033		.settings = {
1034			[GPIOMUX_SUSPENDED] = &mdm2ap_pblrdy,
1035		}
1036	},
1037};
1038
1039static struct gpiomux_setting mi2s_act_cfg = {
1040	.func = GPIOMUX_FUNC_1,
1041	.drv = GPIOMUX_DRV_8MA,
1042	.pull = GPIOMUX_PULL_NONE,
1043};
1044
1045static struct gpiomux_setting mi2s_sus_cfg = {
1046	.func = GPIOMUX_FUNC_GPIO,
1047	.drv = GPIOMUX_DRV_2MA,
1048	.pull = GPIOMUX_PULL_DOWN,
1049};
1050
1051static struct msm_gpiomux_config mpq8064_mi2s_configs[] __initdata = {
1052	{
1053		.gpio	= 27,		/* mi2s ws */
1054		.settings = {
1055			[GPIOMUX_ACTIVE]    = &mi2s_act_cfg,
1056			[GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
1057		},
1058	},
1059	{
1060		.gpio	= 28,		/* mi2s sclk */
1061		.settings = {
1062			[GPIOMUX_ACTIVE]    = &mi2s_act_cfg,
1063			[GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
1064		},
1065	},
1066	{
1067		.gpio	= 29,		/* mi2s dout3 */
1068		.settings = {
1069			[GPIOMUX_ACTIVE]    = &mi2s_act_cfg,
1070			[GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
1071		},
1072	},
1073	{
1074		.gpio	= 30,		/* mi2s dout2 */
1075		.settings = {
1076			[GPIOMUX_ACTIVE]    = &mi2s_act_cfg,
1077			[GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
1078		},
1079	},
1080
1081	{
1082		.gpio	= 31,		/* mi2s dout1 */
1083		.settings = {
1084			[GPIOMUX_ACTIVE]    = &mi2s_act_cfg,
1085			[GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
1086		},
1087	},
1088	{
1089		.gpio	= 32,		/* mi2s dout0 */
1090		.settings = {
1091			[GPIOMUX_ACTIVE]    = &mi2s_act_cfg,
1092			[GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
1093		},
1094	},
1095
1096	{
1097		.gpio	= 33,		/* mi2s mclk */
1098		.settings = {
1099			[GPIOMUX_ACTIVE]    = &mi2s_act_cfg,
1100			[GPIOMUX_SUSPENDED] = &mi2s_sus_cfg,
1101		},
1102	},
1103};
1104static struct msm_gpiomux_config apq8064_mxt_configs[] __initdata = {
1105	{	/* TS INTERRUPT */
1106		.gpio = 6,
1107		.settings = {
1108			[GPIOMUX_ACTIVE]    = &mxt_int_act_cfg,
1109			[GPIOMUX_SUSPENDED] = &mxt_int_sus_cfg,
1110		},
1111	},
1112	{	/* TS RESET */
1113		.gpio = 33,
1114		.settings = {
1115			[GPIOMUX_ACTIVE]    = &mxt_reset_act_cfg,
1116			[GPIOMUX_SUSPENDED] = &mxt_reset_sus_cfg,
1117		},
1118	},
1119};
1120
1121static struct msm_gpiomux_config wcnss_5wire_interface[] = {
1122	{
1123		.gpio = 64,
1124		.settings = {
1125			[GPIOMUX_ACTIVE]    = &wcnss_5wire_active_cfg,
1126			[GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1127		},
1128	},
1129	{
1130		.gpio = 65,
1131		.settings = {
1132			[GPIOMUX_ACTIVE]    = &wcnss_5wire_active_cfg,
1133			[GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1134		},
1135	},
1136	{
1137		.gpio = 66,
1138		.settings = {
1139			[GPIOMUX_ACTIVE]    = &wcnss_5wire_active_cfg,
1140			[GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1141		},
1142	},
1143	{
1144		.gpio = 67,
1145		.settings = {
1146			[GPIOMUX_ACTIVE]    = &wcnss_5wire_active_cfg,
1147			[GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1148		},
1149	},
1150	{
1151		.gpio = 68,
1152		.settings = {
1153			[GPIOMUX_ACTIVE]    = &wcnss_5wire_active_cfg,
1154			[GPIOMUX_SUSPENDED] = &wcnss_5wire_suspend_cfg,
1155		},
1156	},
1157};
1158
1159static struct msm_gpiomux_config mpq8064_gsbi5_i2c_configs[] __initdata = {
1160	{
1161		.gpio      = 53,			/* GSBI5 I2C QUP SDA */
1162		.settings = {
1163			[GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
1164			[GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
1165		},
1166	},
1167	{
1168		.gpio      = 54,			/* GSBI5 I2C QUP SCL */
1169		.settings = {
1170			[GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
1171			[GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
1172		},
1173	},
1174};
1175
1176static struct gpiomux_setting ir_suspended_cfg = {
1177	.func = GPIOMUX_FUNC_GPIO,
1178	.drv = GPIOMUX_DRV_2MA,
1179	.pull = GPIOMUX_PULL_UP,
1180};
1181
1182static struct gpiomux_setting ir_active_cfg = {
1183	.func = GPIOMUX_FUNC_GPIO,
1184	.drv = GPIOMUX_DRV_8MA,
1185	.pull = GPIOMUX_PULL_UP,
1186};
1187
1188static struct msm_gpiomux_config mpq8064_ir_configs[] __initdata = {
1189	{
1190		.gpio      = 88,			/* GPIO IR */
1191		.settings = {
1192			[GPIOMUX_SUSPENDED] = &ir_suspended_cfg,
1193			[GPIOMUX_ACTIVE] = &ir_active_cfg,
1194		},
1195	},
1196};
1197
1198static struct msm_gpiomux_config sx150x_int_configs[] __initdata = {
1199	{
1200		.gpio      = 81,
1201		.settings = {
1202			[GPIOMUX_SUSPENDED] = &sx150x_suspended_cfg,
1203			[GPIOMUX_ACTIVE] = &sx150x_active_cfg,
1204		},
1205	},
1206};
1207
1208#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
1209static struct gpiomux_setting sdc2_clk_active_cfg = {
1210	.func = GPIOMUX_FUNC_2,
1211	.drv = GPIOMUX_DRV_8MA,
1212	.pull = GPIOMUX_PULL_NONE,
1213};
1214
1215static struct gpiomux_setting sdc2_cmd_data_0_3_active_cfg = {
1216	.func = GPIOMUX_FUNC_2,
1217	.drv = GPIOMUX_DRV_8MA,
1218	.pull = GPIOMUX_PULL_UP,
1219};
1220
1221static struct gpiomux_setting sdc2_suspended_cfg = {
1222	.func = GPIOMUX_FUNC_GPIO,
1223	.drv = GPIOMUX_DRV_2MA,
1224	.pull = GPIOMUX_PULL_DOWN,
1225};
1226
1227static struct gpiomux_setting sdc2_data_1_suspended_cfg = {
1228	.func = GPIOMUX_FUNC_GPIO,
1229	.drv = GPIOMUX_DRV_2MA,
1230	.pull = GPIOMUX_PULL_UP,
1231};
1232
1233static struct msm_gpiomux_config apq8064_sdc2_configs[] __initdata = {
1234	{
1235		.gpio      = 59,
1236		.settings = {
1237			[GPIOMUX_ACTIVE] = &sdc2_clk_active_cfg,
1238			[GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1239		},
1240	},
1241	{
1242		.gpio      = 57,
1243		.settings = {
1244			[GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1245			[GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1246		},
1247
1248	},
1249	{
1250		.gpio      = 62,
1251		.settings = {
1252			[GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1253			[GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1254		},
1255	},
1256	{
1257		.gpio      = 61,
1258		.settings = {
1259			[GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1260			[GPIOMUX_SUSPENDED] = &sdc2_data_1_suspended_cfg,
1261		},
1262	},
1263	{
1264		.gpio      = 60,
1265		.settings = {
1266			[GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1267			[GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1268		},
1269	},
1270	{
1271		.gpio      = 58,
1272		.settings = {
1273			[GPIOMUX_ACTIVE] = &sdc2_cmd_data_0_3_active_cfg,
1274			[GPIOMUX_SUSPENDED] = &sdc2_suspended_cfg,
1275		},
1276	},
1277};
1278#endif
1279
1280
1281#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
1282static struct gpiomux_setting sdc4_clk_active_cfg = {
1283	.func = GPIOMUX_FUNC_2,
1284	.drv = GPIOMUX_DRV_8MA,
1285	.pull = GPIOMUX_PULL_NONE,
1286};
1287
1288static struct gpiomux_setting sdc4_cmd_data_0_3_active_cfg = {
1289	.func = GPIOMUX_FUNC_2,
1290	.drv = GPIOMUX_DRV_8MA,
1291	.pull = GPIOMUX_PULL_UP,
1292};
1293
1294static struct gpiomux_setting sdc4_suspended_cfg = {
1295	.func = GPIOMUX_FUNC_GPIO,
1296	.drv = GPIOMUX_DRV_2MA,
1297	.pull = GPIOMUX_PULL_DOWN,
1298};
1299
1300static struct gpiomux_setting sdc4_data_1_suspended_cfg = {
1301	.func = GPIOMUX_FUNC_GPIO,
1302	.drv = GPIOMUX_DRV_2MA,
1303	.pull = GPIOMUX_PULL_UP,
1304};
1305
1306static struct msm_gpiomux_config apq8064_sdc4_configs[] __initdata = {
1307	{
1308		.gpio      = 68,
1309		.settings = {
1310			[GPIOMUX_ACTIVE] = &sdc4_clk_active_cfg,
1311			[GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1312		},
1313	},
1314	{
1315		.gpio      = 67,
1316		.settings = {
1317			[GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1318			[GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1319		},
1320
1321	},
1322	{
1323		.gpio      = 66,
1324		.settings = {
1325			[GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1326			[GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1327		},
1328	},
1329	{
1330		.gpio      = 65,
1331		.settings = {
1332			[GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1333			[GPIOMUX_SUSPENDED] = &sdc4_data_1_suspended_cfg,
1334		},
1335	},
1336	{
1337		.gpio      = 64,
1338		.settings = {
1339			[GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1340			[GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1341		},
1342	},
1343	{
1344		.gpio      = 63,
1345		.settings = {
1346			[GPIOMUX_ACTIVE] = &sdc4_cmd_data_0_3_active_cfg,
1347			[GPIOMUX_SUSPENDED] = &sdc4_suspended_cfg,
1348		},
1349	},
1350};
1351#endif
1352
1353static struct gpiomux_setting apq8064_sdc3_card_det_cfg = {
1354	.func = GPIOMUX_FUNC_GPIO,
1355	.drv = GPIOMUX_DRV_2MA,
1356	.pull = GPIOMUX_PULL_UP,
1357};
1358
1359static struct msm_gpiomux_config apq8064_sdc3_configs[] __initdata = {
1360	{
1361		.gpio      = 26,
1362		.settings = {
1363			[GPIOMUX_SUSPENDED] = &apq8064_sdc3_card_det_cfg,
1364			[GPIOMUX_ACTIVE] = &apq8064_sdc3_card_det_cfg,
1365		},
1366	},
1367};
1368
1369void __init apq8064_init_gpiomux(void)
1370{
1371	int rc;
1372	int platform_version = socinfo_get_platform_version();
1373
1374	rc = msm_gpiomux_init(NR_GPIO_IRQS);
1375	if (rc) {
1376		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
1377		return;
1378	}
1379
1380	msm_gpiomux_install(wcnss_5wire_interface,
1381			ARRAY_SIZE(wcnss_5wire_interface));
1382
1383	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
1384		 machine_is_mpq8064_dtv()) {
1385		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
1386				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
1387#ifdef CONFIG_MSM_VCAP
1388		msm_gpiomux_install(vcap_configs,
1389				ARRAY_SIZE(vcap_configs));
1390#endif
1391		msm_gpiomux_install(sx150x_int_configs,
1392				ARRAY_SIZE(sx150x_int_configs));
1393	} else {
1394		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
1395		msm_gpiomux_install(apq8064_ethernet_configs,
1396				ARRAY_SIZE(apq8064_ethernet_configs));
1397		#endif
1398
1399		msm_gpiomux_install(apq8064_gsbi_configs,
1400				ARRAY_SIZE(apq8064_gsbi_configs));
1401	}
1402
1403	msm_gpiomux_install(apq8064_slimbus_config,
1404			ARRAY_SIZE(apq8064_slimbus_config));
1405
1406	msm_gpiomux_install(apq8064_audio_codec_configs,
1407			ARRAY_SIZE(apq8064_audio_codec_configs));
1408
1409	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
1410		machine_is_mpq8064_dtv()) {
1411		msm_gpiomux_install(mpq8064_spkr_i2s_config,
1412			ARRAY_SIZE(mpq8064_spkr_i2s_config));
1413	}
1414
1415	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
1416		" as audio is not the primary user"
1417		" for these GPIO Pins\n", __func__);
1418
1419	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
1420		machine_is_mpq8064_dtv())
1421		msm_gpiomux_install(mpq8064_mi2s_configs,
1422			ARRAY_SIZE(mpq8064_mi2s_configs));
1423
1424	msm_gpiomux_install(apq8064_ext_regulator_configs,
1425			ARRAY_SIZE(apq8064_ext_regulator_configs));
1426
1427	if (machine_is_apq8064_mtp()) {
1428		if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_DSDA2) {
1429			msm_gpiomux_install(amdm_configs,
1430					ARRAY_SIZE(amdm_configs));
1431			msm_gpiomux_install(bmdm_configs,
1432				ARRAY_SIZE(bmdm_configs));
1433		} else if (SOCINFO_VERSION_MINOR(platform_version) == 1)
1434			msm_gpiomux_install(mdm_i2s_configs,
1435					ARRAY_SIZE(mdm_i2s_configs));
1436		else
1437			msm_gpiomux_install(mdm_configs,
1438					ARRAY_SIZE(mdm_configs));
1439	}
1440
1441	if (machine_is_apq8064_mtp()) {
1442		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
1443			msm_gpiomux_install(cyts_gpio_alt_config,
1444					ARRAY_SIZE(cyts_gpio_alt_config));
1445		} else {
1446			msm_gpiomux_install(cyts_gpio_configs,
1447					ARRAY_SIZE(cyts_gpio_configs));
1448		}
1449	}
1450
1451#ifdef CONFIG_USB_EHCI_MSM_HSIC
1452	if (machine_is_apq8064_mtp())
1453		msm_gpiomux_install(apq8064_hsic_configs,
1454				ARRAY_SIZE(apq8064_hsic_configs));
1455#endif
1456
1457	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
1458		msm_gpiomux_install(apq8064_mxt_configs,
1459			ARRAY_SIZE(apq8064_mxt_configs));
1460
1461	msm_gpiomux_install(apq8064_hdmi_configs,
1462			ARRAY_SIZE(apq8064_hdmi_configs));
1463
1464	 if (machine_is_mpq8064_cdp())
1465		msm_gpiomux_install(mpq8064_ir_configs,
1466				ARRAY_SIZE(mpq8064_ir_configs));
1467
1468#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
1469	 msm_gpiomux_install(apq8064_sdc2_configs,
1470			     ARRAY_SIZE(apq8064_sdc2_configs));
1471#endif
1472
1473#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
1474	 msm_gpiomux_install(apq8064_sdc4_configs,
1475			     ARRAY_SIZE(apq8064_sdc4_configs));
1476#endif
1477
1478	msm_gpiomux_install(apq8064_sdc3_configs,
1479			ARRAY_SIZE(apq8064_sdc3_configs));
1480}