struct monitor_cfg *monitor_config = &cs35l35->pdata.mon_cfg;
int ret;
- cs35l35->codec = codec;
-
/* Set Platform Data */
if (cs35l35->pdata.bst_vctl)
regmap_update_bits(cs35l35->regmap, CS35L35_BST_CVTR_V_CTL,
static irqreturn_t cs35l35_irq(int irq, void *data)
{
struct cs35l35_private *cs35l35 = data;
- struct snd_soc_codec *codec = cs35l35->codec;
unsigned int sticky1, sticky2, sticky3, sticky4;
unsigned int mask1, mask2, mask3, mask4, current1;
/* handle the interrupts */
if (sticky1 & CS35L35_CAL_ERR) {
- dev_crit(codec->dev, "Calibration Error\n");
+ dev_crit(cs35l35->dev, "Calibration Error\n");
/* error is no longer asserted; safe to reset */
if (!(current1 & CS35L35_CAL_ERR)) {
}
if (sticky1 & CS35L35_AMP_SHORT) {
- dev_crit(codec->dev, "AMP Short Error\n");
+ dev_crit(cs35l35->dev, "AMP Short Error\n");
/* error is no longer asserted; safe to reset */
if (!(current1 & CS35L35_AMP_SHORT)) {
- dev_dbg(codec->dev, "Amp short error release\n");
+ dev_dbg(cs35l35->dev, "Amp short error release\n");
regmap_update_bits(cs35l35->regmap,
CS35L35_PROT_RELEASE_CTL,
CS35L35_SHORT_RLS, 0);
}
if (sticky1 & CS35L35_OTW) {
- dev_warn(codec->dev, "Over temperature warning\n");
+ dev_warn(cs35l35->dev, "Over temperature warning\n");
/* error is no longer asserted; safe to reset */
if (!(current1 & CS35L35_OTW)) {
- dev_dbg(codec->dev, "Over temperature warn release\n");
+ dev_dbg(cs35l35->dev, "Over temperature warn release\n");
regmap_update_bits(cs35l35->regmap,
CS35L35_PROT_RELEASE_CTL,
CS35L35_OTW_RLS, 0);
}
if (sticky1 & CS35L35_OTE) {
- dev_crit(codec->dev, "Over temperature error\n");
+ dev_crit(cs35l35->dev, "Over temperature error\n");
/* error is no longer asserted; safe to reset */
if (!(current1 & CS35L35_OTE)) {
- dev_dbg(codec->dev, "Over temperature error release\n");
+ dev_dbg(cs35l35->dev, "Over temperature error release\n");
regmap_update_bits(cs35l35->regmap,
CS35L35_PROT_RELEASE_CTL,
CS35L35_OTE_RLS, 0);
}
if (sticky3 & CS35L35_BST_HIGH) {
- dev_crit(codec->dev, "VBST error: powering off!\n");
+ dev_crit(cs35l35->dev, "VBST error: powering off!\n");
regmap_update_bits(cs35l35->regmap, CS35L35_PWRCTL2,
CS35L35_PDN_AMP, CS35L35_PDN_AMP);
regmap_update_bits(cs35l35->regmap, CS35L35_PWRCTL1,
}
if (sticky3 & CS35L35_LBST_SHORT) {
- dev_crit(codec->dev, "LBST error: powering off!\n");
+ dev_crit(cs35l35->dev, "LBST error: powering off!\n");
regmap_update_bits(cs35l35->regmap, CS35L35_PWRCTL2,
CS35L35_PDN_AMP, CS35L35_PDN_AMP);
regmap_update_bits(cs35l35->regmap, CS35L35_PWRCTL1,
}
if (sticky2 & CS35L35_VPBR_ERR)
- dev_dbg(codec->dev, "Error: Reactive Brownout\n");
+ dev_dbg(cs35l35->dev, "Error: Reactive Brownout\n");
if (sticky4 & CS35L35_VMON_OVFL)
- dev_dbg(codec->dev, "Error: VMON overflow\n");
+ dev_dbg(cs35l35->dev, "Error: VMON overflow\n");
if (sticky4 & CS35L35_IMON_OVFL)
- dev_dbg(codec->dev, "Error: IMON overflow\n");
+ dev_dbg(cs35l35->dev, "Error: IMON overflow\n");
return IRQ_HANDLED;
}
if (!cs35l35)
return -ENOMEM;
+ cs35l35->dev = dev;
+
i2c_set_clientdata(i2c_client, cs35l35);
cs35l35->regmap = devm_regmap_init_i2c(i2c_client, &cs35l35_regmap);
if (IS_ERR(cs35l35->regmap)) {