ASoC: tas571x: added missing register literals
Subsystems (4)
PATCH v4 1/3 ASoC: tas571x: added missing register literals
The list of TAS571x registers was incomplete.
Added the missing register definitions up to the register 0x25. Added volatile and read-only register tables into tas5711_regmap_config and tas5717_regmap_config.
The chip has 256 registers in total. But from address 0x29 on (0x26 to 0x28 are reserved) the register width varies between 20, 12 and 8 bytes, which the register map cannot represent.
---
v1: <initial>
v2: <no change>
v3: added volatile and read-only register tables into regmap configs
v4: no change, the set v3 resubmitted without the already accepted patches
sound/soc/codecs/tas571x.c | 28 ++++++++++++++++++++++++++++ sound/soc/codecs/tas571x.h | 22 ++++++++++++++++++++++ 2 files changed, 50 insertions(+)
sound/soc/codecs/tas571x.c +28 -0
@@ -57,6 +57,10 @@ static int tas571x_register_size(struct tas571x_private *priv, unsigned int reg)case TAS571X_CH1_VOL_REG :case TAS571X_CH2_VOL_REG :return priv->chip->vol_reg_size; +case TAS571X_INPUT_MUX_REG : +case TAS571X_CH4_SRC_SELECT_REG : +case TAS571X_PWM_MUX_REG : +return 4 ;default :return 1 ; }
@@ -259,6 +263,26 @@ static const struct snd_kcontrol_new tas5711_controls[] = { 1, 1), }; +static const struct regmap_range tas571x_readonly_regs_range[] = { +regmap_reg_range (TAS571X_CLK_CTRL_REG ,TAS571X_DEV_ID_REG ), +}; + +static const struct regmap_range tas571x_volatile_regs_range[] = { +regmap_reg_range (TAS571X_CLK_CTRL_REG ,TAS571X_ERR_STATUS_REG ), +regmap_reg_range (TAS571X_OSC_TRIM_REG ,TAS571X_OSC_TRIM_REG ), +}; + +static const struct regmap_access_table tas571x_write_regs = { + .no_ranges = tas571x_readonly_regs_range, + .n_no_ranges =ARRAY_SIZE (tas571x_readonly_regs_range), +}; + +static const struct regmap_access_table tas571x_volatile_regs = { + .yes_ranges = tas571x_volatile_regs_range, + .n_yes_ranges =ARRAY_SIZE (tas571x_volatile_regs_range), + +}; +static const struct reg_default tas5711_reg_defaults[] = { {0x04 ,0x05 }, {0x05 ,0x40 },
@@ -278,6 +302,8 @@ static const struct regmap_config tas5711_regmap_config = { .reg_defaults = tas5711_reg_defaults, .num_reg_defaults = ARRAY_SIZE(tas5711_reg_defaults), .cache_type = REGCACHE_RBTREE, + .wr_table = &tas571x_write_regs, + .volatile_table = &tas571x_volatile_regs, };static const struct tas571x_chip tas5711_chip = {
@@ -332,6 +358,8 @@ static const struct regmap_config tas5717_regmap_config = { .reg_defaults = tas5717_reg_defaults, .num_reg_defaults = ARRAY_SIZE(tas5717_reg_defaults), .cache_type = REGCACHE_RBTREE, + .wr_table = &tas571x_write_regs, + .volatile_table = &tas571x_volatile_regs, };/* This entry is reused for tas5719 as the software interface is identical. */
sound/soc/codecs/tas571x.h +22 -0
@@ -13,6 +13,10 @@#define _TAS571X_H/* device registers */ +#define TAS571X_CLK_CTRL_REG 0x00 +#define TAS571X_DEV_ID_REG 0x01 +#define TAS571X_ERR_STATUS_REG 0x02 +#define TAS571X_SYS_CTRL_1_REG 0x03#define TAS571X_SDI_REG 0x04#define TAS571X_SDI_FMT_MASK 0x0f
@@ -27,7 +31,25 @@#define TAS571X_MVOL_REG 0x07#define TAS571X_CH1_VOL_REG 0x08#define TAS571X_CH2_VOL_REG 0x09 +#define TAS571X_CH3_VOL_REG 0x0a +#define TAS571X_VOL_CFG_REG 0x0e +#define TAS571X_MODULATION_LIMIT_REG 0x10 +#define TAS571X_IC_DELAY_CH1_REG 0x11 +#define TAS571X_IC_DELAY_CH2_REG 0x12 +#define TAS571X_IC_DELAY_CH3_REG 0x13 +#define TAS571X_IC_DELAY_CH4_REG 0x14 +#define TAS571X_PWM_CH_SDN_GROUP_REG 0x19/* N/A on TAS5717, TAS5719 */ +#define TAS571X_PWM_CH1_SDN_MASK (1<<0) +#define TAS571X_PWM_CH2_SDN_SHIFT (1<<1) +#define TAS571X_PWM_CH3_SDN_SHIFT (1<<2) +#define TAS571X_PWM_CH4_SDN_SHIFT (1<<3) + +#define TAS571X_START_STOP_PERIOD_REG 0x1a#define TAS571X_OSC_TRIM_REG 0x1b +#define TAS571X_BKND_ERR_REG 0x1c +#define TAS571X_INPUT_MUX_REG 0x20 +#define TAS571X_CH4_SRC_SELECT_REG 0x21 +#define TAS571X_PWM_MUX_REG 0x25#endif /* _TAS571X_H */
Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1459442487-32284-1-git-send-email-petr-Qh/[email protected]
PATCH v3 2/3 ASoC: tas571x: added support for TAS5721
This adds support for TAS5721.
---
v1: <initial>
v2: <no change>
v3: added volatile and read-only register tables into the register map
v4: no change, the set v3 resubmitted without the already accepted patches
sound/soc/codecs/Kconfig | 2 +- sound/soc/codecs/tas571x.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-)
sound/soc/codecs/Kconfig +1 -1
@@ -705,7 +705,7 @@ config SND_SOC_TAS5086 depends on I2C config SND_SOC_TAS571X - tristate "Texas Instruments TAS5711/TAS5717/TAS5719 power amplifiers" + tristate "Texas Instruments TAS5711/TAS5717/TAS5719/TAS5721 power amplifiers" depends on I2C config SND_SOC_TFA9879
sound/soc/codecs/tas571x.c +76 -0
100 lines not on this page · raw message
Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v4 3/3 dt/bindings: sound: new chip added into TAS571x binding
In reply to a message not in the archiveThis adds the TAS5721 into the TAS571x binding.
---
v1: <initial>
v2: formatting of the "compatible" strings amended
v3: <no change>
v4: no change, the set v3 resubmitted without the already accepted patches
Documentation/devicetree/bindings/sound/tas571x.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/sound/tas571x.txt +8 -2
@@ -1,4 +1,4 @@ -Texas Instruments TAS5711/TAS5717/TAS5719 stereo power amplifiers +Texas Instruments TAS5711/TAS5717/TAS5719/TAS5721 stereo power amplifiers The codec is controlled through an I2C interface. It also has two other signals that can be wired up to GPIOs: reset (strongly recommended), and
@@ -6,7 +6,11 @@ powerdown (optional). Required properties: -- compatible: "ti,tas5711", "ti,tas5717", or "ti,tas5719" +- compatible: should be one of the following: + - "ti,tas5711", + - "ti,tas5717", + - "ti,tas5719", + - "ti,tas5721" - reg: The I2C address of the device - #sound-dai-cells: must be equal to 0
@@ -25,6 +29,8 @@ Optional properties: - PVDD_B-supply: regulator phandle for the PVDD_B supply (5711) - PVDD_C-supply: regulator phandle for the PVDD_C supply (5711) - PVDD_D-supply: regulator phandle for the PVDD_D supply (5711) +- DRVDD-supply: regulator phandle for the DRVDD supply (5721) +- PVDD-supply: regulator phandle for the PVDD supply (5721) Example:
Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1459442487-32284-3-git-send-email-petr-Qh/[email protected]
Re: [PATCH v4 3/3] dt/bindings: sound: new chip added into TAS571x binding
Quoted 1 line · Petr Kulhavy
This adds the TAS5721 into the TAS571x binding.
Please use subject lines reflecting the style for the subsystem.