• Hans de Goede's avatar
    media: ov2680: Check for "powerdown" GPIO con-id before checking for "reset" GPIO con-id · e9305a23
    Hans de Goede authored
    The datasheet of the OV2680 labels the single GPIO to put the sensor in
    powersaving mode as XSHUTDN aka shutdown, _not_ reset.
    
    This is important because some boards have standardized sensor connectors
    which allow connecting various sensor modules. These connectors have both
    reset and powerdown signals and the powerdown signal is routed to
    the OV2680's XSHUTDN pin.
    
    On x86/ACPI multiple Bay Trail, Cherry Trail, Sky Lake and Kaby Lake models
    have an OV2680 connected to the ISP2 / IPU3. On these devices the GPIOS are
    not described in DT instead the GPIOs are described with an Intel specific
    DSM which labels them as either powerdown or reset. Often this DSM returns
    both reset and powerdown pins even though the OV2680 has only 1 such pin.
    
    For the ov2680 driver to work on these devices it must use the GPIO with
    "powerdown" as con-id, matching the XSHUTDN name from the datasheet.
    
    As for why "powerdown" vs say "shutdown" the ACPI DSM -> con-id mapping
    code is shared, so we must use standardized names and currently all of
    the following sensor drivers already use "powerdown":
    adv7180, gc0310, isl7998x, ov02a10, ov2659, ov5640, ov5648, ov5670,
    ov5693, ov7670, ov772x, ov7740, ov8858, ov8865 and ov9650 .
    
    Where as the hi846 driver is the lonely standout using "shutdown".
    
    Try the "powerdown" con-id first to make things work, falling back to
    "reset" to keep existing DT setups working.
    Acked-by: default avatarRui Miguel Silva <rmfrfs@gmail.com>
    Reviewed-by: default avatarDaniel Scally <dan.scally@ideasonboard.com>
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
    e9305a23
ov2680.c 21 KB