Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273376
b: refs/heads/master
c: 3d6271f
h: refs/heads/master
v: v3
  • Loading branch information
Kyle Manna authored and Samuel Ortiz committed Oct 24, 2011
1 parent 3f12b1e commit cf03a60
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 881de67046f424fc3a6e05b1c681c12afd94e802
refs/heads/master: 3d6271f92e98094584fd1e609a9969cd33e61122
22 changes: 22 additions & 0 deletions trunk/drivers/mfd/twl4030-madc.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,28 @@ static int __devinit twl4030_madc_probe(struct platform_device *pdev)
TWL4030_BCI_BCICTL1);
goto err_i2c;
}

/* Check that MADC clock is on */
ret = twl_i2c_read_u8(TWL4030_MODULE_INTBR, &regval, TWL4030_REG_GPBR1);
if (ret) {
dev_err(&pdev->dev, "unable to read reg GPBR1 0x%X\n",
TWL4030_REG_GPBR1);
goto err_i2c;
}

/* If MADC clk is not on, turn it on */
if (!(regval & TWL4030_GPBR1_MADC_HFCLK_EN)) {
dev_info(&pdev->dev, "clk disabled, enabling\n");
regval |= TWL4030_GPBR1_MADC_HFCLK_EN;
ret = twl_i2c_write_u8(TWL4030_MODULE_INTBR, regval,
TWL4030_REG_GPBR1);
if (ret) {
dev_err(&pdev->dev, "unable to write reg GPBR1 0x%X\n",
TWL4030_REG_GPBR1);
goto err_i2c;
}
}

platform_set_drvdata(pdev, madc);
mutex_init(&madc->lock);
ret = request_threaded_irq(platform_get_irq(pdev, 0), NULL,
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/i2c/twl4030-madc.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ enum sample_type {
#define REG_BCICTL2 0x024
#define TWL4030_BCI_ITHSENS 0x007

/* Register and bits for GPBR1 register */
#define TWL4030_REG_GPBR1 0x0c
#define TWL4030_GPBR1_MADC_HFCLK_EN (1 << 7)

struct twl4030_madc_user_parms {
int channel;
int average;
Expand Down

0 comments on commit cf03a60

Please sign in to comment.