Skip to contentSkip to conversation

ASoC: rt5645: Minor coding style modify

PATCH Applied Oder Chiou 2 participants 4 messages Sep 19, 2014 – Oct 1, 2014

Subsystems (3)
lore
Share & tools
lore

Oder Chiou

author maintainer
#0 lore raw

PATCH 1/2 ASoC: rt5645: Minor coding style modify

Minor coding style modify

---
 sound/soc/codecs/rt5645.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/rt5645.c +2 -2
index a7762d0..dfbe74a 100644
@@ -1838,7 +1838,7 @@ static int rt5645_hw_params(struct snd_pcm_substream *substream,
 			RT5645_I2S_DL_MASK, val_len);
 		snd_soc_update_bits(codec, RT5645_ADDA_CLK1, mask_clk, val_clk);
 		break;
-	case  RT5645_AIF2:
+	case RT5645_AIF2:
 		mask_clk = RT5645_I2S_BCLK_MS2_MASK | RT5645_I2S_PD2_MASK;
 		val_clk = bclk_ms << RT5645_I2S_BCLK_MS2_SFT |
 			pre_div << RT5645_I2S_PD2_SFT;
@@ -1983,7 +1983,7 @@ static int rt5645_set_dai_pll(struct snd_soc_dai *dai, int pll_id, int source,
 			snd_soc_update_bits(codec, RT5645_GLB_CLK,
 				RT5645_PLL1_SRC_MASK, RT5645_PLL1_SRC_BCLK1);
 			break;
-		case  RT5645_AIF2:
+		case RT5645_AIF2:
 			snd_soc_update_bits(codec, RT5645_GLB_CLK,
 				RT5645_PLL1_SRC_MASK, RT5645_PLL1_SRC_BCLK2);
 			break;
Signature · 1 line
1.8.1.1.439.g50a6b54
author maintainer
#1 lore raw

PATCH 2/2 ASoC: rt5645: Add headset detect function

Add headset detect function

---
 include/sound/rt5645.h    |  3 ++
 sound/soc/codecs/rt5645.c | 99 +++++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/rt5645.h |  5 +++
 3 files changed, 107 insertions(+)
include/sound/rt5645.h +3 -0
index 1de744c..a535271 100644
@@ -20,6 +20,9 @@ struct rt5645_platform_data {
 	/* 0 = IN2N; 1 = GPIO5; 2 = GPIO11 */
 	unsigned int dmic2_data_pin;
 	/* 0 = IN2P; 1 = GPIO6; 2 = GPIO10; 3 = GPIO12 */
+
+	unsigned int hp_det_gpio;
+	bool gpio_hp_det_active_high;
 };
 
 #endif
sound/soc/codecs/rt5645.c +99 -0

129 lines not on this page · raw message

sound/soc/codecs/rt5645.h +5 -0
index 355b7e9..50c62c5 100644
@@ -2166,6 +2166,8 @@ struct rt5645_priv {
 	struct snd_soc_codec *codec;
 	struct rt5645_platform_data pdata;
 	struct regmap *regmap;
+	struct i2c_client *i2c;
+	struct snd_soc_jack *jack;
 
 	int sysclk;
 	int sysclk_src;
@@ -2178,4 +2180,7 @@ struct rt5645_priv {
 	int pll_out;
 };
 
+int rt5645_set_jack_detect(struct snd_soc_codec *codec,
+	struct snd_soc_jack *jack);
+
 #endif /* __RT5645_H__ */
Signature · 1 line
1.8.1.1.439.g50a6b54
maintainer
#2 lore raw

Re: [PATCH 2/2] ASoC: rt5645: Add headset detect function

Quoted 1 line · Oder Chiou

Add headset detect function

I've applied this but I can't help thinking that it'd be good to reuse the jack GPIO code here for the debouncing, what it's doing with the use of a workqueue is more friendly. Either that or add similar workqueue code to this driver.