Re: [PATCH 3/3] spi: dw: Drop default number of CS setting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 16, 2024 at 5:36 PM Serge Semin <fancer.lancer@xxxxxxxxx> wrote:
> On Thu, Feb 15, 2024 at 09:32:23PM +0200, Andy Shevchenko wrote:
> > On Thu, Feb 15, 2024 at 09:00:48PM +0300, Serge Semin wrote:
> > > DW APB/AHB SSI core now supports the procedure which automatically
> > > determines the number of native CS. Thus there is no longer point in
> > > defaulting to four CS if platform doesn't specify the real number.

the platform


...

> > > -   num_cs = 4;
> >
> > Simply update the default here?
> >
> > > -   device_property_read_u32(&pdev->dev, "num-cs", &num_cs);
>
> Do you suggest to simply:
>
> --- a/drivers/spi/spi-dw-mmio.c
> +++ b/drivers/spi/spi-dw-mmio.c
> @@ -364,8 +364,9 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
>                                      &dws->reg_io_width))
>                 dws->reg_io_width = 4;
>
> -       num_cs = 4;
> +       num_cs = 0;
>
>         device_property_read_u32(&pdev->dev, "num-cs", &num_cs);
>
> ?

Either this or do

num_cs = dw_spi_get_num_cs_from_hw(...);

What would work better WRT hardware?

...

> My idea was to make the statement looking closer to what is
> implemented for "reg-io-width" property. An alternative to what you
> suggest and to my patch can be converting the dw_spi::num_cs type to
> u32 and pass it to the device_property_read_u32() method directly:

...patch...

> What do you think? Would that be better?

I like the change, but again, are you sure it won't break any setups?
If yes, go for this!

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux