• Cosmin Tanislav's avatar
    serial: max310x: implement I2C support · 2e1f2d9a
    Cosmin Tanislav authored
    I2C implementation on this chip has a few key differences
    compared to SPI, as described in previous patches.
     * extended register space access needs no extra logic
     * slave address is used to select which UART to communicate
       with
    
    To accommodate these differences, add an I2C interface config,
    set the RevID register address and implement an empty method
    for setting the GlobalCommand register, since no special handling
    is needed for the extended register space.
    
    To handle the port-specific slave address, create an I2C dummy
    device for each port, except the base one (UART0), which is
    expected to be the one specified in firmware, and create a
    regmap for each I2C device.
    Add minimum and maximum slave addresses to each devtype for
    sanity checking.
    
    Also, use a separate regmap config with no write_flag_mask,
    since I2C has a R/W bit in its slave address, and set the
    max register to the address of the RevID register, since the
    extended register space needs no extra logic.
    
    Finally, add the I2C driver.
    Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
    Signed-off-by: default avatarCosmin Tanislav <cosmin.tanislav@analog.com>
    Link: https://lore.kernel.org/r/20220605144659.4169853-5-demonsingur@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    2e1f2d9a
Kconfig 50.4 KB