Skip to content

Commit f66229a

Browse files
committed
Merge tag 'asoc-v5.17-2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v5.17 A few more updates for v5.17, nothing hugely stand out in the few days since the initial pull request was sent.
2 parents 2e88c6a + f517ba4 commit f66229a

File tree

19 files changed

+584
-179
lines changed

19 files changed

+584
-179
lines changed

drivers/firmware/cirrus/cs_dsp.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2744,10 +2744,16 @@ EXPORT_SYMBOL_GPL(cs_dsp_stop);
27442744

27452745
static int cs_dsp_halo_start_core(struct cs_dsp *dsp)
27462746
{
2747-
return regmap_update_bits(dsp->regmap,
2748-
dsp->base + HALO_CCM_CORE_CONTROL,
2749-
HALO_CORE_RESET | HALO_CORE_EN,
2750-
HALO_CORE_RESET | HALO_CORE_EN);
2747+
int ret;
2748+
2749+
ret = regmap_update_bits(dsp->regmap, dsp->base + HALO_CCM_CORE_CONTROL,
2750+
HALO_CORE_RESET | HALO_CORE_EN,
2751+
HALO_CORE_RESET | HALO_CORE_EN);
2752+
if (ret)
2753+
return ret;
2754+
2755+
return regmap_update_bits(dsp->regmap, dsp->base + HALO_CCM_CORE_CONTROL,
2756+
HALO_CORE_RESET, 0);
27512757
}
27522758

27532759
static void cs_dsp_halo_stop_core(struct cs_dsp *dsp)

include/sound/cs35l41.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
#define CS35L41_PROTECT_REL_ERR_IGN 0x00002034
4141
#define CS35L41_GPIO_PAD_CONTROL 0x0000242C
4242
#define CS35L41_JTAG_CONTROL 0x00002438
43+
#define CS35L41_PWRMGT_CTL 0x00002900
44+
#define CS35L41_WAKESRC_CTL 0x00002904
45+
#define CS35L41_PWRMGT_STS 0x00002908
4346
#define CS35L41_PLL_CLK_CTRL 0x00002C04
4447
#define CS35L41_DSP_CLK_CTRL 0x00002C08
4548
#define CS35L41_GLOBAL_CLK_CTRL 0x00002C0C
@@ -635,6 +638,8 @@
635638
#define CS35L41_INPUT_DSP_TX1 0x32
636639
#define CS35L41_INPUT_DSP_TX2 0x33
637640

641+
#define CS35L41_WR_PEND_STS_MASK 0x2
642+
638643
#define CS35L41_PLL_CLK_SEL_MASK 0x07
639644
#define CS35L41_PLL_CLK_SEL_SHIFT 0
640645
#define CS35L41_PLL_CLK_EN_MASK 0x10
@@ -762,6 +767,8 @@ struct cs35l41_otp_map_element_t {
762767
extern struct regmap_config cs35l41_regmap_i2c;
763768
extern struct regmap_config cs35l41_regmap_spi;
764769

770+
int cs35l41_test_key_unlock(struct device *dev, struct regmap *regmap);
771+
int cs35l41_test_key_lock(struct device *dev, struct regmap *regmap);
765772
int cs35l41_otp_unpack(struct device *dev, struct regmap *regmap);
766773
int cs35l41_register_errata_patch(struct device *dev, struct regmap *reg, unsigned int reg_revid);
767774
int cs35l41_set_channels(struct device *dev, struct regmap *reg,

sound/soc/amd/acp/acp-mach-common.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ static const struct snd_soc_ops acp_card_rt5682s_ops = {
293293

294294
/* Declare RT1019 codec components */
295295
SND_SOC_DAILINK_DEF(rt1019,
296-
DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC1019:01", "rt1019-aif"),
297-
COMP_CODEC("i2c-10EC1019:02", "rt1019-aif")));
296+
DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC1019:00", "rt1019-aif"),
297+
COMP_CODEC("i2c-10EC1019:01", "rt1019-aif")));
298298

