Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: rt5682s: Add LDO output selection for dacref

Add LDO output selection for dacref.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/62cad4e51c044108bad872ab349e36f8@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jack Yu and committed by
Mark Brown
577d7154 d3534684

+38
+8
include/sound/rt5682s.h
··· 31 31 RT5682S_DAI_NUM_CLKS, 32 32 }; 33 33 34 + enum { 35 + RT5682S_LDO_1_607V, 36 + RT5682S_LDO_1_5V, 37 + RT5682S_LDO_1_406V, 38 + RT5682S_LDO_1_731V, 39 + }; 40 + 34 41 struct rt5682s_platform_data { 35 42 enum rt5682s_dmic1_data_pin dmic1_data_pin; 36 43 enum rt5682s_dmic1_clk_pin dmic1_clk_pin; ··· 45 38 unsigned int dmic_clk_rate; 46 39 unsigned int dmic_delay; 47 40 unsigned int amic_delay; 41 + unsigned int ldo_dacref; 48 42 bool dmic_clk_driving_high; 49 43 50 44 const char *dai_clk_names[RT5682S_DAI_NUM_CLKS];
+23
sound/soc/codecs/rt5682s.c
··· 2971 2971 &rt5682s->pdata.dmic_delay); 2972 2972 device_property_read_u32(dev, "realtek,amic-delay-ms", 2973 2973 &rt5682s->pdata.amic_delay); 2974 + device_property_read_u32(dev, "realtek,ldo-sel", 2975 + &rt5682s->pdata.ldo_dacref); 2974 2976 2975 2977 if (device_property_read_string_array(dev, "clock-output-names", 2976 2978 rt5682s->pdata.dai_clk_names, ··· 3249 3247 break; 3250 3248 default: 3251 3249 dev_warn(&i2c->dev, "invalid DMIC_CLK pin\n"); 3250 + break; 3251 + } 3252 + 3253 + /* LDO output voltage control */ 3254 + switch (rt5682s->pdata.ldo_dacref) { 3255 + case RT5682S_LDO_1_607V: 3256 + break; 3257 + case RT5682S_LDO_1_5V: 3258 + regmap_update_bits(rt5682s->regmap, RT5682S_BIAS_CUR_CTRL_7, 3259 + RT5682S_LDO_DACREF_MASK, RT5682S_LDO_DACREF_1_5V); 3260 + break; 3261 + case RT5682S_LDO_1_406V: 3262 + regmap_update_bits(rt5682s->regmap, RT5682S_BIAS_CUR_CTRL_7, 3263 + RT5682S_LDO_DACREF_MASK, RT5682S_LDO_DACREF_1_406V); 3264 + break; 3265 + case RT5682S_LDO_1_731V: 3266 + regmap_update_bits(rt5682s->regmap, RT5682S_BIAS_CUR_CTRL_7, 3267 + RT5682S_LDO_DACREF_MASK, RT5682S_LDO_DACREF_1_731V); 3268 + break; 3269 + default: 3270 + dev_warn(&i2c->dev, "invalid LDO output setting.\n"); 3252 3271 break; 3253 3272 } 3254 3273
+7
sound/soc/codecs/rt5682s.h
··· 1263 1263 #define RT5682S_JDH_NO_PLUG (0x1 << 4) 1264 1264 #define RT5682S_JDH_PLUG (0x0 << 4) 1265 1265 1266 + /* Bias current control 7 (0x0110) */ 1267 + #define RT5682S_LDO_DACREF_MASK (0x3 << 4) 1268 + #define RT5682S_LDO_DACREF_1_607V (0x0 << 4) 1269 + #define RT5682S_LDO_DACREF_1_5V (0x1 << 4) 1270 + #define RT5682S_LDO_DACREF_1_406V (0x2 << 4) 1271 + #define RT5682S_LDO_DACREF_1_731V (0x3 << 4) 1272 + 1266 1273 /* Charge Pump Internal Register1 (0x0125) */ 1267 1274 #define RT5682S_CP_CLK_HP_MASK (0x3 << 4) 1268 1275 #define RT5682S_CP_CLK_HP_100KHZ (0x0 << 4)