Skip to content

Commit

Permalink
audio switch and event report driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchenggong committed Sep 27, 2016
1 parent fd93355 commit 1a4fd61
Show file tree
Hide file tree
Showing 6 changed files with 376 additions and 38 deletions.
7 changes: 4 additions & 3 deletions arch/arm/configs/lc1860_evb3_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ CONFIG_RTC_COMIP=y
CONFIG_SWITCH_COMIP=y
# CONFIG_SWITCH_COMIP_PMIC is not set
# CONFIG_SWITCH_COMIP_CODEC is not set
CONFIG_SWITCH_FSA8108=y
CONFIG_THERMAL_COMIP=y
CONFIG_METS_COMIP=y
CONFIG_UREG_COMIP=y
Expand Down Expand Up @@ -484,11 +485,11 @@ CONFIG_VIDEO_COMIP_CSI2=y
# CONFIG_VIDEO_OV3650 is not set
# CONFIG_VIDEO_S5K4E1 is not set
# CONFIG_VIDEO_S5K3H2 is not set
# CONFIG_VIDEO_OV2680 is not set
CONFIG_VIDEO_OV2680=y
# CONFIG_VIDEO_OV9760 is not set
# CONFIG_VIDEO_OV9724 is not set
# CONFIG_VIDEO_OV5647 is not set
CONFIG_VIDEO_OV5648_2LANE_19M=y
# CONFIG_VIDEO_OV5648_2LANE_19M is not set
# CONFIG_VIDEO_OV4689 is not set
# CONFIG_VIDEO_OV5648_2LANE_26M is not set
# CONFIG_VIDEO_OV8865 is not set
Expand All @@ -497,7 +498,7 @@ CONFIG_VIDEO_OV5648_2LANE_19M=y
# CONFIG_VIDEO_OV8825 is not set
# CONFIG_VIDEO_OV8850 is not set
# CONFIG_VIDEO_OV12830 is not set
CONFIG_VIDEO_OV13850=y
# CONFIG_VIDEO_OV13850 is not set
# CONFIG_VIDEO_HM5065 is not set
# CONFIG_VIDEO_HM5040 is not set
# CONFIG_VIDEO_HM2056 is not set
Expand Down
43 changes: 11 additions & 32 deletions arch/arm/mach-lc186x/board/board-lc1860.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,13 @@ static struct mfp_pin_cfg comip_mfp_cfg[] = {
{MFP_PIN_GPIO(105), MFP_PIN_MODE_GPIO},
{MFP_PIN_GPIO(104), MFP_PIN_MODE_GPIO},
{MFP_PIN_GPIO(102), MFP_PIN_MODE_GPIO},

{MFP_PIN_GPIO(142), MFP_PIN_MODE_GPIO},
{MFP_PIN_GPIO(204), MFP_PIN_MODE_GPIO},
{MFP_PIN_GPIO(176), MFP_PIN_MODE_GPIO},
{MFP_PIN_GPIO(144), MFP_PIN_MODE_GPIO},
{MFP_PIN_GPIO(75), MFP_PIN_MODE_GPIO},
{MFP_PIN_GPIO(226), MFP_PIN_MODE_GPIO},
};

static struct mfp_pull_cfg comip_mfp_pull_cfg[] = {
Expand Down Expand Up @@ -1399,6 +1404,12 @@ static struct i2c_board_info comip_i2c0_board_info[] = {
static struct i2c_board_info comip_i2c1_board_info[] = {
// TODO: to be continue for device
/* als+ps */
#if defined(CONFIG_SWITCH_FSA8108)
{
.type = "fsa8108",
.addr = 0x23,
},
#endif
#if defined(CONFIG_LIGHT_PROXIMITY_GP2AP030)
{
.type = "gp2ap030",
Expand Down Expand Up @@ -2937,45 +2948,13 @@ static void comip_init_misc(void)
{
}

static int ear_switch(int enable)
{
int ear_switch_gpio = mfp_to_gpio(EAR_SWITCH_PIN);
gpio_request(ear_switch_gpio, "ear switch");
gpio_direction_output(ear_switch_gpio, enable);
gpio_free(ear_switch_gpio);

return 0;
}

//static int pa_boost_enable(int enable)
//{
// int pa_extra_gpio = mfp_to_gpio(CODEC_PA_EXTRA_PIN);
// int pa_gpio=mfp_to_gpio(CODEC_PA_PIN);
// gpio_request(pa_extra_gpio, "codec_pa_extra_gpio");
// gpio_request(pa_gpio, "codec_pa_gpio");
// gpio_direction_output(pa_extra_gpio, enable);
// gpio_direction_output(pa_gpio, enable);
// gpio_free(pa_extra_gpio);
// gpio_free(pa_gpio);
//
// return 0;
//}

static void comip_init_codec(void)
{
lc1160_codec_platform_data.ear_switch = ear_switch;
//lc1160_codec_platform_data.pa_enable = pa_boost_enable;

}

static void __init comip_init_board_early(void)
{
comip_muxpin_pvdd_config();
comip_init_mfp();
comip_init_gpio_lp();
comip_init_i2c();
comip_init_lcd();
comip_init_codec();
}
static void __init comip_init_board(void)
{
Expand Down
8 changes: 5 additions & 3 deletions arch/arm/mach-lc186x/board/board-lc1860.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,12 @@
#define LC1160_GPIO_ECLK MFP_PIN_GPIO(91)
#define LC1160_INT_PIN MFP_PIN_GPIO(99)
#define LC1160_INT2_PIN MFP_PIN_GPIO(223)
#define CODEC_PA_PIN MFP_PIN_GPIO(102)
#define EAR_SWITCH_PIN MFP_PIN_GPIO(75)
#define HOOK_PIN MFP_PIN_GPIO(226)
#define FSA8108_INT_PIN MFP_PIN_GPIO(135)
//#define CODEC_PA_PIN MFP_PIN_GPIO(102)
//#define EAR_SWITCH_PIN MFP_PIN_GPIO(75)
//#define CODEC_PA_PIN MFP_PIN_GPIO(75)
#define CODEC_JACK_POLARITY 1
#define CODEC_JACK_POLARITY 0

/* BQ27510 GASGAUGE. */
#define BQ27510_GASGAUGE_INT_PIN MFP_PIN_GPIO(134)
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/plat-lc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ config SWITCH_COMIP_CODEC
help
Select this option if you want to use codec switch.

config SWITCH_FSA8108
tristate "Use fsa8108 audio switch"
select SWITCH_COMIP
help
Select this option if you want to use fsa8108 audio switch.


config THERMAL_COMIP
tristate "thermal"
help
Expand Down
1 change: 1 addition & 0 deletions arch/arm/plat-lc/drivers/switch/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
obj-$(CONFIG_SWITCH_COMIP_PMIC) += comip-switch-pmic.o
obj-$(CONFIG_SWITCH_COMIP_CODEC) += comip-switch-codec.o
obj-$(CONFIG_SWITCH_FSA8108) += switch-fsa8108.o
Loading

0 comments on commit 1a4fd61

Please sign in to comment.