Skip to content

Commit 5600eab

Browse files
committed
Merge remote-tracking branches 'asoc/topic/arizona', 'asoc/topic/atmel', 'asoc/topic/bt-sco', 'asoc/topic/compress' and 'asoc/topic/cs35l33' into asoc-next
6 parents 72a04d6 + 8f273aa + e401029 + 5947e1b + 7c9190f + 37c520b commit 5600eab

File tree

21 files changed

+1794
-79
lines changed

21 files changed

+1794
-79
lines changed

Documentation/devicetree/bindings/sound/bt-sco.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This device support generic Bluetooth SCO link.
44

55
Required properties:
66

7-
- compatible : "delta,dfbmcs320"
7+
- compatible : "delta,dfbmcs320" or "linux,bt-sco"
88

99
Example:
1010

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
CS35L33 Speaker Amplifier
2+
3+
Required properties:
4+
5+
- compatible : "cirrus,cs35l33"
6+
7+
- reg : the I2C address of the device for I2C
8+
9+
- VA-supply, VP-supply : power supplies for the device,
10+
as covered in
11+
Documentation/devicetree/bindings/regulator/regulator.txt.
12+
13+
Optional properties:
14+
15+
- reset-gpios : gpio used to reset the amplifier
16+
17+
- interrupt-parent : Specifies the phandle of the interrupt controller to
18+
which the IRQs from CS35L33 are delivered to.
19+
- interrupts : IRQ line info CS35L33.
20+
(See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
21+
for further information relating to interrupt properties)
22+
23+
- cirrus,boost-ctl : Booster voltage use to supply the amp. If the value is
24+
0, then VBST = VP. If greater than 0, the boost voltage will be 3300mV with
25+
a value of 1 and will increase at a step size of 100mV until a maximum of
26+
8000mV.
27+
28+
- cirrus,ramp-rate : On power up, it affects the time from when the power
29+
up sequence begins to the time the audio reaches a full-scale output.
30+
On power down, it affects the time from when the power-down sequence
31+
begins to when the amplifier disables the PWM outputs. If this property
32+
is not set then soft ramping will be disabled and ramp time would be
33+
20ms. If this property is set to 0,1,2,3 then ramp times would be 40ms,
34+
60ms,100ms,175ms respectively for 48KHz sample rate.
35+
36+
- cirrus,boost-ipk : The maximum current allowed for the boost converter.
37+
The range starts at 1850000uA and goes to a maximum of 3600000uA
38+
with a step size of 15625uA. The default is 2500000uA.
39+
40+
- cirrus,imon-adc-scale : Configures the scaling of data bits from the IMON
41+
ADC data word. This property can be set as a value of 0 for bits 15 down
42+
to 0, 6 for 21 down to 6, 7, for 22 down to 7, 8 for 23 down to 8.
43+
44+
45+
Optional H/G Algorithm sub-node:
46+
47+
The cs35l33 node can have a single "cirrus,hg-algo" sub-node that will enable
48+
the internal H/G Algorithm.
49+
50+
- cirrus,hg-algo : Sub-node for internal Class H/G algorithm that
51+
controls the amplifier supplies.
52+
53+
Optional properties for the "cirrus,hg-algo" sub-node:
54+
55+
- cirrus,mem-depth : Memory depth for the Class H/G algorithm measured in
56+
LRCLK cycles. If this property is set to 0, 1, 2, or 3 then the memory
57+
depths will be 1, 4, 8, 16 LRCLK cycles. The default is 16 LRCLK cycles.
58+
59+
cirrus,release-rate : The number of consecutive LRCLK periods before
60+
allowing release condition tracking updates. The number of LRCLK periods
61+
start at 3 to a maximum of 255.
62+
63+
- cirrus,ldo-thld : Configures the signal threshold at which the PWM output
64+
stage enters LDO operation. Starts as a default value of 50mV for a value
65+
of 1 and increases with a step size of 50mV to a maximum of 750mV (value of
66+
0xF).
67+
68+
- cirrus,ldo-path-disable : This is a boolean property. If present, the H/G
69+
algorithm uses the max detection path. If not present, the LDO
70+
detection path is used.
71+
72+
- cirrus,ldo-entry-delay : The LDO entry delay in milliseconds before the H/G
73+
algorithm switches to the LDO voltage. This property can be set to values
74+
from 0 to 7 for delays of 5ms, 10ms, 50ms, 100ms, 200ms, 500ms, 1000ms.
75+
The default is 100ms.
76+
77+
- cirrus,vp-hg-auto : This is a boolean property. When set, class H/G VPhg
78+
automatic updating is enabled.
79+
80+
- cirrus,vp-hg : Class H/G algorithm VPhg. Controls the H/G algorithm's
81+
reference to the VP voltage for when to start generating a boosted VBST.
82+
The reference voltage starts at 3000mV with a value of 0x3 and is increased
83+
by 100mV per step to a maximum of 5500mV.
84+
85+
- cirrus,vp-hg-rate : The rate (number of LRCLK periods) at which the VPhg is
86+
allowed to increase to a higher voltage when using VPhg automatic
87+
tracking. This property can be set to values from 0 to 3 with rates of 128
88+
periods, 2048 periods, 32768 periods, and 524288 periods.
89+
The default is 32768 periods.
90+
91+
- cirrus,vp-hg-va : VA calculation reference for automatic VPhg tracking
92+
using VPMON. This property can be set to values from 0 to 6 starting at
93+
1800mV with a step size of 50mV up to a maximum value of 1750mV.
94+
Default is 1800mV.
95+
96+
Example:
97+
98+
cs35l33: cs35l33@40 {
99+
compatible = "cirrus,cs35l33";
100+
reg = <0x40>;
101+
102+
VA-supply = <&ldo5_reg>;
103+
VP-supply = <&ldo5_reg>;
104+
105+
interrupt-parent = <&gpio8>;
106+
interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
107+
108+
reset-gpios = <&cs47l91 34 0>;
109+
110+
cirrus,ramp-rate = <0x0>;
111+
cirrus,boost-ctl = <0x30>; /* VBST = 8000mV */
112+
cirrus,boost-ipk = <0xE0>; /* 3600mA */
113+
cirrus,imon-adc-scale = <0> /* Bits 15 down to 0 */
114+
115+
cirrus,hg-algo {
116+
cirrus,mem-depth = <0x3>;
117+
cirrus,release-rate = <0x3>;
118+
cirrus,ldo-thld = <0x1>;
119+
cirrus,ldo-path-disable = <0x0>;
120+
cirrus,ldo-entry-delay=<0x4>;
121+
cirrus,vp-hg-auto;
122+
cirrus,vp-hg=<0xF>;
123+
cirrus,vp-hg-rate=<0x2>;
124+
cirrus,vp-hg-va=<0x0>;
125+
};
126+
};

include/sound/cs35l33.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* linux/sound/cs35l33.h -- Platform data for CS35l33
3+
*
4+
* Copyright (c) 2016 Cirrus Logic Inc.
5+
*
6+
* This program is free software; you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 2 as
8+
* published by the Free Software Foundation.
9+
*/
10+
11+
#ifndef __CS35L33_H
12+
#define __CS35L33_H
13+
14+
struct cs35l33_hg {
15+
bool enable_hg_algo;
16+
unsigned int mem_depth;
17+
unsigned int release_rate;
18+
unsigned int hd_rm;
19+
unsigned int ldo_thld;
20+
unsigned int ldo_path_disable;
21+
unsigned int ldo_entry_delay;
22+
bool vp_hg_auto;
23+
unsigned int vp_hg;
24+
unsigned int vp_hg_rate;
25+
unsigned int vp_hg_va;
26+
};
27+
28+
struct cs35l33_pdata {
29+
/* Boost Controller Voltage Setting */
30+
unsigned int boost_ctl;
31+
32+
/* Boost Controller Peak Current */
33+
unsigned int boost_ipk;
34+
35+
/* Amplifier Drive Select */
36+
unsigned int amp_drv_sel;
37+
38+
/* soft volume ramp */
39+
unsigned int ramp_rate;
40+
41+
/* IMON adc scale */
42+
unsigned int imon_adc_scale;
43+
44+
/* H/G algo configuration */
45+
struct cs35l33_hg hg_config;
46+
};
47+
48+
#endif /* __CS35L33_H */

sound/soc/atmel/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ if SND_ATMEL_SOC
1010

1111
config SND_ATMEL_SOC_PDC
1212
tristate
13+
depends on HAS_DMA
1314
default m if SND_ATMEL_SOC_SSC_PDC=m && SND_ATMEL_SOC_SSC=m
1415
default y if SND_ATMEL_SOC_SSC_PDC=y || (SND_ATMEL_SOC_SSC_PDC=m && SND_ATMEL_SOC_SSC=y)
1516

sound/soc/atmel/atmel-classd.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -593,11 +593,6 @@ static int atmel_classd_probe(struct platform_device *pdev)
593593
}
594594

595595
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
596-
if (!res) {
597-
dev_err(dev, "no memory resource\n");
598-
return -ENXIO;
599-
}
600-
601596
io_base = devm_ioremap_resource(dev, res);
602597
if (IS_ERR(io_base)) {
603598
ret = PTR_ERR(io_base);

sound/soc/atmel/atmel-pdmic.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,6 @@ static int atmel_pdmic_probe(struct platform_device *pdev)
624624
}
625625

