diff --git a/Documentation/devicetree/bindings/sound/ti,tas2770.yaml b/Documentation/devicetree/bindings/sound/ti,tas2770.yaml index 48639192c075b..a5ed3dfdb2b34 100644 --- a/Documentation/devicetree/bindings/sound/ti,tas2770.yaml +++ b/Documentation/devicetree/bindings/sound/ti,tas2770.yaml @@ -18,6 +18,15 @@ description: | allOf: - $ref: dai-common.yaml# + - if: + properties: + compatible: + not: + contains: + const: ti,tas5770l + then: + properties: + apple,speaker-config: false properties: compatible: @@ -45,6 +54,16 @@ properties: interrupts: maxItems: 1 + apple,speaker-config: + $ref: /schemas/types.yaml#/definitions/uint8-array + minItems: 4 + maxItems: 4 + description: + This amplifier's speaker-config row from Apple's device tree, copied + by the bootloader. The second byte specifies the analog operating + gain. The other bytes are RX and sense slot selections in the source + format. Linux uses its own DAI and sense-slot properties for routing. + ti,imon-slot-no: $ref: /schemas/types.yaml#/definitions/uint32 description: TDM TX current sense time slot. diff --git a/sound/soc/apple/macaudio-amp-level-test.h b/sound/soc/apple/macaudio-amp-level-test.h index 7a6511c7c15ee..cae88325c2e73 100644 --- a/sound/soc/apple/macaudio-amp-level-test.h +++ b/sound/soc/apple/macaudio-amp-level-test.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * KUnit tests of the SN012776 amp levels: each amp's level is the second byte + * KUnit tests of the SN012776 and TAS5770L amp levels: each amp's level is the second byte * of its apple,speaker-config, which the boot loader copies from the Mac's * ADT, and the speakers stay off when any amp lacks it, or under a fixed * ceiling when any amp has another level than the ceiling was computed for. @@ -22,7 +22,7 @@ static bool macaudio_level_test_present(struct kunit *test, struct device *dev, const struct macaudio_platform_cfg *cfg, const char *name) { - return macaudio_sn012776_levels_present(dev, cfg, macaudio_level_test_node(test, name)); + return macaudio_amp_level_count(dev, cfg, macaudio_level_test_node(test, name)) > 0; } /* The level is the row's second byte, its low five bits */ @@ -83,8 +83,16 @@ static void macaudio_levels_fixed_ceiling(struct kunit *test) "macaudio-kunit-codec-good")); KUNIT_EXPECT_FALSE(test, macaudio_level_test_present(test, dev, cfg, "macaudio-kunit-codec-one-missing")); - KUNIT_EXPECT_FALSE(test, macaudio_sn012776_level_allowed(cfg, 14)); - KUNIT_EXPECT_FALSE(test, macaudio_sn012776_level_allowed(cfg, 16)); + KUNIT_EXPECT_FALSE(test, macaudio_amp_level_allowed(cfg, 14)); + KUNIT_EXPECT_FALSE(test, macaudio_amp_level_allowed(cfg, 16)); +} + +static void macaudio_tas_level_from_row(struct kunit *test) +{ + KUNIT_EXPECT_EQ(test, macaudio_tas5770_level( + macaudio_level_test_node(test, "macaudio-kunit-tas-a")), 4); + KUNIT_EXPECT_EQ(test, macaudio_tas5770_level( + macaudio_level_test_node(test, "macaudio-kunit-tas-b")), 14); } /* A v2-only SN012776 machine also requires DC-blocker config from the boot loader */ @@ -104,23 +112,29 @@ static void macaudio_levels_v2_only_requires_dcblocker(struct kunit *test) "macaudio-kunit-codec-v2-no-dcblk")); } -/* No board table carries an SN012776 gain any more */ -static void macaudio_level_no_table(struct kunit *test) +static void macaudio_tas_level_rejects(struct kunit *test) { - const struct macaudio_platform_cfg *cfgs[] = { - &macaudio_j180_cfg, &macaudio_j314_cfg, &macaudio_j316_cfg, - &macaudio_j37x_j47x_cfg, &macaudio_j413_cfg, &macaudio_j415_cfg, - &macaudio_j493_cfg, &macaudio_j575c_j773_cfg, &macaudio_j604_cfg, - &macaudio_j614_cfg, &macaudio_j616_cfg, &macaudio_j713_cfg, - &macaudio_j714_cfg, &macaudio_j715_cfg, &macaudio_j716_cfg, - &macaudio_j813_cfg, &macaudio_j775_cfg, &macaudio_j873_cfg, - }; - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(cfgs); i++) { - KUNIT_EXPECT_EQ(test, cfgs[i]->amp, AMP_SN012776); - KUNIT_EXPECT_EQ(test, cfgs[i]->amp_gain, 0); - } + KUNIT_EXPECT_EQ(test, macaudio_tas5770_level( + macaudio_level_test_node(test, "macaudio-kunit-tas-zero")), -ERANGE); + KUNIT_EXPECT_EQ(test, macaudio_tas5770_level( + macaudio_level_test_node(test, "macaudio-kunit-tas-high")), -ERANGE); + KUNIT_EXPECT_EQ(test, macaudio_tas5770_level( + macaudio_level_test_node(test, "macaudio-kunit-tas-short")), -ENOENT); + KUNIT_EXPECT_EQ(test, macaudio_tas5770_level( + macaudio_level_test_node(test, "macaudio-kunit-tas-none")), -ENOENT); +} + +static void macaudio_tas_levels_every_amp(struct kunit *test) +{ + struct device *dev = kunit_kzalloc(test, sizeof(*dev), GFP_KERNEL); + + KUNIT_ASSERT_NOT_NULL(test, dev); + KUNIT_EXPECT_TRUE(test, macaudio_level_test_present(test, dev, &macaudio_j313_cfg, + "macaudio-kunit-tas-codec-good")); + KUNIT_EXPECT_FALSE(test, macaudio_level_test_present(test, dev, &macaudio_j313_cfg, + "macaudio-kunit-tas-codec-missing")); + KUNIT_EXPECT_FALSE(test, macaudio_level_test_present(test, dev, &macaudio_j313_cfg, + "macaudio-kunit-tas-codec-wrong")); } static int macaudio_level_test_init(struct kunit *test) @@ -133,8 +147,10 @@ static struct kunit_case macaudio_level_cases[] = { KUNIT_CASE(macaudio_level_rejects), KUNIT_CASE(macaudio_levels_every_amp), KUNIT_CASE(macaudio_levels_fixed_ceiling), + KUNIT_CASE(macaudio_tas_level_from_row), + KUNIT_CASE(macaudio_tas_level_rejects), + KUNIT_CASE(macaudio_tas_levels_every_amp), KUNIT_CASE(macaudio_levels_v2_only_requires_dcblocker), - KUNIT_CASE(macaudio_level_no_table), {} }; diff --git a/sound/soc/apple/macaudio-kunit.dtso b/sound/soc/apple/macaudio-kunit.dtso index 14ff3a9f14135..59481b0dc0d84 100644 --- a/sound/soc/apple/macaudio-kunit.dtso +++ b/sound/soc/apple/macaudio-kunit.dtso @@ -66,6 +66,53 @@ sound-dai = <&ma_amp_a>; }; + ma_tas_a: macaudio-kunit-tas-a { + compatible = "ti,tas5770l", "ti,tas2770"; + #sound-dai-cells = <0>; + apple,speaker-config = [00 04 00 00]; + }; + + ma_tas_b: macaudio-kunit-tas-b { + compatible = "ti,tas5770l", "ti,tas2770"; + #sound-dai-cells = <0>; + apple,speaker-config = [01 0e 00 00]; + }; + + ma_tas_zero: macaudio-kunit-tas-zero { + compatible = "ti,tas5770l", "ti,tas2770"; + #sound-dai-cells = <0>; + apple,speaker-config = [00 00 00 00]; + }; + + ma_tas_high: macaudio-kunit-tas-high { + compatible = "ti,tas5770l", "ti,tas2770"; + #sound-dai-cells = <0>; + apple,speaker-config = [00 1f 00 00]; + }; + + ma_tas_short: macaudio-kunit-tas-short { + compatible = "ti,tas5770l", "ti,tas2770"; + #sound-dai-cells = <0>; + apple,speaker-config = [00 04 00]; + }; + + ma_tas_none: macaudio-kunit-tas-none { + compatible = "ti,tas5770l", "ti,tas2770"; + #sound-dai-cells = <0>; + }; + + macaudio-kunit-tas-codec-good { + sound-dai = <&ma_tas_a>, <&ma_tas_b>; + }; + + macaudio-kunit-tas-codec-missing { + sound-dai = <&ma_tas_a>, <&ma_tas_none>; + }; + + macaudio-kunit-tas-codec-wrong { + sound-dai = <&ma_tas_a>, <&ma_amp_a>; + }; + macaudio-kunit-codec-v2-good { sound-dai = <&ma_amp_dcblk_a>; }; diff --git a/sound/soc/apple/macaudio.c b/sound/soc/apple/macaudio.c index e80c5a64b0265..b24da94656bbf 100644 --- a/sound/soc/apple/macaudio.c +++ b/sound/soc/apple/macaudio.c @@ -44,6 +44,8 @@ #include #include +#include "../codecs/tas2770.h" + #define DRIVER_NAME "snd-soc-macaudio" /* @@ -122,8 +124,6 @@ struct macaudio_platform_cfg { enum macaudio_amp_type amp; enum macaudio_spkr_config speakers; bool stereo; - /* The amps' highest gain ("Amp Gain Volume"); not for the SN012776 */ - int amp_gain; int safe_vol; /* * The speaker codec's output widget, "OUT" (the TAS and SSM @@ -270,6 +270,7 @@ struct macaudio_snd_data { bool has_speakers; bool has_sense; bool has_safety; + int tas_amp_count; unsigned int max_channels; struct gpio_descs *speaker_id_gpios; @@ -2517,48 +2518,70 @@ static bool macaudio_speakers_allowed(const struct macaudio_platform_cfg *cfg) } /* - * An SN012776's operating level: the second byte of its apple,speaker-config, - * the amp's row of its group's speaker-config in the Mac's ADT, which the - * boot loader copies to the amp's node. Only its low five bits are the level. + * The loader exports each amp's four-byte row of the Mac's ADT + * speaker-config. The row's second byte carries the operating gain. */ -#define SN012776_ROW_LEN 4 -#define SN012776_ROW_LEVEL 1 +#define MACAUDIO_AMP_ROW_LEN 4 +#define MACAUDIO_AMP_ROW_LEVEL 1 #define SN012776_LEVEL_MASK 0x1f /* The highest level the amp's "Amp Gain Volume" takes */ #define SN012776_LEVEL_MAX 0x14 -static int macaudio_sn012776_level(struct device_node *amp) +static int macaudio_amp_level_byte(struct device_node *amp) { - u8 row[SN012776_ROW_LEN]; - int level; + u8 row[MACAUDIO_AMP_ROW_LEN]; - if (of_property_count_u8_elems(amp, "apple,speaker-config") != SN012776_ROW_LEN || - of_property_read_u8_array(amp, "apple,speaker-config", row, SN012776_ROW_LEN)) + if (of_property_count_u8_elems(amp, "apple,speaker-config") != MACAUDIO_AMP_ROW_LEN || + of_property_read_u8_array(amp, "apple,speaker-config", row, sizeof(row))) return -ENOENT; - level = row[SN012776_ROW_LEVEL] & SN012776_LEVEL_MASK; + return row[MACAUDIO_AMP_ROW_LEVEL]; +} + +static int macaudio_sn012776_level(struct device_node *amp) +{ + int level = macaudio_amp_level_byte(amp); + + if (level < 0) + return level; + + level &= SN012776_LEVEL_MASK; return level <= SN012776_LEVEL_MAX ? level : -ERANGE; } +static int macaudio_tas5770_level(struct device_node *amp) +{ + int level; + + if (!of_device_is_compatible(amp, "ti,tas5770l")) + return -EINVAL; + + level = macaudio_amp_level_byte(amp); + if (level < 0) + return level; + + /* ASoC uses a zero platform maximum to mean no limit. */ + return level > 0 && level <= TAS2770_AMP_GAIN_MAX ? level : -ERANGE; +} + /* * A fixed ceiling holds only at the amp level it was computed for. */ -static bool macaudio_sn012776_level_allowed(const struct macaudio_platform_cfg *cfg, - int level) +static bool macaudio_amp_level_allowed(const struct macaudio_platform_cfg *cfg, int level) { return level >= 0 && (!cfg->spk_fixed_ceiling || level == cfg->spk_ceiling_level); } /* - * Speakers on SN012776 amps run only when every amp has its level from the - * Mac, and under a fixed ceiling only at the level that ceiling was computed - * for; on a v2-only machine every amp also requires its DC-blocker setting - * from the boot loader. Otherwise the speakers stay off while the jack stays - * available. + * Speakers on SN012776 or TAS5770L amps run only when every amp has its + * level from the Mac. A fixed ceiling also requires the level it was + * computed for, and on a v2-only machine every amp also requires its + * DC-blocker setting from the boot loader. Otherwise the speakers stay off + * while the jack stays available. */ -static bool macaudio_sn012776_levels_present(struct device *dev, - const struct macaudio_platform_cfg *cfg, - struct device_node *codec) +static int macaudio_amp_level_count(struct device *dev, + const struct macaudio_platform_cfg *cfg, + struct device_node *codec) { struct of_phandle_args args; int i, n, level; @@ -2569,12 +2592,13 @@ static bool macaudio_sn012776_levels_present(struct device *dev, if (of_parse_phandle_with_args(codec, "sound-dai", "#sound-dai-cells", i, &args)) - return false; - level = macaudio_sn012776_level(args.np); - ok = macaudio_sn012776_level_allowed(cfg, level); + return 0; + level = cfg->amp == AMP_TAS5770 ? macaudio_tas5770_level(args.np) : + macaudio_sn012776_level(args.np); + ok = level >= 0 && macaudio_amp_level_allowed(cfg, level); if (level < 0) dev_err(dev, "%pOF: %s amp level from the boot loader\n", args.np, - level == -ENOENT ? "no" : "out-of-range"); + level == -ENOENT ? "no" : "invalid"); else if (!ok) dev_err(dev, "%pOF: amp level %d, the fixed ceiling holds only at %d\n", args.np, level, cfg->spk_ceiling_level); @@ -2586,27 +2610,30 @@ static bool macaudio_sn012776_levels_present(struct device *dev, dev_info(dev, "%pOF: amp level %d from the boot loader\n", args.np, level); of_node_put(args.np); if (!ok) - return false; + return 0; } - return n > 0; + return n > 0 ? n : 0; } /* - * Every SN012776's "Amp Gain Volume" ends at its own level; the lease fixes - * it there (macaudio_spk_fix_amp_gains()). + * Each amp's "Amp Gain Volume" ends at its own level from the ADT. The + * lease fixes it there (macaudio_spk_fix_amp_gains()). */ -static int macaudio_limit_sn012776_levels(struct snd_soc_card *card) +static int macaudio_limit_amp_levels(struct snd_soc_card *card) { + struct macaudio_snd_data *ma = snd_soc_card_get_drvdata(card); struct snd_soc_component *component; char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; - int level, ret; + bool tas = ma->cfg->amp == AMP_TAS5770; + const char *compatible = tas ? "ti,tas5770l" : "ti,sn012776"; + int count = 0, level, ret; for_each_card_components(card, component) { struct device_node *np = component->dev->of_node; - if (!np || !of_device_is_compatible(np, "ti,sn012776")) + if (!np || !of_device_is_compatible(np, compatible)) continue; - level = macaudio_sn012776_level(np); + level = tas ? macaudio_tas5770_level(np) : macaudio_sn012776_level(np); if (level < 0) return dev_err_probe(card->dev, level, "%pOF: no amp level\n", np); snprintf(name, sizeof(name), "%s%sAmp Gain Volume", @@ -2616,7 +2643,12 @@ static int macaudio_limit_sn012776_levels(struct snd_soc_card *card) if (ret != 1) return dev_err_probe(card->dev, ret < 0 ? ret : -EINVAL, "limit on '%s': %d\n", name, ret); + count++; } + if (tas && count != ma->tas_amp_count) + return dev_err_probe(card->dev, -EINVAL, + "restricted %d of %d TAS amp gains\n", + count, ma->tas_amp_count); return 0; } @@ -2822,17 +2854,18 @@ static int macaudio_parse_of(struct macaudio_snd_data *ma) dev_err(card->dev, "driver can't assure safety on this model, disabling speakers\n"); continue; } - if (ma->cfg->amp == AMP_SN012776) { + if (ma->cfg->amp == AMP_SN012776 || ma->cfg->amp == AMP_TAS5770) { struct device_node *spk_codec = of_get_child_by_name(np, "codec"); - bool levels = spk_codec && - macaudio_sn012776_levels_present(card->dev, ma->cfg, - spk_codec); + int levels = spk_codec ? + macaudio_amp_level_count(card->dev, ma->cfg, spk_codec) : 0; of_node_put(spk_codec); if (!levels) { dev_err(card->dev, "no usable amp configuration from the boot loader, disabling speakers\n"); continue; } + if (ma->cfg->amp == AMP_TAS5770) + ma->tas_amp_count = levels; } ma->has_speakers = 1; if (ma->cfg->amp != AMP_SSM3515 && @@ -3912,8 +3945,6 @@ static int macaudio_set_speaker(struct snd_soc_card *card, const char *prefix, b case AMP_TAS5770: if (ma->cfg->stereo) CHECK_CONCAT(macaudio_set_fixed_enum, "ASI1 Sel", "Left"); - - CHECK_CONCAT(snd_soc_limit_volume, "Amp Gain Volume", ma->cfg->amp_gain); break; case AMP_SN012776: if (ma->cfg->stereo) @@ -3921,7 +3952,7 @@ static int macaudio_set_speaker(struct snd_soc_card *card, const char *prefix, b /* * Each amp's gain ends at its level from the Mac's ADT - * (macaudio_limit_sn012776_levels()). The tweeters' playback + * (macaudio_limit_amp_levels()). The tweeters' playback * high-pass starts at the codec's highest corner frequency; * the woofers keep the corner the amps were given from the ADT. */ @@ -3975,8 +4006,8 @@ static int macaudio_fixup_controls(struct snd_soc_card *card) macaudio_protect_sense(card); - if (ma->cfg->amp == AMP_SN012776) { - int ret = macaudio_limit_sn012776_levels(card); + if (ma->cfg->amp == AMP_SN012776 || ma->cfg->amp == AMP_TAS5770) { + int ret = macaudio_limit_amp_levels(card); if (ret) return ret; @@ -4366,24 +4397,24 @@ static const struct snd_soc_dapm_route macaudio_dapm_routes[] = { }; /* - * enable amp speakers stereo gain safe_vol + * enable amp speakers stereo safe_vol * - * An SN012776's gain is not here: each amp's operating level comes from the - * Mac's ADT, through the amp's apple,speaker-config. + * Each SN012776 or TAS5770L operating gain comes from the Mac's ADT, + * through the amp's apple,speaker-config. */ struct macaudio_platform_cfg macaudio_j180_cfg = { - false, AMP_SN012776, SPKR_1W1T, false, 0, -20, + false, AMP_SN012776, SPKR_1W1T, false, -20, }; struct macaudio_platform_cfg macaudio_j274_cfg = { - true, AMP_TAS5770, SPKR_1W, false, 20, -20, + true, AMP_TAS5770, SPKR_1W, false, -20, }; struct macaudio_platform_cfg macaudio_j293_cfg = { - true, AMP_TAS5770, SPKR_2W, true, 15, -20, + true, AMP_TAS5770, SPKR_2W, true, -20, }; struct macaudio_platform_cfg macaudio_j313_cfg = { - true, AMP_TAS5770, SPKR_1W, true, 10, -20, + true, AMP_TAS5770, SPKR_1W, true, -20, }; /* @@ -4584,35 +4615,35 @@ struct macaudio_platform_cfg macaudio_j815_cfg = { }; struct macaudio_platform_cfg macaudio_j314_cfg = { - true, AMP_SN012776, SPKR_2W1T, true, 0, -20, + true, AMP_SN012776, SPKR_2W1T, true, -20, }; /* Granted, the tweeters restore their DT corner (see tweeter_hpf_granted) */ struct macaudio_platform_cfg macaudio_j316_cfg = { - true, AMP_SN012776, SPKR_2W1T, true, 0, -20, + true, AMP_SN012776, SPKR_2W1T, true, -20, .tweeter_hpf_granted = true, }; struct macaudio_platform_cfg macaudio_j37x_j47x_cfg = { - true, AMP_SN012776, SPKR_1W, false, 0, -20, + true, AMP_SN012776, SPKR_1W, false, -20, }; /* Granted, the tweeters restore their DT corner (see tweeter_hpf_granted) */ struct macaudio_platform_cfg macaudio_j413_cfg = { - true, AMP_SN012776, SPKR_1W1T, true, 0, -20, + true, AMP_SN012776, SPKR_1W1T, true, -20, .tweeter_hpf_granted = true, }; struct macaudio_platform_cfg macaudio_j415_cfg = { - true, AMP_SN012776, SPKR_2W1T, true, 0, -20, + true, AMP_SN012776, SPKR_2W1T, true, -20, }; struct macaudio_platform_cfg macaudio_j45x_cfg = { - false, AMP_SSM3515, SPKR_1W1T, true, 9, -20, /* TODO: gain?? */ + false, AMP_SSM3515, SPKR_1W1T, true, -20, }; struct macaudio_platform_cfg macaudio_j493_cfg = { - true, AMP_SN012776, SPKR_2W, true, 0, -20, + true, AMP_SN012776, SPKR_2W, true, -20, }; /* @@ -4788,7 +4819,7 @@ struct macaudio_platform_cfg macaudio_j616_jack_cfg = { }; struct macaudio_platform_cfg macaudio_fallback_cfg = { - false, AMP_NONE, SPKR_NONE, false, 0, 0, + false, AMP_NONE, SPKR_NONE, false, 0, }; /* diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c index 07fa6ddab4e07..f6c4e9a07ac7e 100644 --- a/sound/soc/codecs/tas2770.c +++ b/sound/soc/codecs/tas2770.c @@ -784,11 +784,14 @@ static void tas2770_codec_remove(struct snd_soc_component *component) static DECLARE_TLV_DB_SCALE(tas2770_digital_tlv, 1100, 50, 0); static DECLARE_TLV_DB_SCALE(tas2770_playback_volume, -10050, 50, 0); +enum { TAS2770_AMP_GAIN_CONTROL = 1 }; + static const struct snd_kcontrol_new tas2770_snd_controls[] = { SOC_SINGLE_TLV("Speaker Playback Volume", TAS2770_PLAY_CFG_REG2, 0, TAS2770_PLAY_CFG_REG2_VMAX, 1, tas2770_playback_volume), - SOC_SINGLE_TLV("Amp Gain Volume", TAS2770_PLAY_CFG_REG0, 0, 0x14, 0, - tas2770_digital_tlv), + [TAS2770_AMP_GAIN_CONTROL] = SOC_SINGLE_TLV("Amp Gain Volume", TAS2770_PLAY_CFG_REG0, + 0, TAS2770_AMP_GAIN_MAX, 0, + tas2770_digital_tlv), }; static const struct snd_soc_component_driver soc_component_driver_tas2770 = { @@ -808,9 +811,28 @@ static const struct snd_soc_component_driver soc_component_driver_tas2770 = { static int tas2770_register_codec(struct tas2770_priv *tas2770) { - return devm_snd_soc_register_component(tas2770->dev, - &soc_component_driver_tas2770, - tas2770_dai_driver, ARRAY_SIZE(tas2770_dai_driver)); + struct { + struct snd_soc_component_driver driver; + struct snd_kcontrol_new controls[ARRAY_SIZE(tas2770_snd_controls)]; + struct soc_mixer_control amp_gain; + } *instance; + struct snd_kcontrol_new *gain; + + instance = devm_kmalloc(tas2770->dev, sizeof(*instance), GFP_KERNEL); + if (!instance) + return -ENOMEM; + + instance->driver = soc_component_driver_tas2770; + memcpy(instance->controls, tas2770_snd_controls, sizeof(instance->controls)); + gain = &instance->controls[TAS2770_AMP_GAIN_CONTROL]; + + /* ASoC writes platform_max through private_value when limiting gain. */ + instance->amp_gain = *(const struct soc_mixer_control *)gain->private_value; + gain->private_value = (unsigned long)&instance->amp_gain; + instance->driver.controls = instance->controls; + + return devm_snd_soc_register_component(tas2770->dev, &instance->driver, + tas2770_dai_driver, ARRAY_SIZE(tas2770_dai_driver)); } static const struct reg_default tas2770_reg_defaults[] = { diff --git a/sound/soc/codecs/tas2770.h b/sound/soc/codecs/tas2770.h index f88c5396081be..023fd0e67ad98 100644 --- a/sound/soc/codecs/tas2770.h +++ b/sound/soc/codecs/tas2770.h @@ -25,6 +25,7 @@ #define TAS2770_PWR_CTRL_SHUTDOWN 0x2 /* Playback Configuration Reg0 */ #define TAS2770_PLAY_CFG_REG0 TAS2770_REG(0X0, 0x03) +#define TAS2770_AMP_GAIN_MAX 0x14 /* Playback Configuration Reg1 */ #define TAS2770_PLAY_CFG_REG1 TAS2770_REG(0X0, 0x04) /* Playback Configuration Reg2 */