linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Sverdlin, Alexander" <alexander.sverdlin@siemens.com>
To: "broonie@kernel.org" <broonie@kernel.org>
Cc: "linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	"lukas@wunner.de" <lukas@wunner.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linus.walleij@linaro.org" <linus.walleij@linaro.org>
Subject: Re: [PATCH] spi: spidev: mask SPI_CS_HIGH in SPI_IOC_RD_MODE
Date: Wed, 30 Nov 2022 15:43:27 +0000	[thread overview]
Message-ID: <ae71f8d6acac42f7e85fd111259e578305e938ed.camel@siemens.com> (raw)
In-Reply-To: <Y4dvdzVQZDEt09+p@sirena.org.uk>

Hello Mark,

On Wed, 2022-11-30 at 14:57 +0000, Mark Brown wrote:
> >   	/* read requests */
> >   	case SPI_IOC_RD_MODE:
> > -		retval = put_user(spi->mode & SPI_MODE_MASK,
> > -					(__u8 __user *)arg);
> > +		tmp = spi->mode;
> > +
> > +		{
> > +			struct spi_controller *ctlr = spi-
> > >controller;
> > +
> > +			if (ctlr->use_gpio_descriptors && ctlr-
> > >cs_gpiods &&
> > +			    ctlr->cs_gpiods[spi->chip_select])
> > +				tmp &= ~SPI_CS_HIGH;
> > +		}
> > +
> > +		retval = put_user(tmp & SPI_MODE_MASK, (__u8
> > __user *)arg);
> >   		break;
> >   	case SPI_IOC_RD_MODE32:
> >   		retval = put_user(spi->mode & SPI_MODE_MASK,
> 
> What about SPI_IOC_RD_MODE_32?  On the write path the code is
> shared...

you are right, thanks for this hint!
I'll re-send if there are no objections to this approach in general.

-- 
Alexander Sverdlin
Siemens AG
www.siemens.com

  reply	other threads:[~2022-11-30 15:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30 14:39 [PATCH] spi: spidev: mask SPI_CS_HIGH in SPI_IOC_RD_MODE A. Sverdlin
2022-11-30 14:57 ` Mark Brown
2022-11-30 15:43   ` Sverdlin, Alexander [this message]
2022-11-30 16:25     ` Mark Brown

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=ae71f8d6acac42f7e85fd111259e578305e938ed.camel@siemens.com \
    --to=alexander.sverdlin@siemens.com \
    --cc=broonie@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lukas@wunner.de \
    /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;
as well as URLs for NNTP newsgroup(s).