626626
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
627-
if (!res) {
628-
dev_err(dev, "no memory resource\n");
629-
return -ENXIO;
630-
}
631-
632627
io_base = devm_ioremap_resource(dev, res);
633628
if (IS_ERR(io_base)) {
634629
ret = PTR_ERR(io_base);

sound/soc/atmel/atmel_ssc_dai.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream,
321321
return ret;
322322
}
323323

324-
dma_params = &ssc_dma_params[dai->id][dir];
324+
dma_params = &ssc_dma_params[pdev->id][dir];
325325
dma_params->ssc = ssc_p->ssc;
326326
dma_params->substream = substream;
327327

sound/soc/codecs/Kconfig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ config SND_SOC_ALL_CODECS
4747
select SND_SOC_BT_SCO
4848
select SND_SOC_CQ0093VC if MFD_DAVINCI_VOICECODEC
4949
select SND_SOC_CS35L32 if I2C
50+
select SND_SOC_CS35L33 if I2C
5051
select SND_SOC_CS42L51_I2C if I2C
5152
select SND_SOC_CS42L52 if I2C && INPUT
5253
select SND_SOC_CS42L56 if I2C && INPUT
@@ -380,7 +381,7 @@ config SND_SOC_ALC5632
380381
tristate
381382

382383
config SND_SOC_BT_SCO
383-
tristate
384+
tristate "Dummy BT SCO codec driver"
384385

385386
config SND_SOC_CQ0093VC
386387
tristate
@@ -389,6 +390,10 @@ config SND_SOC_CS35L32
389390
tristate "Cirrus Logic CS35L32 CODEC"
390391
depends on I2C
391392

393+
config SND_SOC_CS35L33
394+
tristate "Cirrus Logic CS35L33 CODEC"
395+
depends on I2C
396+
392397
config SND_SOC_CS42L51
393398
tristate
394399

sound/soc/codecs/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ snd-soc-arizona-objs := arizona.o
3737
snd-soc-bt-sco-objs := bt-sco.o
3838
snd-soc-cq93vc-objs := cq93vc.o
3939
snd-soc-cs35l32-objs := cs35l32.o
40+
snd-soc-cs35l33-objs := cs35l33.o
4041
snd-soc-cs42l51-objs := cs42l51.o
4142
snd-soc-cs42l51-i2c-objs := cs42l51-i2c.o
4243
snd-soc-cs42l52-objs := cs42l52.o
@@ -254,6 +255,7 @@ obj-$(CONFIG_SND_SOC_ARIZONA) += snd-soc-arizona.o
254255
obj-$(CONFIG_SND_SOC_BT_SCO) += snd-soc-bt-sco.o
255256
obj-$(CONFIG_SND_SOC_CQ0093VC) += snd-soc-cq93vc.o
256257
obj-$(CONFIG_SND_SOC_CS35L32) += snd-soc-cs35l32.o
258+
obj-$(CONFIG_SND_SOC_CS35L33) += snd-soc-cs35l33.o
257259
obj-$(CONFIG_SND_SOC_CS42L51) += snd-soc-cs42l51.o
258260
obj-$(CONFIG_SND_SOC_CS42L51_I2C) += snd-soc-cs42l51-i2c.o
259261
obj-$(CONFIG_SND_SOC_CS42L52) += snd-soc-cs42l52.o

sound/soc/codecs/arizona.c

