Skip to content

Commit

Permalink
drivers: mfd: da9063: disable timeout feature
Browse files Browse the repository at this point in the history
It fixes various hangs of the i.MX6 module, when, for example, hackbench is
running in a loop. This is a port of previous patch onto 3.19.5:

    commit de7974db320349954d3a0479e3d6eb2c7b60dc1b
    Author: Christian Hemp <c.hemp@phytec.de>
    Date:   Thu Jan 9 10:54:37 2014 +0100

        mfd: da9063: disable timeout feature

        This patch fix bug report torvalds#131: i.MX6 crashes: voltage too low
            | Sometimes, after voltage scaling, the processor hangs. It seems, that the
            | voltage is set too low for appropriate frequency setting.
            |
            | It seems that the problem occurs only if the delay between two message bits
            | (e.g. between Send Slave address write command and send data command) is
            | greater than 23ms. If this delay occurs, the PMIC seems to reset the I2C
            | interface and so doesn't react to the other bits of the message (e.g. by
            | not sending a ACK).

        If we deactivate the I2C timeout feature the module runs stable.

        Signed-off-by: Christian Hemp <c.hemp@phytec.de>

Signed-off-by: Stefan Christ <s.christ@phytec.de>
  • Loading branch information
Stefan Christ authored and metux committed Sep 17, 2017
1 parent 781de7b commit 3603db0
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion drivers/mfd/da9063-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static int da9063_clear_fault_log(struct da9063 *da9063)
int da9063_device_init(struct da9063 *da9063, unsigned int irq)
{
struct da9063_pdata *pdata = da9063->dev->platform_data;
int model, variant_id, variant_code;
int model, variant_id, variant_code, config_j;
int ret;

ret = da9063_clear_fault_log(da9063);
Expand Down Expand Up @@ -232,6 +232,22 @@ int da9063_device_init(struct da9063 *da9063, unsigned int irq)
if (ret)
dev_err(da9063->dev, "Cannot add MFD cells\n");

/* Set bit 6 (IF_TO) of register 0x10F (DA9063_REG_CONFIG_J) to 0:
* Disables automatic reset of 2-WIRE-IF
*/
ret = regmap_read(da9063->regmap, DA9063_REG_CONFIG_J, &config_j);
if (ret) {
dev_err(da9063->dev, "Cannot read register DA9063_REG_CONFIG_J.\n");
return ret;
}

config_j &= ~0x40;
ret = regmap_write(da9063->regmap, DA9063_REG_CONFIG_J, config_j);
if (ret) {
dev_err(da9063->dev, "Cannot write register DA9063_REG_CONFIG_J.\n");
return ret;
}

return ret;
}

Expand Down

0 comments on commit 3603db0

Please sign in to comment.