From 3a935469c96610d34a0469b4dbf963d771eaefa7 Mon Sep 17 00:00:00 2001 From: Philippe Langlais Date: Tue, 11 Oct 2011 14:50:16 +0200 Subject: Input: Add AB8500 AV Acc. Detection as platform drv Adds AV Accessory detection driver functionality as a platform driver. Driver allows detection of basic AV-Accessory connected to 3.5mm AV-Connector. Supported accessories include headphone, headset, video and carkit. Driver controls the audio-in/video-out switch based on the detected accessory type and notifies about button presses from basic headsets (No ECI Support). Accessory status and button presses are reported as standard input events, if AB8500 ASoC Machine driver is configured. For accessory properties reporting, ALSA JACK definitions (SND_JACK_*) are used to report the features supported by the attached accessory. Button presses are reported with KEY_MEDIA keycode. Depends on: http://gerrit.lud.stericsson.com/gerrit/16910 for GPIO framework update. ST-Ericsson ID: ER 275366 Signed-off-by: Rahul Venkatram Change-Id: Ie1c68120fc718710ecac2d3dafe4f3e7b1a53ac1 Signed-off-by: Rahul Venkatram Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/16256 Reviewed-by: Mattias WALLIN Conflicts: arch/arm/mach-ux500/board-mop500-regulators.c arch/arm/mach-ux500/board-mop500.c sound/soc/ux500/ux500_ab8500.c --- include/sound/ux500_ab8500.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 include/sound/ux500_ab8500.h (limited to 'include/sound/ux500_ab8500.h') diff --git a/include/sound/ux500_ab8500.h b/include/sound/ux500_ab8500.h new file mode 100644 index 00000000000..ff114d82d9e --- /dev/null +++ b/include/sound/ux500_ab8500.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) ST-Ericsson SA 2010 + * + * Author: Jarmo K. Kuronen + * for ST-Ericsson. + * + * License terms: + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#ifndef UX500_AB8500_H +#define UX500_AB8500_H + +extern struct snd_soc_ops ux500_ab8500_ops[]; + +int ux500_ab8500_machine_codec_init(struct snd_soc_pcm_runtime *runtime); + +void ux500_ab8500_soc_machine_drv_cleanup(void); + +int enable_regulator(const char *name); +void disable_regulator(const char *name); + +extern void ux500_ab8500_jack_report(int); + +#endif -- cgit v1.2.3 From a49d30c017f0a343dcf4d9ba09bd3c7e49b4935a Mon Sep 17 00:00:00 2001 From: Robert Marklund Date: Mon, 30 May 2011 09:35:38 +0200 Subject: sound: soc: ux500: Fix merge problems Fix merge problems introduced in soc u8500 driver when merging from main dev track ST-Ericsson Linux next: 342252 ST-Ericsson ID: 342253 ST-Ericsson FOSS-OUT ID: Trivial Signed-off-by: Robert Marklund Change-Id: I083638dddc34792b654d36b5aa967238614799c7 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/24724 Reviewed-by: Philippe LANGLAIS --- include/sound/ux500_ab8500.h | 14 +++++++++++--- sound/soc/ux500/u8500.c | 9 +++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'include/sound/ux500_ab8500.h') diff --git a/include/sound/ux500_ab8500.h b/include/sound/ux500_ab8500.h index ff114d82d9e..7858bfdb4fa 100644 --- a/include/sound/ux500_ab8500.h +++ b/include/sound/ux500_ab8500.h @@ -16,12 +16,20 @@ extern struct snd_soc_ops ux500_ab8500_ops[]; -int ux500_ab8500_machine_codec_init(struct snd_soc_pcm_runtime *runtime); +struct snd_soc_pcm_runtime; + +int ux500_ab8500_startup(struct snd_pcm_substream *substream); + +void ux500_ab8500_shutdown(struct snd_pcm_substream *substream); + +int ux500_ab8500_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params); + +int ux500_ab8500_soc_machine_drv_init(void); void ux500_ab8500_soc_machine_drv_cleanup(void); -int enable_regulator(const char *name); -void disable_regulator(const char *name); +int ux500_ab8500_machine_codec_init(struct snd_soc_pcm_runtime *runtime); extern void ux500_ab8500_jack_report(int); diff --git a/sound/soc/ux500/u8500.c b/sound/soc/ux500/u8500.c index 4172dcb1eb1..a0ced866def 100644 --- a/sound/soc/ux500/u8500.c +++ b/sound/soc/ux500/u8500.c @@ -166,6 +166,15 @@ static int __init u8500_soc_init(void) platform_device_register(&cg29xx_codec); #endif + #ifdef CONFIG_SND_SOC_UX500_AB8500 + pr_debug("%s: Calling init-function for AB8500 machine driver.\n", + __func__); + ret = ux500_ab8500_soc_machine_drv_init(); + if (ret) + pr_err("%s: ux500_ab8500_soc_machine_drv_init failed (%d).\n", + __func__, ret); + #endif + pr_debug("%s: Register device to generate a probe for Ux500-pcm platform.\n", __func__); platform_device_register(&ux500_pcm); -- cgit v1.2.3