]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - tas2770sw-android/tas2770sw-android.git/blobdiff - tas2770-regmap.c
Add regmap init and support of DAC volume
[tas2770sw-android/tas2770sw-android.git] / tas2770-regmap.c
index 9afbbd0cd249909b8ac747ee4ab4f82a70dff7dc..402d97320e2a5e09e98818143b26b0fdab7b61d4 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,13 @@ 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);
+       regmap_write(pTAS2770->regmap, TAS2770_SoftwareReset,
+                       TAS2770_SoftwareReset_SoftwareReset_Reset);
+
        mutex_init(&pTAS2770->dev_lock);
        if (nResult < 0)
                goto destroy_mutex;