• Eugen Hristev's avatar
    media: microchip: add ISC driver as Microchip ISC · a5517d53
    Eugen Hristev authored
    The Atmel ISC driver will be moved to staging to support old users that
    are not using the media controller paradigm.
    The ISC driver was converted to media controller in the public patch
    series:
    
    https://lore.kernel.org/lkml/20220503095127.48710-1-eugen.hristev@microchip.com/T/#m2c320fa8153c01379a1c35b1d90a00903949513a
    
    However the conversion cannot be done directly as it would affect existing
    users by breaking the old way of configuration for sama5d2 platforms.
    
    After discussions with the media maintainers, the decision is to move
    Atmel ISC to staging as-is, to keep the Kconfig symbols and the users
    to the driver in staging. Thus, all the existing users of the non
    media-controller paradigm will continue to be happy and use the old config
    way.
    
    The converted driver would support both sama5d2 and sama7g5 platforms with
    media controller paradigm, but it requires userspace configuration of the
    pipeline for all the pipeline modules.
    
    In a simple configuration sensor ==> isc , the old isc driver used to call
    subdev s_fmt and control the sensor directly.
    This was achieved by having a lot of code inside the driver that was
    querying the subdev at probe time and made a list of formats which are
    usable.
    Basically the user had nothing to configure, as the isc would handle
    everything at the top level. This was an easy way to capture, but also came
    with the drawback of lack of flexibility.
    In a more complicated pipeline
     sensor ==> controller 1 ==> controller 2 ==> isc
    this would not be achievable, as controller 1 and controller 2 might be
    media-controller configurable, and will not propagate the formats down to
    the sensor.
    The new driver Microchip ISC would solve all these problems and exposes pads
    entities and links to userspace.
    For the ease of tracking, the patches that convert to media controller come
    on top of this patch that simply readds the driver to the new location under
    the new Kconfig symbols.
    
    To differentiate between the old driver and the new driver, I have renamed
    the new driver to Microchip ISC, renaming the Kconfig symbols as well, and
    all the mentions inside the driver.
    The only thing that remains common is the file
    include/linux/atmel-isc-media.h which is the ABI for the v4l2 custom
    controls that the ISC exposes.
    This file is used by both driver, so I kept it as-is.
    To further avoid confusion all files have been renamed and all functions
    named isc_* as well.
    The exported symbols have been renamed with added microchip_ prefix, to
    avoid symbol duplication with the old driver, and to avoid confusion.
    Other than that, I have fixed small checkpatch issues when readding the
    driver.
    Signed-off-by: default avatarEugen Hristev <eugen.hristev@microchip.com>
    Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    a5517d53
microchip-sama7g5-isc.c 16.5 KB