lkml.org 
[lkml]   [2023]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v11 2/2] spi: loongson: add bus driver for the loongson spi controller
    On Wed, May 24, 2023 at 11:42:34AM +0300, Andy Shevchenko wrote:
    > On Wed, May 24, 2023 at 10:52 AM zhuyinbo <zhuyinbo@loongson.cn> wrote:

    > > >> +#define LOONGSON_SPI_SPCR_REG 0x00
    > > >> +#define LOONGSON_SPI_SPSR_REG 0x01
    > > >> +#define LOONGSON_SPI_FIFO_REG 0x02
    > > >> +#define LOONGSON_SPI_SPER_REG 0x03
    > > >> +#define LOONGSON_SPI_PARA_REG 0x04
    > > >> +#define LOONGSON_SPI_SFCS_REG 0x05
    > > >> +#define LOONGSON_SPI_TIMI_REG 0x06

    > > > Where is this used outside of the main driver?

    > > These definitions are only used in core.c

    > Then the obvious question, why are they located in *.h?

    It's absolutely fine to put them in a header file, that's a perfectly
    normal way of writing code - it helps keep the driver a bit smaller by
    putting big piles of defines in a separate file, that can help make
    things a bit more manageable.
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2023-05-24 12:21    [W:2.287 / U:1.976 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site