Resource setup is called after the initial contact with the ALS/Proximity sensor chip. On Medfield platform, the resource setup routine is responsible for turning on power to the chip, so must be called before initial contact.
This change moves the call to resource setup to a slightly earlier time in the probe() routine, so power will be on when we try to talk to the chip. Signed-off-by: Eric Lighthart <[email protected]> --- It is not clear that this is correct long term solution. This Insures that the sensor chip has power when we try to talk to It, for now. drivers/misc/apds990x.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) Index: b/drivers/misc/apds990x.c =================================================================== --- a/drivers/misc/apds990x.c +++ b/drivers/misc/apds990x.c @@ -1122,6 +1122,14 @@ static int __devinit apds990x_probe(stru goto fail2; } + if (chip->pdata->setup_resources) { + err = chip->pdata->setup_resources(); + if (err) { + err = -EINVAL; + goto fail3; + } + } + msleep(APDS_STARTUP_DELAY / 1000 + ((APDS_STARTUP_DELAY % 1000) ? 1 : 0)); err = apds990x_detect(chip); @@ -1138,14 +1146,6 @@ static int __devinit apds990x_probe(stru pm_runtime_enable(&client->dev); - if (chip->pdata->setup_resources) { - err = chip->pdata->setup_resources(); - if (err) { - err = -EINVAL; - goto fail3; - } - } - err = sysfs_create_group(&chip->client->dev.kobj, apds990x_attribute_group); if (err < 0) { _______________________________________________ MeeGo-kernel mailing list [email protected] http://lists.meego.com/listinfo/meego-kernel
