This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Light sensor is not working on blaze MDP

Hi,

I am using http://omappedia.org/wiki/L27.IS.2.P2_OMAP4_Icecream_Sandwich_Release_Notes release.

I am unable to get the event when i am giving getevent but the driver is initialized properly.

Thanks

Abhijit

  • Abhijit,

    As mentioned in this thread http://e2e.ti.com/support/omap/f/849/t/181468.aspx, please move to the latest ICS release (http://omappedia.org/wiki/4AI.1.3_OMAP4_Icecream_Sandwich_Release_Notes) since L27.IS.2-P2 is several months old.

    Thank you,

    Gina

  • Hi Gina,

    Problem is android is able to detect the light sensor but still data is not coming.

    I have used the latest release.

    Do i have to change anything in the driver code (bh1780gli.c) or in the android filesystem.

    please let me know

    Abhijit

  • Hi Abhijit,

    I haven't tried the light sensor myself, but as a suggestion, I could run evtest (perhaps it should be built for Android or get an Android version). You should be able to see activity with evtest, if you don't, you could rule out Android as the issue and focus on kernel side. evtest interacts directly with input drivers.

  • Dear jorge,

    I am able to run evtest and able to see light sensor as a device but i am not able to see any data.

    Please help me regarding this.

    Thanks

    Abhijit

  • Hi Abhijit,

    I have reproduced your same issue here (the light sensor works on Blaze Tablet but not on Blaze at the Android level).  We are investigating.

    Regards,

    Gina

  • Hi geena,

    Thanks a lot geena for looking into it.

    Please let me know regarding the same.

    Regards

    Abhijit

  • Hi Geena,

    Light sensor working with workaround.

    When i manually enabled sys/bus/i2c/drvers/bh1780/3-0029/enable its working.

    i.e echo 1 > enable

    similarly echo 1 > power state.

    By default its disabled.

    So if you can tell me where i have to enable it permanently that would be great.

    Thanks

    Abhijit

  • Abhijit,

    Do those commands work for you?  When I try them, the light sensor no longer shows "waiting for data", but it reports a constant value of 5 lux.

    Regards,

    Gina

  • Gina,

    Yes for me   also its showing constant 2 lux value but when i am trying the same thing on my custom board its working fine.(values are getting changed).

    Can you tell me how can i make them work permanently without giving those commands.

    Thanks

    Abhijit

  • Abhijit,

    In general, sysfs entries can be accessed from init.omap4blazeboard.rc with the "write" command instead of "echo."  For the short term, you can try adding a line in init.omap4blazeboard.rc to avoid needing to enter the sysfs entries manually each time, something like:

    write /sys/bus/i2c/drivers/bh1780/3-0029/enable 1

    I will still investigate for a better solution via the appropriate kernel drivers.

    Regards,

    Gina

  • Hi Abhijit:

                  I have modified the driver code so it would be enabled by default and update lux values more often, you could give it a try an tell me if meets your needs, patch file attached to this post, you could also use binary images on links bellow

    Regards,

    Rodrigo

    https://gforge.ti.com/gf/download/user/9221/5616/boot.img_light_sens

    https://gforge.ti.com/gf/download/user/9221/5615/zImage_light_sens

  • Hi Rodrigo,

    Tried with your patch........Now the lux values are changing frequently but still power_state is not enabled by default.

    I have to make it high manually after that only it shows lux value

    Something like echo 1 > power_state........................Without doing this it does not show me any lux value.

    And each time i am turning on the application for checking the lux value i am giving this echo 1 > power_state every point of time.

    Why this is so??

    Thanks

    Abhijit

  • Hi Abhijit,

                     I am pretty sure you having this into account, but I still have to mention it, this driver has been designed with among other two things one is to adjust screen backlight intensity and power saving, so when screen backlight  goes off so does the ambient light sensor,  and this will do power_state to go to 0 automatically and the driver won't refresh lux value while is this state, and if there is more power management events to this driver y will set power_state to 0 again. I am telling you this because it was a problem I had with the driver.

    So if you like I can remove power management capabilities from the driver and send it yo you. if you are taking this into account and still having this problem let me know to dig deeper into the driver and solve this.

    Regards

    Rodrigo

  • Rodrigo,

    But my backlight intensity is still on when power_state goes to 0.

    This goes to 0 as soon as i am turning off my application(Which i am using for checking lux values).

    Any solution for this.

    Thnks

    Abhijit

  • Hi Abhijit:

                     Since I can not provide a solution without having your app code and logs. Use this as a tool the attached patch and the bellow links to boot.img and kernel image, have a version of ambient light sensor driver with the power management disabled, so if power_state goes to 0 is because you or your app is doing that, hope with this you can solve this problem.

    https://gforge.ti.com/gf/download/user/9221/5624/boot.img_light_sens2
    https://gforge.ti.com/gf/download/user/9221/5623/zImage_light_sens2

    Regards,

    Rodrigo

  • Hi Rodrigo,

    Finally got the kind of output which i was looking for (without power management disabled).

    Now my lux values are changing smoothly without manually enabling power_state and power_state also not getting disabled when i am turning off my application.(small problem was there in my init.rc file)

    Thanks a lot for your support.

    Abhijit