diff options
author | Xiaohui Tao <xtao@nvidia.com> | 2013-09-10 17:49:42 -0700 |
---|---|---|
committer | Gabby Lee <galee@nvidia.com> | 2013-09-11 23:21:13 -0700 |
commit | 9f42dfc3cda19db08aec5a01ed124789240c4970 (patch) | |
tree | 4e395199af7fd0fce8518d9a4a92076242fdf155 /drivers | |
parent | fdaf1ff6e1d21bf00a53ee76b33cd08c3dc9106e (diff) |
input: sensor: compass: Add sec-salve-id for compass
Bug 1356943
Change-Id: If34b39b849e350fd9312b9a73130db13c3571b4c
Signed-off-by: Xiaohui Tao <xtao@nvidia.com>
Reviewed-on: http://git-master/r/272840
GVS: Gerrit_Virtual_Submit
Reviewed-by: Robert Collins <rcollins@nvidia.com>
Reviewed-by: Gabby Lee <galee@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/misc/compass/ak8975_input.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/input/misc/compass/ak8975_input.c b/drivers/input/misc/compass/ak8975_input.c index 665a4bee184c..55c0c3610d3b 100644 --- a/drivers/input/misc/compass/ak8975_input.c +++ b/drivers/input/misc/compass/ak8975_input.c @@ -1424,6 +1424,12 @@ static struct mpu_platform_data *akm_parse_dt(struct i2c_client *client) return ERR_PTR(-EINVAL); } + if (of_property_read_u32(np, "sec-slave-id", + &pdata->sec_slave_id) < 0) { + dev_err(&client->dev, "Cannot read sec-slave-id\n"); + return ERR_PTR(-EINVAL); + } + return pdata; } @@ -1467,6 +1473,11 @@ static int akm_probe(struct i2c_client *client, if (err) goto akm_probe_err; + if (!inf->initd) + err = akm_init_hw(inf); + if (err) + goto akm_probe_err; + inf->wq = create_singlethread_workqueue(AKM_NAME); if (!inf->wq) { dev_err(&client->dev, "%s workqueue ERR\n", __func__); |