Skip to content

Commit 4c78c8b

Browse files
authored
Merge pull request #3616 from plbossart/merge/sound-upstream-20220426
Merge/sound upstream 20220426
2 parents 035fa5d + 51c2e58 commit 4c78c8b

47 files changed

Lines changed: 352 additions & 230 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/devicetree/bindings/sound/maxim,max98390.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ properties:
2929
minimum: 1
3030
maximum: 8388607
3131

32+
reset-gpios:
33+
maxItems: 1
34+
3235
required:
3336
- compatible
3437
- reg
@@ -37,6 +40,7 @@ additionalProperties: false
3740

3841
examples:
3942
- |
43+
#include <dt-bindings/gpio/gpio.h>
4044
i2c {
4145
#address-cells = <1>;
4246
#size-cells = <0>;
@@ -45,5 +49,6 @@ examples:
4549
reg = <0x38>;
4650
maxim,temperature_calib = <1024>;
4751
maxim,r0_calib = <100232>;
52+
reset-gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
4853
};
4954
};

drivers/base/regmap/regcache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
183183
return 0;
184184
}
185185

186-
if (!map->max_register)
187-
map->max_register = map->num_reg_defaults_raw;
186+
if (!map->max_register && map->num_reg_defaults_raw)
187+
map->max_register = (map->num_reg_defaults_raw - 1) * map->reg_stride;
188188

189189
if (map->cache_ops->init) {
190190
dev_dbg(map->dev, "Initializing %s cache\n",

include/linux/firmware/cirrus/cs_dsp.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,36 +68,36 @@ struct cs_dsp_alg_region {
6868

6969
/**
7070
* struct cs_dsp_coeff_ctl - Describes a coefficient control
71+
* @list: List node for internal use
72+
* @dsp: DSP instance associated with this control
73+
* @cache: Cached value of the control
7174
* @fw_name: Name of the firmware
7275
* @subname: Name of the control parsed from the WMFW
7376
* @subname_len: Length of subname
74-
* @alg_region: Logical region associated with this control
75-
* @dsp: DSP instance associated with this control
76-
* @enabled: Flag indicating whether control is enabled
77-
* @list: List node for internal use
78-
* @cache: Cached value of the control
7977
* @offset: Offset of control within alg_region in words
8078
* @len: Length of the cached value in bytes
81-
* @set: Flag indicating the value has been written by the user
82-
* @flags: Bitfield of WMFW_CTL_FLAG_ control flags defined in wmfw.h
8379
* @type: One of the WMFW_CTL_TYPE_ control types defined in wmfw.h
80+
* @flags: Bitfield of WMFW_CTL_FLAG_ control flags defined in wmfw.h
81+
* @set: Flag indicating the value has been written by the user
82+
* @enabled: Flag indicating whether control is enabled
83+
* @alg_region: Logical region associated with this control
8484
* @priv: For use by the client
8585
*/
8686
struct cs_dsp_coeff_ctl {
87+
struct list_head list;
88+
struct cs_dsp *dsp;
89+
void *cache;
8790
const char *fw_name;
8891
/* Subname is needed to match with firmware */
8992
const char *subname;
9093
unsigned int subname_len;
91-
struct cs_dsp_alg_region alg_region;
92-
struct cs_dsp *dsp;
93-
unsigned int enabled:1;
94-
struct list_head list;
95-
void *cache;
9694
unsigned int offset;
9795
size_t len;
98-
unsigned int set:1;
99-
unsigned int flags;
10096
unsigned int type;
97+
unsigned int flags;
98+
unsigned int set:1;
99+
unsigned int enabled:1;
100+
struct cs_dsp_alg_region alg_region;
101101

102102
void *priv;
103103
};

include/sound/soc.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,23 @@
282282
.get = xhandler_get, .put = xhandler_put, \
283283
.private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
284284
xmax, xinvert) }
285+
#define SOC_DOUBLE_R_S_EXT_TLV(xname, reg_left, reg_right, xshift, xmin, xmax, \
286+
xsign_bit, xinvert, xhandler_get, xhandler_put, \
287+
tlv_array) \
288+
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
289+
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
290+
SNDRV_CTL_ELEM_ACCESS_READWRITE, \
291+
.tlv.p = (tlv_array), \
292+
.info = snd_soc_info_volsw, \
293+
.get = xhandler_get, .put = xhandler_put, \
294+
.private_value = SOC_DOUBLE_R_S_VALUE(reg_left, reg_right, xshift, \
295+
xmin, xmax, xsign_bit, xinvert) }
296+
#define SOC_SINGLE_S_EXT_TLV(xname, xreg, xshift, xmin, xmax, \
297+
xsign_bit, xinvert, xhandler_get, xhandler_put, \
298+
tlv_array) \
299+
SOC_DOUBLE_R_S_EXT_TLV(xname, xreg, xreg, xshift, xmin, xmax, \
300+
xsign_bit, xinvert, xhandler_get, xhandler_put, \
301+
tlv_array)
285302
#define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \
286303
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
287304
.info = snd_soc_info_bool_ext, \

