FAQ: [#6278] adp8860 doesn't work right when writing a nonzero value to ambient_light_zone(2010)

Document created by Aaronwu Employee on Sep 11, 2013
Version 1Show Document
  • View in full screen mode

[#6278] adp8860 doesn't work right when writing a nonzero value to ambient_light_zone

Submitted By: Vivi Li

Open Date

2010-09-28 05:29:47     Close Date

2010-11-05 06:26:03

Priority:

Medium     Assignee:

Michael Hennerich

Status:

Closed     Fixed In Release:

N/A

Found In Release:

2010R1     Release:

Category:

Drivers     Board:

STAMP

Processor:

BF537     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Fixed

Uboot version or rev.:

    Toolchain version or rev.:

gcc4.3_2010R1-RC3

App binary format:

N/A     

Summary: adp8860 doesn't work right when writing a nonzero value to ambient_light_zone

Details:

 

adp8860 doesn't work right when writing a nonzero value to ambient_light_zone.

 

Write 1 to ambient_light_zone, value remains 2;

Write 3 to ambient_light_zone, value becomes 4 and D6-D14 are off;

When write 0 to ambient_light_zone, it works right and return to normal operation.

 

Bellow is the log:

--

Linux version 2.6.34.7-ADI-2010R1-pre-svn9171 (test@linux-vivi) (gcc version 4.3.5 (ADI-2010R1-RC3) ) #9 Mon Sep 27 15:01:56 CST0

register early platform devices

bootconsole [early_shadow0] enabled

bootconsole [early_BFuart0] enabled

early printk enabled on early_BFuart0

Limiting kernel memory to 56MB due to anomaly 05000263

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x0010dbf0

  rodata    = 0x0010dbf0-0x00164964

  bss       = 0x00165000-0x00175464

  data      = 0x00175464-0x00186000

    stack   = 0x00184000-0x00186000

  init      = 0x00186000-0x002f5000

  available = 0x002f5000-0x03800000

  DMA Zone  = 0x03f00000-0x04000000

Hardware Trace Active and Enabled

Boot Mode: 0

Reset caused by Software reset

Blackfin support (C) 2004-2010 Analog Devices, Inc.

Compiled for ADSP-BF537 Rev 0.2

Blackfin Linux support by http://blackfin.uclinux.org/

Processor Speed: 500 MHz core clock and 125 MHz System Clock

NOMPU: setting up cplb tables

Instruction Cache Enabled for CPU0

  External memory: cacheable in instruction cache

Data Cache Enabled for CPU0

  External memory: cacheable (write-back) in data cache

Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 14224

Kernel command line: root=/dev/mtdblock0 rw clkin_hz=25000000 earlyprintk=serial,uart0,57600 console=ttyBF0,57600 ip=10.100.4.50f

PID hash table entries: 256 (order: -2, 1024 bytes)

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory available: 53748k/65536k RAM, (1468k init code, 1074k kernel code, 482k data, 1024k dma, 7740k reserved)

Hierarchical RCU implementation.

NR_IRQS:138

Configuring Blackfin Priority Driven Interrupts

console [ttyBF0] enabled, bootconsole disabled

console [ttyBF0] enabled, bootconsole disabled

Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656)

Security Framework initialized

Mount-cache hash table entries: 512

Blackfin Scratchpad data SRAM: 4 KB

Blackfin L1 Data A SRAM: 16 KB (16 KB free)

Blackfin L1 Data B SRAM: 16 KB (16 KB free)

Blackfin L1 Instruction SRAM: 48 KB (35 KB free)

NET: Registered protocol family 16

Blackfin DMA Controller

stamp_init(): registering device resources

bio: create slab <bio-0> at 0

bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@7

i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller, regs_base@ffc01400

Switching to clocksource bfin_cs_cycles

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 2048 (order: 2, 16384 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

UDP hash table entries: 256 (order: 0, 4096 bytes)

UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

NET: Registered protocol family 1

msgmni has been set to 104

io scheduler noop registered

io scheduler cfq registered (default)

adp8860_bl 0-002a: adp8860 Rev.7 Backlight

bfin-uart: Blackfin serial driver

bfin-uart.0: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART

brd: module loaded

bfin_mii_bus: probed

bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=24)@sclk=125MHz)

bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

TCP cubic registered

NET: Registered protocol family 17

rtc-bfin rtc-bfin: setting system clock to 1970-01-01 05:17:39 UTC (19059)

IP-Config: Complete:

     device=eth0, addr=10.100.4.50, mask=255.255.255.0, gw=10.100.4.174,

     host=bf537-stamp, domain=, nis-domain=(none),

     bootserver=10.100.4.174, rootserver=10.100.4.174, rootpath=

dma_alloc_init: dma_page @ 0x02327000 - 256 pages at 0x03f00000

Freeing unused kernel memory: 1468k freed

                           _____________________________________

        a8888b.           / Welcome to the uClinux distribution \

       d888888b.         /       _     _                         \

       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |

       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |

       8'    .88       \        | |   | |  _ \| | | | \  /        |

       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |

      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |

     dP   .    Y8b.       \   For embedded processors including   |

    d8:'  "  `::88b        \    the Analog Devices Blackfin      /

   d8"         'Y88b        \___________________________________/

  :8P    '      :888

   8a.   :     _a88P         For further information, check out:

._/"Yaa_:   .| 88P|            - http://blackfin.uclinux.org/

\    YP"    `| 8P  `.          - http://docs.blackfin.uclinux.org/

/     \.___.d|    .'           - http://www.uclinux.org/

`--..__)8888P`._.'  jgs/a:f    - http://www.analog.com/blackfin

 

Have a lot of fun...

 

 

BusyBox v1.16.2 (2010-09-27 14:59:50 CST) hush - the humble shell

 

root:/> PHY: 0:01 - Link is Up - 100/Full

 

root:/> cat /sys/class/backlight/adp8860_bl/ambient_light_zone

2

root:/> echo 1 > /sys/class/backlight/adp8860_bl/ambient_light_zone

root:/> cat /sys/class/backlight/adp8860_bl/ambient_light_zone

2

root:/> echo 3 > /sys/class/backlight/adp8860_bl/ambient_light_zone

root:/> cat /sys/class/backlight/adp8860_bl/ambient_light_zone

4

root:/>

--

 

Follow-ups

 

--- Michael Hennerich                                        2010-09-28 11:54:01

assign to me.

-Michael

 

--- Vivi Li                                                  2010-09-28 22:22:36

Hi Michael,

 

  I did following stuff during adp8860. Please inform me if you find anything

inappropriate or test case I can add:

* Connect J30 adp886x adapter board to TWI interface on BF537-STAMP:

  VBAT → P10.2, SDA → P10.6, SCL → P10.5, GND → P10.20

* Cover the photosensor D2 in ADP8860 daughter card, LED D6-D14 will dim;

* Change brightness of D6-D14 through

/sys/class/backlight/adp8860_bl/brightness;

* Other LEDs will blink when /sys/class/leds/adp8860-led7/brightness is

nonzero.

 

-Vivi

 

--- Vivi Li                                                  2010-09-28 22:30:05

I thought ambient_light_zone should be only set to 1, 2 and 3, as mentioned in

wiki ADP8860 features 3 individually programmable Ambient Light Sensing Zones.

 

But later on the same page ambient_light_zone is an integer between 1 to 5.

I suppose there is something wrong.

 

Please refer to:

https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:adp8860.

 

--- Michael Hennerich                                        2010-09-29 04:50:38

Hi Vivi,

 

Good catch!

I fixed the driver as well as the documentation page.

 

video: backlight: adp8860: Fix ambient_light_zone overwrite handling

 

Get/Set current Ambient Light Zone. Reading returns integer between 1..3

(1 = Daylight, 2 = office, 3 = dark). Writing a value between 1..3 forces the

Backlight controller

to enter the corresponding Ambient Light Zone. Writing 0 returns to normal

operation.

Fix valid range and make sure we subtract 1, since the register definition

(CFGR:BLV) requires it.

 

Fixed on trunk and 2010R1 branch.

 

-Michael

 

--- Vivi Li                                                  2010-11-05 06:26:03

OK, close it.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

config.kernel.adp8860    application/octet-stream    31832    Vivi Li

Attachments

Outcomes