Add slot width setting
[tas2770sw-android/tas2770sw-android.git] / tas2770-regmap.c
index 9afbbd0cd249909b8ac747ee4ab4f82a70dff7dc..8038b28cf0e37924bb42204bedef6c7fdecf2dc6 100644 (file)
@@ -278,6 +278,24 @@ static int tas2770_parse_dt(struct device *dev, struct tas2770_priv *pTAS2770)
                        pTAS2770->mnRightSlot);
        }
 
+       of_property_read_u32(np, "ti,imon-slot-no", &pTAS2770->mnImon_slot_no);
+       if (rc) {
+               dev_err(pTAS2770->dev, "Looking up %s property in node %s failed %d\n",
+                       "ti,imon-slot-no", np->full_name, rc);
+       } else {
+               dev_dbg(pTAS2770->dev, "ti,imon-slot-no=%d",
+                       pTAS2770->mnImon_slot_no);
+       }
+
+       of_property_read_u32(np, "ti,vmon-slot-no", &pTAS2770->mnVmon_slot_no);
+       if (rc) {
+               dev_err(pTAS2770->dev, "Looking up %s property in node %s failed %d\n",
+                       "ti,vmon-slot-no", np->full_name, rc);
+       } else {
+               dev_dbg(pTAS2770->dev, "ti,vmon-slot-no=%d",
+                       pTAS2770->mnVmon_slot_no);
+       }
+
        return ret;
 }
 
@@ -348,6 +366,11 @@ static int tas2770_i2c_probe(struct i2c_client *client,
        pTAS2770->enableIRQ = tas2770_enableIRQ;
        pTAS2770->runtime_suspend = tas2770_runtime_suspend;
        pTAS2770->runtime_resume = tas2770_runtime_resume;
+       pTAS2770->mnCh_size = 0;
+       pTAS2770->mnSlot_width = 0;
+
+       tas2770_hw_reset(pTAS2770);
+
        mutex_init(&pTAS2770->dev_lock);
        if (nResult < 0)
                goto destroy_mutex;