Lines changed: 11 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -85,30 +85,9 @@ static int arizona_spk_ev(struct snd_soc_dapm_widget *w,
8585
{
8686
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
8787
struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
88-
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
89-
bool manual_ena = false;
9088
int val;
9189

92-
switch (arizona->type) {
93-
case WM5102:
94-
switch (arizona->rev) {
95-
case 0:
96-
break;
97-
default:
98-
manual_ena = true;
99-
break;
100-
}
101-
default:
102-
break;
103-
}
104-
10590
switch (event) {
106-
case SND_SOC_DAPM_PRE_PMU:
107-
if (!priv->spk_ena && manual_ena) {
108-
regmap_write_async(arizona->regmap, 0x4f5, 0x25a);
109-
priv->spk_ena_pending = true;
110-
}
111-
break;
11291
case SND_SOC_DAPM_POST_PMU:
11392
val = snd_soc_read(codec, ARIZONA_INTERRUPT_RAW_STATUS_3);
11493
if (val & ARIZONA_SPK_OVERHEAT_STS) {
@@ -120,33 +99,12 @@ static int arizona_spk_ev(struct snd_soc_dapm_widget *w,
12099
regmap_update_bits_async(arizona->regmap,
121100
ARIZONA_OUTPUT_ENABLES_1,
122101
1 << w->shift, 1 << w->shift);
123-
124-
if (priv->spk_ena_pending) {
125-
msleep(75);
126-
regmap_write_async(arizona->regmap, 0x4f5, 0xda);
127-
priv->spk_ena_pending = false;
128-
priv->spk_ena++;
129-
}
130102
break;
131103
case SND_SOC_DAPM_PRE_PMD:
132-
if (manual_ena) {
133-
priv->spk_ena--;
134-
if (!priv->spk_ena)
135-
regmap_write_async(arizona->regmap,
136-
0x4f5, 0x25a);
137-
}
138-
139104
regmap_update_bits_async(arizona->regmap,
140105
ARIZONA_OUTPUT_ENABLES_1,
141106
1 << w->shift, 0);
142107
break;
143-
case SND_SOC_DAPM_POST_PMD:
144-
if (manual_ena) {
145-
if (!priv->spk_ena)
146-
regmap_write_async(arizona->regmap,
147-
0x4f5, 0x0da);
148-
}
149-
break;
150108
default:
151109
break;
152110
}
@@ -630,7 +588,7 @@ const struct soc_enum arizona_asrc_rate1 =
630588
arizona_rate_text, arizona_rate_val);
631589
EXPORT_SYMBOL_GPL(arizona_asrc_rate1);
632590

633-
static const char *arizona_vol_ramp_text[] = {
591+
static const char * const arizona_vol_ramp_text[] = {
634592
"0ms/6dB", "0.5ms/6dB", "1ms/6dB", "2ms/6dB", "4ms/6dB", "8ms/6dB",
635593
"15ms/6dB", "30ms/6dB",
636594
};
@@ -659,7 +617,7 @@ SOC_ENUM_SINGLE_DECL(arizona_out_vi_ramp,
659617
arizona_vol_ramp_text);
660618
EXPORT_SYMBOL_GPL(arizona_out_vi_ramp);
661619

662-
static const char *arizona_lhpf_mode_text[] = {
620+
static const char * const arizona_lhpf_mode_text[] = {
663621
"Low-pass", "High-pass"
664622
};
665623

@@ -687,7 +645,7 @@ SOC_ENUM_SINGLE_DECL(arizona_lhpf4_mode,
687645
arizona_lhpf_mode_text);
688646
EXPORT_SYMBOL_GPL(arizona_lhpf4_mode);
689647

690-
static const char *arizona_ng_hold_text[] = {
648+
static const char * const arizona_ng_hold_text[] = {
691649
"30ms", "120ms", "250ms", "500ms",
692650
};
693651

@@ -821,6 +779,14 @@ const struct soc_enum arizona_output_anc_src[] = {
821779
};
822780
EXPORT_SYMBOL_GPL(arizona_output_anc_src);
823781

782+
const struct snd_kcontrol_new arizona_voice_trigger_switch[] = {
783+
SOC_DAPM_SINGLE("Switch", SND_SOC_NOPM, 0, 1, 0),
784+
SOC_DAPM_SINGLE("Switch", SND_SOC_NOPM, 1, 1, 0),
785+
SOC_DAPM_SINGLE("Switch", SND_SOC_NOPM, 2, 1, 0),
786+
SOC_DAPM_SINGLE("Switch", SND_SOC_NOPM, 3, 1, 0),
787+
};
788+
EXPORT_SYMBOL_GPL(arizona_voice_trigger_switch);
789+
824790
static void arizona_in_set_vu(struct snd_soc_codec *codec, int ena)
825791
{
826792
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);

sound/soc/codecs/arizona.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ struct arizona_priv {
9090
unsigned int out_down_pending;
9191
unsigned int out_down_delay;
9292

93-
unsigned int spk_ena:2;
94-
unsigned int spk_ena_pending:1;
95-
9693
unsigned int dvfs_reqs;
9794
struct mutex dvfs_lock;
9895
bool dvfs_cached;
@@ -255,6 +252,8 @@ extern const struct soc_enum arizona_anc_input_src[];
255252
extern const struct soc_enum arizona_anc_ng_enum;
256253
extern const struct soc_enum arizona_output_anc_src[];
257254

255+
extern const struct snd_kcontrol_new arizona_voice_trigger_switch[];
256+
258257
extern int arizona_in_ev(struct snd_soc_dapm_widget *w,
259258
struct snd_kcontrol *kcontrol,
260259
int event);

0 commit comments

Comments
 (0)