• Serge Semin's avatar
    spi: dw: Put the driver entities naming in order · 725b0e3e
    Serge Semin authored
    Mostly due to a long driver history it's methods and macro names look a
    bit messy. In particularly that concerns the code their prefixes. A
    biggest part of the driver functions and macros have got the dw_spi/DW_SPI
    prefixes. But there are some entities which have been just
    "spi_/SPI_"-prefixed. Especially that concerns the CSR and their fields
    macro definitions. It makes the code harder to comprehend since such
    methods and macros can be easily confused with the global SPI-subsystem
    exports. In this case the only possible way to more or less quickly
    distinguish one naming space from another is either by context or by the
    argument type, which most of the times isn't that easy anyway. In addition
    to that a new DW SSI IP-core support has been added in the framework of
    commit e539f435 ("spi: dw: Add support for DesignWare DWC_ssi"), which
    introduced a new set or macro-prefixes to describe CTRLR0-specific fields
    and worsen the situation. Finally there are methods with
    no DW SPI driver-reference prefix at all, that make the code reading even
    harder. So in order to ease the driver hacking let's bring the code naming
    to a common base:
    1) Each method is supposed to have "dw_spi_" prefix so to be easily
    distinguished from the kernel API, e.g. SPI-subsystem methods and macros.
    (Exception is the local implementation of the readl/writel methods since
    being just the regspace accessors.)
    2) Each generically used macro should have DW_SPI_-prefix thus being
    easily comprehended as the local driver definition.
    3) DW APB SSI and DW SSI specific macros should have prefixes as DW_PSSI_
    and DW_HSSI_ respectively so referring to the system buses they support
    (APB and AHB similarly to the DT clocks naming like pclk, hclk).
    Signed-off-by: default avatarSerge Semin <Sergey.Semin@baikalelectronics.ru>
    Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
    Link: https://lore.kernel.org/r/20211115181917.7521-4-Sergey.Semin@baikalelectronics.ruSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    725b0e3e
spi-dw.h 8.1 KB