mirror of
https://github.com/torvalds/linux.git
synced 2024-09-29 11:23:16 +00:00
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "Two bugfixes for the I2C subsystem" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: mpc: Poll for MCF misc: eeprom: at24: Always append device id even if label property is set.
This commit is contained in:
commit
0823baef16
|
@ -635,8 +635,8 @@ static irqreturn_t mpc_i2c_isr(int irq, void *dev_id)
|
||||||
|
|
||||||
status = readb(i2c->base + MPC_I2C_SR);
|
status = readb(i2c->base + MPC_I2C_SR);
|
||||||
if (status & CSR_MIF) {
|
if (status & CSR_MIF) {
|
||||||
/* Read again to allow register to stabilise */
|
/* Wait up to 100us for transfer to properly complete */
|
||||||
status = readb(i2c->base + MPC_I2C_SR);
|
readb_poll_timeout(i2c->base + MPC_I2C_SR, status, !(status & CSR_MCF), 0, 100);
|
||||||
writeb(0, i2c->base + MPC_I2C_SR);
|
writeb(0, i2c->base + MPC_I2C_SR);
|
||||||
mpc_i2c_do_intr(i2c, status);
|
mpc_i2c_do_intr(i2c, status);
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
|
|
|
@ -714,23 +714,20 @@ static int at24_probe(struct i2c_client *client)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the 'label' property is not present for the AT24 EEPROM,
|
* We initialize nvmem_config.id to NVMEM_DEVID_AUTO even if the
|
||||||
* then nvmem_config.id is initialised to NVMEM_DEVID_AUTO,
|
* label property is set as some platform can have multiple eeproms
|
||||||
* and this will append the 'devid' to the name of the NVMEM
|
* with same label and we can not register each of those with same
|
||||||
* device. This is purely legacy and the AT24 driver has always
|
* label. Failing to register those eeproms trigger cascade failure
|
||||||
* defaulted to this. However, if the 'label' property is
|
* on such platform.
|
||||||
* present then this means that the name is specified by the
|
|
||||||
* firmware and this name should be used verbatim and so it is
|
|
||||||
* not necessary to append the 'devid'.
|
|
||||||
*/
|
*/
|
||||||
|
nvmem_config.id = NVMEM_DEVID_AUTO;
|
||||||
|
|
||||||
if (device_property_present(dev, "label")) {
|
if (device_property_present(dev, "label")) {
|
||||||
nvmem_config.id = NVMEM_DEVID_NONE;
|
|
||||||
err = device_property_read_string(dev, "label",
|
err = device_property_read_string(dev, "label",
|
||||||
&nvmem_config.name);
|
&nvmem_config.name);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
} else {
|
} else {
|
||||||
nvmem_config.id = NVMEM_DEVID_AUTO;
|
|
||||||
nvmem_config.name = dev_name(dev);
|
nvmem_config.name = dev_name(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user