[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3f6289f9-d345-39a7-f0dd-9d5fa7c86e82@suse.de>
Date: Tue, 3 Jul 2018 18:40:41 +0200
From: Andreas Färber <afaerber@...e.de>
To: Mark Brown <broonie@...nel.org>
Cc: netdev@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Jian-Hong Pan <starnight@...cu.edu.tw>,
Jiri Pirko <jiri@...nulli.us>,
Marcel Holtmann <marcel@...tmann.org>,
"David S . Miller" <davem@...emloft.net>,
Matthias Brugger <mbrugger@...e.com>,
Janus Piwek <jpiwek@...oweurope.com>,
Michael Röder <michael.roeder@...et.eu>,
Dollar Chen <dollar.chen@...ec.com>,
Ken Yu <ken.yu@...wireless.com>,
Ben Whitten <ben.whitten@...rdtech.com>,
Steve deRosier <derosier@...il.com>, linux-spi@...r.kernel.org,
LoRa_Community_Support@...tech.com,
Hasnain Virk <Hasnain.Virk@....com>
Subject: Re: [RFC net-next 15/15] net: lora: Add Semtech SX1301
Am 03.07.2018 um 17:31 schrieb Mark Brown:
> On Tue, Jul 03, 2018 at 05:09:38PM +0200, Andreas Färber wrote:
>> Am 03.07.2018 um 16:50 schrieb Mark Brown:
>>> A register map would work just as well here, we already have plenty of
>>> devices that abstract at this level (most obviously the I2C/SPI devices
>>> that use it to offer both interfaces with a single core driver).
>
>> The address and data registers together form a two-byte SPI message!
>
>> It is transmitted by writing to the CS register.
>
>> The received data is afterwards available in another register.
>
> Right, but it seems from the code that the hardware understands that
> it's formatting register I/O and not just shifting in and out a byte
> stream which is what a SPI controller does. I'd not be surprised to
> learn that the register you're calling a chip select register is a
> strobe that initiates the transfer (and that this may be some of the
> difficulty you're having with handling it in the way the framework
> expects), the pattern with writing 1 followed immediately by 0 is a bit
> of a flag here.
Yeah, the current implementation assumes exactly that. :)
> I've seen such before hardware where I know it was intentionally
> designed that way so it wouldn't be totally surprising.
If we don't implement a spi_controller here, then IIUC we can't have
multiple spi_device implementations for the devices on the receiving
end, as they rely on a spi_controller for their APIs.
Do you have an alternative solution for abstraction? A regmap would seem
to require putting everything into a monolithic SX1301 driver despite
those connected chipsets actually being regular, external SPI chips that
could also be attached to non-SX1301 SPI masters.
Regards,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Powered by blists - more mailing lists