• Stephan Gerhold's avatar
    extcon: sm5502: Reset registers during initialization · 69426350
    Stephan Gerhold authored
    On some devices (e.g. Samsung Galaxy A5 (2015)), the bootloader
    seems to keep interrupts enabled for SM5502 when booting Linux.
    Changing the cable state (i.e. plugging in a cable) - until the driver
    is loaded - will therefore produce an interrupt that is never read.
    
    In this situation, the cable state will be stuck forever on the
    initial state because SM5502 stops sending interrupts.
    This can be avoided by clearing those pending interrupts after
    the driver has been loaded.
    
    One way to do this is to reset all registers to default state
    by writing to SM5502_REG_RESET. This ensures that we start from
    a clean state, with all interrupts disabled.
    Suggested-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
    Signed-off-by: default avatarStephan Gerhold <stephan@gerhold.net>
    Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
    69426350
extcon-sm5502.h 10.7 KB