• Bingbu Cao's avatar
    media: ak7375: Add ak7375 lens voice coil driver · 90ee26fb
    Bingbu Cao authored
    Add a v4l2 sub-device driver for the ak7375 lens voice coil.
    This is a voice coil module using the i2c bus to control the
    focus position.
    
    ak7375 can write multiple bytes of data at a time. If more
    data is received instead of the stop condition after receiving
    one byte of data, the address inside the chip is automatically
    incremented and the data is written into the next address.
    
    The ak7375 can control the position with 12 bits value and
    consists of two 8 bit registers show as below:
    register 0x00(AK7375_REG_POSITION):
        +---+---+---+---+---+---+---+---+
        |D11|D10|D09|D08|D07|D06|D05|D04|
        +---+---+---+---+---+---+---+---+
    register 0x01:
        +---+---+---+---+---+---+---+---+
        |D03|D02|D01|D00|---|---|---|---|
        +---+---+---+---+---+---+---+---+
    
    This driver support :
        - set ak7375 to standby mode once suspend and
          turn it back to active if resume
        - set the position via V4L2_CID_FOCUS_ABSOLUTE ctrl
    
    [Sakari Ailus: Rename val as ret in probe, drop redundant error message]
    Signed-off-by: default avatarTianshu Qiu <tian.shu.qiu@intel.com>
    Signed-off-by: default avatarBingbu Cao <bingbu.cao@intel.com>
    Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
    90ee26fb
ak7375.c 7.23 KB