sound/core/pcm_memory.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@ EXPORT_SYMBOL(snd_pcm_lib_malloc_pages);
453453
*/
454454
int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream)
455455
{
456-
struct snd_card *card = substream->pcm->card;
457456
struct snd_pcm_runtime *runtime;
458457

459458
if (PCM_RUNTIME_CHECK(substream))
@@ -462,6 +461,8 @@ int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream)
462461
if (runtime->dma_area == NULL)
463462
return 0;
464463
if (runtime->dma_buffer_p != &substream->dma_buffer) {
464+
struct snd_card *card = substream->pcm->card;
465+
465466
/* it's a newly allocated buffer. release it now. */
466467
do_free_pages(card, runtime->dma_buffer_p);
467468
kfree(runtime->dma_buffer_p);

sound/soc/atmel/mchp-pdmc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,7 @@ static int mchp_pdmc_process(struct snd_pcm_substream *substream,
966966

967967
static struct snd_dmaengine_pcm_config mchp_pdmc_config = {
968968
.process = mchp_pdmc_process,
969+
.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
969970
};
970971

971972
static int mchp_pdmc_probe(struct platform_device *pdev)

sound/soc/codecs/ak4613.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -876,8 +876,7 @@ static void ak4613_parse_of(struct ak4613_priv *priv,
876876
AK4613_CONFIG_SDTI_set(priv, sdti_num);
877877
}
878878

879-
static int ak4613_i2c_probe(struct i2c_client *i2c,
880-
const struct i2c_device_id *id)
879+
static int ak4613_i2c_probe(struct i2c_client *i2c)
881880
{
882881
struct device *dev = &i2c->dev;
883882
struct device_node *np = dev->of_node;
@@ -888,8 +887,11 @@ static int ak4613_i2c_probe(struct i2c_client *i2c,
888887
regmap_cfg = NULL;
889888
if (np)
890889
regmap_cfg = of_device_get_match_data(dev);
891-
else
890+
else {
891+
const struct i2c_device_id *id =
892+
i2c_match_id(ak4613_i2c_id, i2c);
892893
regmap_cfg = (const struct regmap_config *)id->driver_data;
894+
}
893895

894896
if (!regmap_cfg)
895897
return -EINVAL;
@@ -927,7 +929,7 @@ static struct i2c_driver ak4613_i2c_driver = {
927929
.name = "ak4613-codec",
928930
.of_match_table = ak4613_of_match,
929931
},
930-
.probe = ak4613_i2c_probe,
932+
.probe_new = ak4613_i2c_probe,
931933
.remove = ak4613_i2c_remove,
932934
.id_table = ak4613_i2c_id,
933935
};

sound/soc/codecs/ak4642.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,8 @@ static struct clk *ak4642_of_parse_mcko(struct device *dev)
630630
#endif
631631

632632
static const struct of_device_id ak4642_of_match[];
633-
static int ak4642_i2c_probe(struct i2c_client *i2c,
634-
const struct i2c_device_id *id)
633+
static const struct i2c_device_id ak4642_i2c_id[];
634+
static int ak4642_i2c_probe(struct i2c_client *i2c)
635635
{
636636
struct device *dev = &i2c->dev;
637637
struct device_node *np = dev->of_node;
@@ -651,6 +651,8 @@ static int ak4642_i2c_probe(struct i2c_client *i2c,
651651
if (of_id)
652652
drvdata = of_id->data;
653653
} else {
654+
const struct i2c_device_id *id =
655+
i2c_match_id(ak4642_i2c_id, i2c);
654656
drvdata = (const struct ak4642_drvdata *)id->driver_data;
655657
}
656658

@@ -697,7 +699,7 @@ static struct i2c_driver ak4642_i2c_driver = {
697699
.name = "ak4642-codec",
698700
.of_match_table = ak4642_of_match,
699701
},
700-
.probe = ak4642_i2c_probe,
702+
.probe_new = ak4642_i2c_probe,
701703
.id_table = ak4642_i2c_id,
702704
};
703705

sound/soc/codecs/alc5623.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -968,21 +968,29 @@ static const struct regmap_config alc5623_regmap = {
968968
.cache_type = REGCACHE_RBTREE,
969969
};
970970

971+
static const struct i2c_device_id alc5623_i2c_table[] = {
972+
{"alc5621", 0x21},
973+
{"alc5622", 0x22},
974+
{"alc5623", 0x23},
975+
{}
976+
};
977+
MODULE_DEVICE_TABLE(i2c, alc5623_i2c_table);
978+
971979
/*
972980
* ALC5623 2 wire address is determined by A1 pin
973981
* state during powerup.
974982
* low = 0x1a
975983
* high = 0x1b
976984
*/
977-
static int alc5623_i2c_probe(struct i2c_client *client,
978-
const struct i2c_device_id *id)
985+
static int alc5623_i2c_probe(struct i2c_client *client)
979986
{
980987
struct alc5623_platform_data *pdata;
981988
struct alc5623_priv *alc5623;
982989
struct device_node *np;
983990
unsigned int vid1, vid2;
984991
int ret;
985992
u32 val32;
993+
const struct i2c_device_id *id;
986994

987995
alc5623 = devm_kzalloc(&client->dev, sizeof(struct alc5623_priv),
988996
GFP_KERNEL);
@@ -1009,6 +1017,8 @@ static int alc5623_i2c_probe(struct i2c_client *client,
10091017
}
10101018
vid2 >>= 8;
10111019

1020+
id = i2c_match_id(alc5623_i2c_table, client);
1021+
10121022
if ((vid1 != 0x10ec) || (vid2 != id->driver_data)) {
10131023
dev_err(&client->dev, "unknown or wrong codec\n");
10141024
dev_err(&client->dev, "Expected %x:%lx, got %x:%x\n",
@@ -1060,14 +1070,6 @@ static int alc5623_i2c_probe(struct i2c_client *client,
10601070
return ret;
10611071
}
10621072

1063-
static const struct i2c_device_id alc5623_i2c_table[] = {
1064-
{"alc5621", 0x21},
1065-
{"alc5622", 0x22},
1066-
{"alc5623", 0x23},
1067-
{}
1068-
};
1069-
MODULE_DEVICE_TABLE(i2c, alc5623_i2c_table);
1070-
10711073
#ifdef CONFIG_OF
10721074
static const struct of_device_id alc5623_of_match[] = {
10731075
{ .compatible = "realtek,alc5623", },
@@ -1082,7 +1084,7 @@ static struct i2c_driver alc5623_i2c_driver = {
10821084
.name = "alc562x-codec",
10831085
.of_match_table = of_match_ptr(alc5623_of_match),
10841086
},
1085-
.probe = alc5623_i2c_probe,
1087+
.probe_new = alc5623_i2c_probe,
10861088
.id_table = alc5623_i2c_table,
10871089
};
10881090

sound/soc/codecs/alc5632.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,18 +1092,24 @@ static const struct regmap_config alc5632_regmap = {
10921092
.cache_type = REGCACHE_RBTREE,
10931093
};
10941094

1095+
static const struct i2c_device_id alc5632_i2c_table[] = {
1096+
{"alc5632", 0x5c},
1097+
{}
1098+
};
1099+
MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table);
1100+
10951101
/*
10961102
* alc5632 2 wire address is determined by A1 pin
10971103
* state during powerup.
10981104
* low = 0x1a
10991105
* high = 0x1b
11001106
*/
1101-
static int alc5632_i2c_probe(struct i2c_client *client,
1102-
const struct i2c_device_id *id)
1107+
static int alc5632_i2c_probe(struct i2c_client *client)
11031108
{
11041109
struct alc5632_priv *alc5632;
11051110
int ret, ret1, ret2;
11061111
unsigned int vid1, vid2;
1112+
const struct i2c_device_id *id;
11071113

11081114
alc5632 = devm_kzalloc(&client->dev,
11091115
sizeof(struct alc5632_priv), GFP_KERNEL);
@@ -1129,6 +1135,8 @@ static int alc5632_i2c_probe(struct i2c_client *client,
11291135

11301136
vid2 >>= 8;
11311137

1138+
id = i2c_match_id(alc5632_i2c_table, client);
1139+
11321140
if ((vid1 != 0x10EC) || (vid2 != id->driver_data)) {
11331141
dev_err(&client->dev,
11341142
"Device is not a ALC5632: VID1=0x%x, VID2=0x%x\n", vid1, vid2);
@@ -1161,12 +1169,6 @@ static int alc5632_i2c_probe(struct i2c_client *client,
11611169
return ret;
11621170
}
11631171

1164-
static const struct i2c_device_id alc5632_i2c_table[] = {
1165-
{"alc5632", 0x5c},
1166-
{}
1167-
};
1168-
MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table);
1169-
11701172
#ifdef CONFIG_OF
11711173
static const struct of_device_id alc5632_of_match[] = {
11721174
{ .compatible = "realtek,alc5632", },
@@ -1181,7 +1183,7 @@ static struct i2c_driver alc5632_i2c_driver = {
11811183
.name = "alc5632",
11821184
.of_match_table = of_match_ptr(alc5632_of_match),
11831185
},
1184-
.probe = alc5632_i2c_probe,
1186+
.probe_new = alc5632_i2c_probe,
11851187
.id_table = alc5632_i2c_table,
11861188
};
11871189

0 commit comments

Comments
 (0)