Skip to content

Commit 4b8ab8a

Browse files
Dan Murphybroonie
authored andcommitted
ASoC: tas2770: Fix required DT properties in the code
The devicetree binding indicates that the ti,asi-format, ti,imon-slot-no and ti,vmon-slot-no are not required but the driver requires them or it fails to probe. Honor the binding and allow these entries to be optional and set the corresponding values to the default values for each as defined in the data sheet. Fixes: 1a476ab ("tas2770: add tas2770 smart PA kernel driver") Signed-off-by: Dan Murphy <dmurphy@ti.com> Link: https://lore.kernel.org/r/20200918190548.12598-4-dmurphy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 4272caf commit 4b8ab8a

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

sound/soc/codecs/tas2770.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -708,29 +708,28 @@ static int tas2770_parse_dt(struct device *dev, struct tas2770_priv *tas2770)
708708
rc = fwnode_property_read_u32(dev->fwnode, "ti,asi-format",
709709
&tas2770->asi_format);
710710
if (rc) {
711-
dev_err(tas2770->dev, "Looking up %s property failed %d\n",
712-
"ti,asi-format", rc);
713-
goto end;
711+
dev_info(tas2770->dev, "Property %s is missing setting default slot\n",
712+
"ti,asi-format");
713+
tas2770->asi_format = 0;
714714
}
715715

716716
rc = fwnode_property_read_u32(dev->fwnode, "ti,imon-slot-no",
717717
&tas2770->i_sense_slot);
718718
if (rc) {
719-
dev_err(tas2770->dev, "Looking up %s property failed %d\n",
720-
"ti,imon-slot-no", rc);
721-
goto end;
719+
dev_info(tas2770->dev, "Property %s is missing setting default slot\n",
720+
"ti,imon-slot-no");
721+
tas2770->i_sense_slot = 0;
722722
}
723723

724724
rc = fwnode_property_read_u32(dev->fwnode, "ti,vmon-slot-no",
725725
&tas2770->v_sense_slot);
726726
if (rc) {
727-
dev_err(tas2770->dev, "Looking up %s property failed %d\n",
728-
"ti,vmon-slot-no", rc);
729-
goto end;
727+
dev_info(tas2770->dev, "Property %s is missing setting default slot\n",
728+
"ti,vmon-slot-no");
729+
tas2770->v_sense_slot = 2;
730730
}
731731

732-
end:
733-
return rc;
732+
return 0;
734733
}
735734

736735
static int tas2770_i2c_probe(struct i2c_client *client,

0 commit comments

Comments
 (0)