|
@@ -88,6 +88,10 @@
|
|
|
|
|
|
#define TAS5086_MAX_REGISTER TAS5086_PWM_OUTPUT_MUX
|
|
|
|
|
|
+#define TAS5086_PWM_START_MIDZ_FOR_START_1 (1 << 7)
|
|
|
+#define TAS5086_PWM_START_MIDZ_FOR_START_2 (1 << 6)
|
|
|
+#define TAS5086_PWM_START_CHANNEL_MASK (0x3f)
|
|
|
+
|
|
|
/*
|
|
|
* Default TAS5086 power-up configuration
|
|
|
*/
|
|
@@ -717,13 +721,31 @@ static int tas5086_probe(struct snd_soc_codec *codec)
|
|
|
{
|
|
|
struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec);
|
|
|
int charge_period = 1300000; /* hardware default is 1300 ms */
|
|
|
+ u8 pwm_start = TAS5086_PWM_START_CHANNEL_MASK;
|
|
|
int i, ret;
|
|
|
|
|
|
if (of_match_device(of_match_ptr(tas5086_dt_ids), codec->dev)) {
|
|
|
struct device_node *of_node = codec->dev->of_node;
|
|
|
of_property_read_u32(of_node, "ti,charge-period", &charge_period);
|
|
|
+
|
|
|
+ for (i = 0; i < 6; i++) {
|
|
|
+ char name[25];
|
|
|
+
|
|
|
+ snprintf(name, sizeof(name),
|
|
|
+ "ti,mid-z-channel-%d", i + 1);
|
|
|
+
|
|
|
+ if (of_get_property(of_node, name, NULL) != NULL)
|
|
|
+ pwm_start &= ~(1 << i);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
+ * Configure 'part 2' of the PWM starts to always use MID-Z, and tell
|
|
|
+ * all configured mid-z channels to start start under 'part 2'.
|
|
|
+ */
|
|
|
+ regmap_write(priv->regmap, TAS5086_PWM_START,
|
|
|
+ TAS5086_PWM_START_MIDZ_FOR_START_2 | pwm_start);
|
|
|
+
|
|
|
/* lookup and set split-capacitor charge period */
|
|
|
if (charge_period == 0) {
|
|
|
regmap_write(priv->regmap, TAS5086_SPLIT_CAP_CHARGE, 0);
|