summaryrefslogtreecommitdiff
path: root/drivers/mfd/si476x-i2c.c
diff options
context:
space:
mode:
authorZidan Wang <b50113@freescale.com>2014-12-19 11:13:01 +0800
committerOctavian Purdila <octavian.purdila@nxp.com>2017-02-23 14:21:42 +0200
commit6aa001202f2c9c637a61e04817d8f67822993809 (patch)
tree91c06df5ee8e04ffd1e9d98d08733bd6fefcbef9 /drivers/mfd/si476x-i2c.c
parentd64ff7e0e808a58c64e93baf90dc317244b3956c (diff)
MLK-10038-1: mfd: si476x-i2c: Add support of si476x-rev4.0 board
Currently, si476x-rev1.0 and si476x-rev4.0 board just support A10 compatible command set. For si476x-rev1.0 board, its firmware revision is unsupported and will revert to A10 compatible function. For si476x-rev4.0 board, its firmware revision is two and will use A30 function, but A30 command set function can't work for the rev4.0 board. So make the command set configurable in dts. If "revision-a10" is present, set the revision to SI476X_REVISION_A10 to use A10 compatible commit set. Otherwise, get the revision from si476x register. Signed-off-by: Zidan Wang <b50113@freescale.com> (cherry picked from commit b648714c3b71ee084188ae04b1e6a6f2554fe2cb)
Diffstat (limited to 'drivers/mfd/si476x-i2c.c')
-rw-r--r--drivers/mfd/si476x-i2c.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/mfd/si476x-i2c.c b/drivers/mfd/si476x-i2c.c
index d1c7b3c3e8ba..5013a9884453 100644
--- a/drivers/mfd/si476x-i2c.c
+++ b/drivers/mfd/si476x-i2c.c
@@ -811,10 +811,14 @@ static int si476x_core_probe(struct i2c_client *client,
core->power_state = SI476X_POWER_UP_FULL;
si476x_core_set_power_state(core, SI476X_POWER_DOWN);
- rval = si476x_core_get_revision_info(core);
- if (rval < 0) {
- rval = -ENODEV;
- goto free_kfifo;
+ if (of_property_read_bool(client->dev.of_node, "revision-a10"))
+ core->revision = SI476X_REVISION_A10;
+ else {
+ rval = si476x_core_get_revision_info(core);
+ if (rval < 0) {
+ rval = -ENODEV;
+ goto free_kfifo;
+ }
}
cell_num = 0;