Skip to content

Commit

Permalink
ASoC: da9055: Fix device registration of PMIC and CODEC devices
Browse files Browse the repository at this point in the history
Currently the I2C device Ids conflict for the MFD and CODEC so
cannot be both instantiated on one platform. This patch updates
the Ids and names to make them unique from each other.

It should be noted that the I2C addresses for both PMIC and CODEC
are modifiable so instantiation of the two are kept as separate
devices, rather than instantiating the CODEC from the MFD code.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Acked-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
  • Loading branch information
Adam Thomson authored and Mark Brown committed Feb 10, 2014
1 parent 38dbfb5 commit 07b0e5b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
12 changes: 10 additions & 2 deletions drivers/mfd/da9055-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,25 @@ static int da9055_i2c_remove(struct i2c_client *i2c)
return 0;
}

/*
* DO NOT change the device Ids. The naming is intentionally specific as both
* the PMIC and CODEC parts of this chip are instantiated separately as I2C
* devices (both have configurable I2C addresses, and are to all intents and
* purposes separate). As a result there are specific DA9055 ids for PMIC
* and CODEC, which must be different to operate together.
*/
static struct i2c_device_id da9055_i2c_id[] = {
{"da9055", 0},
{"da9055-pmic", 0},
{ }
};
MODULE_DEVICE_TABLE(i2c, da9055_i2c_id);

static struct i2c_driver da9055_i2c_driver = {
.probe = da9055_i2c_probe,
.remove = da9055_i2c_remove,
.id_table = da9055_i2c_id,
.driver = {
.name = "da9055",
.name = "da9055-pmic",
.owner = THIS_MODULE,
},
};
Expand Down
11 changes: 9 additions & 2 deletions sound/soc/codecs/da9055.c
Original file line number Diff line number Diff line change
Expand Up @@ -1523,16 +1523,23 @@ static int da9055_remove(struct i2c_client *client)
return 0;
}

/*
* DO NOT change the device Ids. The naming is intentionally specific as both
* the CODEC and PMIC parts of this chip are instantiated separately as I2C
* devices (both have configurable I2C addresses, and are to all intents and
* purposes separate). As a result there are specific DA9055 Ids for CODEC
* and PMIC, which must be different to operate together.
*/
static const struct i2c_device_id da9055_i2c_id[] = {
{ "da9055", 0 },
{ "da9055-codec", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, da9055_i2c_id);

/* I2C codec control layer */
static struct i2c_driver da9055_i2c_driver = {
.driver = {
.name = "da9055",
.name = "da9055-codec",
.owner = THIS_MODULE,
},
.probe = da9055_i2c_probe,
Expand Down

0 comments on commit 07b0e5b

Please sign in to comment.