• Serge Semin's avatar
    i2c: designware: Use standard optional ref clock implementation · 27071b5c
    Serge Semin authored
    Even though the DW I2C controller reference clock source is requested by
    the method devm_clk_get() with non-optional clock requirement the way the
    clock handler is used afterwards has a pure optional clock semantic
    (though in some circumstances we can get a warning about the clock missing
    printed in the system console). There is no point in reimplementing that
    functionality seeing the kernel clock framework already supports the
    optional interface from scratch. Thus let's convert the platform driver to
    using it.
    
    Note by providing this commit we get to fix two problems. The first one
    was introduced in commit c62ebb3d ("i2c: designware: Add support for
    an interface clock"). It causes not having the interface clock (pclk)
    enabled/disabled in case if the reference clock isn't provided. The second
    problem was first introduced in commit b33af11d ("i2c: designware: Do
    not require clock when SSCN and FFCN are provided"). Since that
    modification the deferred probe procedure has been unsupported in case if
    the interface clock isn't ready.
    
    Fixes: c62ebb3d ("i2c: designware: Add support for an interface clock")
    Fixes: b33af11d ("i2c: designware: Do not require clock when SSCN and FFCN are provided")
    Signed-off-by: default avatarSerge Semin <Sergey.Semin@baikalelectronics.ru>
    Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
    Acked-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
    Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
    27071b5c
i2c-designware-platdrv.c 11.9 KB