299299
static const struct snd_soc_dapm_route rt1019_map_lr[] = {
300300
{ "Left Spk", NULL, "Left SPO" },
@@ -303,11 +303,11 @@ static const struct snd_soc_dapm_route rt1019_map_lr[] = {
303303

304304
static struct snd_soc_codec_conf rt1019_conf[] = {
305305
{
306-
.dlc = COMP_CODEC_CONF("i2c-10EC1019:01"),
306+
.dlc = COMP_CODEC_CONF("i2c-10EC1019:00"),
307307
.name_prefix = "Left",
308308
},
309309
{
310-
.dlc = COMP_CODEC_CONF("i2c-10EC1019:02"),
310+
.dlc = COMP_CODEC_CONF("i2c-10EC1019:01"),
311311
.name_prefix = "Right",
312312
},
313313
};

sound/soc/codecs/ak4375.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,6 @@ static int ak4375_power_on(struct ak4375_priv *ak4375)
438438
return 0;
439439
}
440440

441-
#ifdef CONFIG_PM
442441
static int __maybe_unused ak4375_runtime_suspend(struct device *dev)
443442
{
444443
struct ak4375_priv *ak4375 = dev_get_drvdata(dev);
@@ -463,7 +462,6 @@ static int __maybe_unused ak4375_runtime_resume(struct device *dev)
463462

464463
return regcache_sync(ak4375->regmap);
465464
}
466-
#endif /* CONFIG_PM */
467465

468466
static const struct snd_soc_component_driver soc_codec_dev_ak4375 = {
469467
.controls = ak4375_snd_controls,

sound/soc/codecs/cs35l41-i2c.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
static const struct i2c_device_id cs35l41_id_i2c[] = {
2323
{ "cs35l40", 0 },
2424
{ "cs35l41", 0 },
25+
{ "cs35l51", 0 },
26+
{ "cs35l53", 0 },
2527
{}
2628
};
2729

@@ -84,6 +86,7 @@ MODULE_DEVICE_TABLE(acpi, cs35l41_acpi_match);
8486
static struct i2c_driver cs35l41_i2c_driver = {
8587
.driver = {
8688
.name = "cs35l41",
89+
.pm = &cs35l41_pm_ops,
8790
.of_match_table = of_match_ptr(cs35l41_of_match),
8891
.acpi_match_table = ACPI_PTR(cs35l41_acpi_match),
8992
},

sound/soc/codecs/cs35l41-lib.c

Lines changed: 62 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ static const struct reg_default cs35l41_reg[] = {
2020
{ CS35L41_PWR_CTRL2, 0x00000000 },
2121
{ CS35L41_PWR_CTRL3, 0x01000010 },
2222
{ CS35L41_GPIO_PAD_CONTROL, 0x00000000 },
23+
{ CS35L41_GLOBAL_CLK_CTRL, 0x00000003 },
24+
{ CS35L41_TST_FS_MON0, 0x00020016 },
25+
{ CS35L41_BSTCVRT_COEFF, 0x00002424 },
26+
{ CS35L41_BSTCVRT_SLOPE_LBST, 0x00007500 },
27+
{ CS35L41_BSTCVRT_PEAK_CUR, 0x0000004A },
2328
{ CS35L41_SP_ENABLES, 0x00000000 },
2429
{ CS35L41_SP_RATE_CTRL, 0x00000028 },
2530
{ CS35L41_SP_FORMAT, 0x18180200 },
@@ -48,11 +53,16 @@ static const struct reg_default cs35l41_reg[] = {
4853
{ CS35L41_WKFET_CFG, 0x00000111 },
4954
{ CS35L41_NG_CFG, 0x00000033 },
5055
{ CS35L41_AMP_GAIN_CTRL, 0x00000000 },
56+
{ CS35L41_IRQ1_MASK1, 0xFFFFFFFF },
57+
{ CS35L41_IRQ1_MASK2, 0xFFFFFFFF },
58+
{ CS35L41_IRQ1_MASK3, 0xFFFF87FF },
59+
{ CS35L41_IRQ1_MASK4, 0xFEFFFFFF },
5160
{ CS35L41_GPIO1_CTRL1, 0xE1000001 },
5261
{ CS35L41_GPIO2_CTRL1, 0xE1000001 },
5362
{ CS35L41_MIXER_NGATE_CFG, 0x00000000 },
5463
{ CS35L41_MIXER_NGATE_CH1_CFG, 0x00000303 },
5564
{ CS35L41_MIXER_NGATE_CH2_CFG, 0x00000303 },
65+
{ CS35L41_DSP1_CCM_CORE_CTRL, 0x00000101 },
5666
};
5767

5868
static bool cs35l41_readable_reg(struct device *dev, unsigned int reg)
@@ -80,10 +90,14 @@ static bool cs35l41_readable_reg(struct device *dev, unsigned int reg)
8090
case CS35L41_PROTECT_REL_ERR_IGN:
8191
case CS35L41_GPIO_PAD_CONTROL:
8292
case CS35L41_JTAG_CONTROL:
93+
case CS35L41_PWRMGT_CTL:
94+
case CS35L41_WAKESRC_CTL:
95+
case CS35L41_PWRMGT_STS:
8396
case CS35L41_PLL_CLK_CTRL:
8497
case CS35L41_DSP_CLK_CTRL:
8598
case CS35L41_GLOBAL_CLK_CTRL:
8699
case CS35L41_DATA_FS_SEL:
100+
case CS35L41_TST_FS_MON0:
87101
case CS35L41_MDSYNC_EN:
88102
case CS35L41_MDSYNC_TX_ID:
89103
case CS35L41_MDSYNC_PWR_CTRL:
@@ -342,7 +356,10 @@ static bool cs35l41_readable_reg(struct device *dev, unsigned int reg)
342356
static bool cs35l41_precious_reg(struct device *dev, unsigned int reg)
343357
{
344358
switch (reg) {
359+
case CS35L41_TEST_KEY_CTL:
360+
case CS35L41_USER_KEY_CTL:
345361
case CS35L41_OTP_MEM0 ... CS35L41_OTP_MEM31:
362+
case CS35L41_TST_FS_MON0:
346363
case CS35L41_DSP1_XMEM_PACK_0 ... CS35L41_DSP1_XMEM_PACK_3068:
347364
case CS35L41_DSP1_YMEM_PACK_0 ... CS35L41_DSP1_YMEM_PACK_1532:
348365
case CS35L41_DSP1_PMEM_0 ... CS35L41_DSP1_PMEM_5114:
@@ -359,6 +376,12 @@ static bool cs35l41_volatile_reg(struct device *dev, unsigned int reg)
359376
case CS35L41_SFT_RESET:
360377
case CS35L41_FABID:
361378
case CS35L41_REVID:
379+
case CS35L41_OTPID:
380+
case CS35L41_TEST_KEY_CTL:
381+
case CS35L41_USER_KEY_CTL:
382+
case CS35L41_PWRMGT_CTL:
383+
case CS35L41_WAKESRC_CTL:
384+
case CS35L41_PWRMGT_STS:
362385
case CS35L41_DTEMP_EN:
363386
case CS35L41_IRQ1_STATUS:
364387
case CS35L41_IRQ1_STATUS1:
@@ -369,17 +392,6 @@ static bool cs35l41_volatile_reg(struct device *dev, unsigned int reg)
369392
case CS35L41_IRQ1_RAW_STATUS2:
370393
case CS35L41_IRQ1_RAW_STATUS3:
371394
case CS35L41_IRQ1_RAW_STATUS4:
372-
case CS35L41_IRQ1_FRC1:
373-
case CS35L41_IRQ1_FRC2:
374-
case CS35L41_IRQ1_FRC3:
375-
case CS35L41_IRQ1_FRC4:
376-
case CS35L41_IRQ1_EDGE1:
377-
case CS35L41_IRQ1_EDGE4:
378-
case CS35L41_IRQ1_POL1:
379-
case CS35L41_IRQ1_POL2:
380-
case CS35L41_IRQ1_POL3:
381-
case CS35L41_IRQ1_POL4:
382-
case CS35L41_IRQ1_DB3:
383395
case CS35L41_IRQ2_STATUS:
384396
case CS35L41_IRQ2_STATUS1:
385397
case CS35L41_IRQ2_STATUS2:
@@ -389,54 +401,7 @@ static bool cs35l41_volatile_reg(struct device *dev, unsigned int reg)
389401
case CS35L41_IRQ2_RAW_STATUS2:
390402
case CS35L41_IRQ2_RAW_STATUS3:
391403
case CS35L41_IRQ2_RAW_STATUS4:
392-
case CS35L41_IRQ2_FRC1:
393-
case CS35L41_IRQ2_FRC2:
394-
case CS35L41_IRQ2_FRC3:
395-
case CS35L41_IRQ2_FRC4:
396-
case CS35L41_IRQ2_EDGE1:
397-
case CS35L41_IRQ2_EDGE4:
398-
case CS35L41_IRQ2_POL1:
399-
case CS35L41_IRQ2_POL2:
400-
case CS35L41_IRQ2_POL3:
401-
case CS35L41_IRQ2_POL4:
402-
case CS35L41_IRQ2_DB3:
403404
case CS35L41_GPIO_STATUS1:
404-
case CS35L41_OTP_TRIM_1:
405-
case CS35L41_OTP_TRIM_2:
406-
case CS35L41_OTP_TRIM_3:
407-
case CS35L41_OTP_TRIM_4:
408-
case CS35L41_OTP_TRIM_5:
409-
case CS35L41_OTP_TRIM_6:
410-
case CS35L41_OTP_TRIM_7:
411-
case CS35L41_OTP_TRIM_8:
412-
case CS35L41_OTP_TRIM_9:
413-
case CS35L41_OTP_TRIM_10:
414-
case CS35L41_OTP_TRIM_11:
415-
case CS35L41_OTP_TRIM_12:
416-
case CS35L41_OTP_TRIM_13:
417-
case CS35L41_OTP_TRIM_14:
418-
case CS35L41_OTP_TRIM_15:
419-
case CS35L41_OTP_TRIM_16:
420-
case CS35L41_OTP_TRIM_17:
421-
case CS35L41_OTP_TRIM_18:
422-
case CS35L41_OTP_TRIM_19:
423-
case CS35L41_OTP_TRIM_20:
424-
case CS35L41_OTP_TRIM_21:
425-
case CS35L41_OTP_TRIM_22:
426-
case CS35L41_OTP_TRIM_23:
427-
case CS35L41_OTP_TRIM_24:
428-
case CS35L41_OTP_TRIM_25:
429-
case CS35L41_OTP_TRIM_26:
430-
case CS35L41_OTP_TRIM_27:
431-
case CS35L41_OTP_TRIM_28:
432-
case CS35L41_OTP_TRIM_29:
433-
case CS35L41_OTP_TRIM_30:
434-
case CS35L41_OTP_TRIM_31:
435-
case CS35L41_OTP_TRIM_32:
436-
case CS35L41_OTP_TRIM_33:
437-
case CS35L41_OTP_TRIM_34:
438-
case CS35L41_OTP_TRIM_35:
439-
case CS35L41_OTP_TRIM_36:
440405
case CS35L41_DSP_MBOX_1 ... CS35L41_DSP_VIRT2_MBOX_8:
441406
case CS35L41_DSP1_XMEM_PACK_0 ... CS35L41_DSP1_XMEM_PACK_3068:
442407
case CS35L41_DSP1_XMEM_UNPACK32_0 ... CS35L41_DSP1_XMEM_UNPACK32_2046:
@@ -445,7 +410,11 @@ static bool cs35l41_volatile_reg(struct device *dev, unsigned int reg)
445410
case CS35L41_DSP1_YMEM_UNPACK32_0 ... CS35L41_DSP1_YMEM_UNPACK32_1022:
446411
case CS35L41_DSP1_YMEM_UNPACK24_0 ... CS35L41_DSP1_YMEM_UNPACK24_2045:
447412
case CS35L41_DSP1_PMEM_0 ... CS35L41_DSP1_PMEM_5114:
448-
case CS35L41_DSP1_CCM_CORE_CTRL ... CS35L41_DSP1_WDT_STATUS:
413+
case CS35L41_DSP1_SCRATCH1:
414+
case CS35L41_DSP1_SCRATCH2:
415+
case CS35L41_DSP1_SCRATCH3:
416+
case CS35L41_DSP1_SCRATCH4:
417+
case CS35L41_DSP1_CCM_CLK_OVERRIDE ... CS35L41_DSP1_WDT_STATUS:
449418
case CS35L41_OTP_MEM0 ... CS35L41_OTP_MEM31:
450419
return true;
451420
default:
@@ -660,8 +629,6 @@ static const struct cs35l41_otp_packed_element_t otp_map_2[CS35L41_NUM_OTP_ELEM]
660629
};
661630

662631
static const struct reg_sequence cs35l41_reva0_errata_patch[] = {
663-
{ 0x00000040, 0x00005555 },
664-
{ 0x00000040, 0x0000AAAA },
665632
{ 0x00003854, 0x05180240 },
666633
{ CS35L41_VIMON_SPKMON_RESYNC, 0x00000000 },
667634
{ 0x00004310, 0x00000000 },
@@ -674,38 +641,28 @@ static const struct reg_sequence cs35l41_reva0_errata_patch[] = {
674641
{ CS35L41_IRQ2_DB3, 0x00000000 },
675642
{ CS35L41_DSP1_YM_ACCEL_PL0_PRI, 0x00000000 },
676643
{ CS35L41_DSP1_XM_ACCEL_PL0_PRI, 0x00000000 },
677-
{ 0x00000040, 0x0000CCCC },
678-
{ 0x00000040, 0x00003333 },
679644
{ CS35L41_PWR_CTRL2, 0x00000000 },
680645
{ CS35L41_AMP_GAIN_CTRL, 0x00000000 },
681646
};
682647

683648
static const struct reg_sequence cs35l41_revb0_errata_patch[] = {
684-
{ 0x00000040, 0x00005555 },
685-
{ 0x00000040, 0x0000AAAA },
686649
{ CS35L41_VIMON_SPKMON_RESYNC, 0x00000000 },
687650
{ 0x00004310, 0x00000000 },
688651
{ CS35L41_VPVBST_FS_SEL, 0x00000000 },
689652
{ CS35L41_BSTCVRT_DCM_CTRL, 0x00000051 },
690653
{ CS35L41_DSP1_YM_ACCEL_PL0_PRI, 0x00000000 },
691654
{ CS35L41_DSP1_XM_ACCEL_PL0_PRI, 0x00000000 },
692-
{ 0x00000040, 0x0000CCCC },
693-
{ 0x00000040, 0x00003333 },
694655
{ CS35L41_PWR_CTRL2, 0x00000000 },
695656
{ CS35L41_AMP_GAIN_CTRL, 0x00000000 },
696657
};
697658

698659
static const struct reg_sequence cs35l41_revb2_errata_patch[] = {
699-
{ 0x00000040, 0x00005555 },
700-
{ 0x00000040, 0x0000AAAA },
701660
{ CS35L41_VIMON_SPKMON_RESYNC, 0x00000000 },
702661
{ 0x00004310, 0x00000000 },
703662
{ CS35L41_VPVBST_FS_SEL, 0x00000000 },
704663
{ CS35L41_BSTCVRT_DCM_CTRL, 0x00000051 },
705664
{ CS35L41_DSP1_YM_ACCEL_PL0_PRI, 0x00000000 },
706665
{ CS35L41_DSP1_XM_ACCEL_PL0_PRI, 0x00000000 },
707-
{ 0x00000040, 0x0000CCCC },
708-
{ 0x00000040, 0x00003333 },
709666
{ CS35L41_PWR_CTRL2, 0x00000000 },
710667
{ CS35L41_AMP_GAIN_CTRL, 0x00000000 },
711668
};
@@ -793,6 +750,39 @@ static const struct cs35l41_otp_map_element_t *cs35l41_find_otp_map(u32 otp_id)
793750
return NULL;
794751
}
795752

753+
int cs35l41_test_key_unlock(struct device *dev, struct regmap *regmap)
754+
{
755+
static const struct reg_sequence unlock[] = {
756+
{ CS35L41_TEST_KEY_CTL, 0x00000055 },
757+
{ CS35L41_TEST_KEY_CTL, 0x000000AA },
758+
};
759+
int ret;
760+
761+
ret = regmap_multi_reg_write(regmap, unlock, ARRAY_SIZE(unlock));
762+
if (ret)
763+
dev_err(dev, "Failed to unlock test key: %d\n", ret);
764+
765+
return ret;
766+
}
767+
EXPORT_SYMBOL_GPL(cs35l41_test_key_unlock);
768+
769+
int cs35l41_test_key_lock(struct device *dev, struct regmap *regmap)
770+
{
771+
static const struct reg_sequence unlock[] = {
772+
{ CS35L41_TEST_KEY_CTL, 0x000000CC },
773+
{ CS35L41_TEST_KEY_CTL, 0x00000033 },
774+
};
775+
int ret;
776+
777+
ret = regmap_multi_reg_write(regmap, unlock, ARRAY_SIZE(unlock));
778+
if (ret)
779+
dev_err(dev, "Failed to lock test key: %d\n", ret);
780+
781+
return ret;
782+
}
783+
EXPORT_SYMBOL_GPL(cs35l41_test_key_lock);
784+
785+
/* Must be called with the TEST_KEY unlocked */
796786
int cs35l41_otp_unpack(struct device *dev, struct regmap *regmap)
797787
{
798788
const struct cs35l41_otp_map_element_t *otp_map_match;
@@ -831,17 +821,6 @@ int cs35l41_otp_unpack(struct device *dev, struct regmap *regmap)
831821
bit_offset = otp_map_match->bit_offset;
832822
word_offset = otp_map_match->word_offset;
833823

834-
ret = regmap_write(regmap, CS35L41_TEST_KEY_CTL, 0x00000055);
835-
if (ret) {
836-
dev_err(dev, "Write Unlock key failed 1/2: %d\n", ret);
837-
goto err_otp_unpack;
838-
}
839-
ret = regmap_write(regmap, CS35L41_TEST_KEY_CTL, 0x000000AA);
840-
if (ret) {
841-
dev_err(dev, "Write Unlock key failed 2/2: %d\n", ret);
842-
goto err_otp_unpack;
843-
}
844-
845824
for (i = 0; i < otp_map_match->num_elements; i++) {
846825
dev_dbg(dev, "bitoffset= %d, word_offset=%d, bit_sum mod 32=%d\n",
847826
bit_offset, word_offset, bit_sum % 32);
@@ -877,16 +856,6 @@ int cs35l41_otp_unpack(struct device *dev, struct regmap *regmap)
877856
}
878857
}
879858

880-
ret = regmap_write(regmap, CS35L41_TEST_KEY_CTL, 0x000000CC);
881-
if (ret) {
882-
dev_err(dev, "Write Lock key failed 1/2: %d\n", ret);
883-
goto err_otp_unpack;
884-
}
885-
ret = regmap_write(regmap, CS35L41_TEST_KEY_CTL, 0x00000033);
886-
if (ret) {
887-
dev_err(dev, "Write Lock key failed 2/2: %d\n", ret);
888-
goto err_otp_unpack;
889-
}
890859
ret = 0;
891860

892861
err_otp_unpack:
@@ -896,6 +865,7 @@ int cs35l41_otp_unpack(struct device *dev, struct regmap *regmap)
896865
}
897866
EXPORT_SYMBOL_GPL(cs35l41_otp_unpack);
898867

868+
/* Must be called with the TEST_KEY unlocked */
899869
int cs35l41_register_errata_patch(struct device *dev, struct regmap *reg, unsigned int reg_revid)
900870
{
901871
char *rev;

0 commit comments

Comments
 (0)