From: Haixu Cui <quic_haixcui@quicinc.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: <andriy.shevchenko@intel.com>, <harald.mommer@oss.qualcomm.com>,
<quic_msavaliy@quicinc.com>, <broonie@kernel.org>,
<virtio-dev@lists.linux.dev>, <viresh.kumar@linaro.org>,
<linux-spi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<hdanton@sina.com>, <qiang4.zhang@linux.intel.com>,
<alex.bennee@linaro.org>, <quic_ztu@quicinc.com>
Subject: Re: [PATCH v4 2/3] virtio-spi: Add virtio-spi.h
Date: Mon, 25 Aug 2025 17:19:03 +0800 [thread overview]
Message-ID: <1a63f5f9-add0-4a22-b01c-2f0c8d9efcec@quicinc.com> (raw)
In-Reply-To: <20250821044351-mutt-send-email-mst@kernel.org>
On 8/21/2025 4:45 PM, Michael S. Tsirkin wrote:
>> +
>> +/* Sample data on trailing clock edge */
>> +#define VIRTIO_SPI_CPHA _BITUL(0)
>> +/* Clock is high when IDLE */
>> +#define VIRTIO_SPI_CPOL _BITUL(1)
>> +/* Chip Select is active high */
>> +#define VIRTIO_SPI_CS_HIGH _BITUL(2)
>> +/* Transmit LSB first */
>> +#define VIRTIO_SPI_MODE_LSB_FIRST _BITUL(3)
>> +/* Loopback mode */
>> +#define VIRTIO_SPI_MODE_LOOP _BITUL(4)
>
> It is generally preferable to have an enum with just bit
> numbers.
>
>
> E.g.
>
> enum {
> VIRTIO_SPI_F_CPHA = 0,
> }
>
>
> Userspace can add _BITUL wrappers itself if it
> wants.
>
>
Hi Michael,
Thank you for the suggestion regarding the bit definitions.
Would it be acceptable to keep the current macro definitions with
_BITUL() because these macros are also used within the virtio SPI driver
itself?
Looking forward to your guidance.
Best regards,
Haixu Cui
next prev parent reply other threads:[~2025-08-25 9:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-20 8:49 [PATCH v4 0/3] Virtio SPI Linux driver Haixu Cui
2025-08-20 8:49 ` [PATCH v4 1/3] virtio: Add ID for virtio SPI Haixu Cui
2025-08-20 8:49 ` [PATCH v4 2/3] virtio-spi: Add virtio-spi.h Haixu Cui
2025-08-21 8:42 ` Michael S. Tsirkin
2025-08-25 9:12 ` Haixu Cui
2025-08-28 10:19 ` Michael S. Tsirkin
2025-08-21 8:45 ` Michael S. Tsirkin
2025-08-25 9:19 ` Haixu Cui [this message]
2025-08-28 10:34 ` Michael S. Tsirkin
2025-09-03 6:55 ` Haixu Cui
2025-09-03 7:00 ` Haixu Cui
[not found] ` <aKXaI0SAAMaHMZM9@smile.fi.intel.com>
2025-08-25 8:35 ` Haixu Cui
2025-08-20 8:49 ` [PATCH v4 3/3] SPI: Add virtio SPI driver Haixu Cui
2025-08-21 2:22 ` kernel test robot
[not found] ` <aKXePVShWzXGi8yP@smile.fi.intel.com>
2025-08-25 9:01 ` Haixu Cui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1a63f5f9-add0-4a22-b01c-2f0c8d9efcec@quicinc.com \
--to=quic_haixcui@quicinc.com \
--cc=alex.bennee@linaro.org \
--cc=andriy.shevchenko@intel.com \
--cc=broonie@kernel.org \
--cc=harald.mommer@oss.qualcomm.com \
--cc=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=mst@redhat.com \
--cc=qiang4.zhang@linux.intel.com \
--cc=quic_msavaliy@quicinc.com \
--cc=quic_ztu@quicinc.com \
--cc=viresh.kumar@linaro.org \
--cc=virtio-dev@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox