[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aJn00MKH5lK6Zwsa@black.igk.intel.com>
Date: Mon, 11 Aug 2025 15:49:04 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Mukesh Kumar Savaliya <quic_msavaliy@...cinc.com>
Cc: Haixu Cui <quic_haixcui@...cinc.com>, broonie@...nel.org,
virtio-dev@...ts.oasis-open.org, viresh.kumar@...aro.org,
linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
hdanton@...a.com, qiang4.zhang@...ux.intel.com,
alex.bennee@...aro.org, quic_ztu@...cinc.com
Subject: Re: [RFC PATCH v4 2/3] virtio-spi: Add virtio-spi.h
On Tue, Apr 22, 2025 at 11:33:42AM +0530, Mukesh Kumar Savaliya wrote:
> On 4/1/2025 9:06 AM, Haixu Cui wrote:
[...]
> > +struct virtio_spi_config {
> > + /* # of /dev/spidev<bus_num>.CS with CS=0..chip_select_max_number -1 */
> > + __u8 cs_max_number;
> > + __u8 cs_change_supported;
> > +#define VIRTIO_SPI_RX_TX_SUPPORT_DUAL (1 << 0)
> > +#define VIRTIO_SPI_RX_TX_SUPPORT_QUAD (1 << 1)
> > +#define VIRTIO_SPI_RX_TX_SUPPORT_OCTAL (1 << 2)
> Can use BIT(x) ?
No.
> > + __u8 tx_nbits_supported;
> > + __u8 rx_nbits_supported;
> > + __le32 bits_per_word_mask;
> > +#define VIRTIO_SPI_MF_SUPPORT_CPHA_0 (1 << 0)
> > +#define VIRTIO_SPI_MF_SUPPORT_CPHA_1 (1 << 1)
> > +#define VIRTIO_SPI_MF_SUPPORT_CPOL_0 (1 << 2)
> > +#define VIRTIO_SPI_MF_SUPPORT_CPOL_1 (1 << 3)
> > +#define VIRTIO_SPI_MF_SUPPORT_CS_HIGH (1 << 4)
> > +#define VIRTIO_SPI_MF_SUPPORT_LSB_FIRST (1 << 5)
> > +#define VIRTIO_SPI_MF_SUPPORT_LOOPBACK (1 << 6)
> All with BIT(x) ?
No. There is no such macro in UAPI. There is another one available, though.
Check the spi.h UAPI header for the details.
> > + __le32 mode_func_supported;
> > + __le32 max_freq_hz;
> > + __le32 max_word_delay_ns;
> > + __le32 max_cs_setup_ns;
> > + __le32 max_cs_hold_ns;
> > + __le32 max_cs_inactive_ns;
> > +};
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists