Re: [PATCH] gpio: gpio driver for max7301 SPI GPIO expander

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Guennadi Liakhovetski <g.liakhovetski@...>
Cc: <linux-kernel@...>, <spi-devel-general@...>
Date: Thursday, June 12, 2008 - 3:15 am

Some comments about one routine; presumably more to follow:


On Friday 06 June 2008, Guennadi Liakhovetski wrote:

That's not what you implement though ... what it needs is:

	- transfer #1:
		* select
		* write 16 bit command, discard rx data
		* deselect
	- transfer #2
		* select
		* write 16 bit command, saving rx data
		* deselect

That's from the data sheet.  Now, that *could* be implemented
with a single message ... or, as you do, with two messages.

You should at least correct the comment, if you don't want to
switch to a slightly faster single-message implementation.  :)



Actually it returns a 16 bit value... also, "successful" has one "l".
You seem to have forgotten to mask off the high byte ...




Take out this FIXME, and just replace it with a note that this relies
on the fact that TX always shifts out zeroes if there's no data specified.



Oh, and in the probe():


should be

	ret = spi_setup(spi);
	if (ret < 0)
		return ret;

It's quite possible that something get misconfigured, so you end up trying
to talk through a spi_master controller that doesn't support 16-bit words.

- Dave

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] gpio: gpio driver for max7301 SPI GPIO expander, Guennadi Liakhovetski, (Fri Jun 6, 10:37 am)
Re: [PATCH] gpio: gpio driver for max7301 SPI GPIO expander, David Brownell, (Thu Jun 12, 3:15 am)
[PATCH -mm] max7301: check spi_setup() return code, general ..., Guennadi Liakhovetski, (Thu Jun 12, 9:13 am)
Re: [PATCH] gpio: gpio driver for max7301 SPI GPIO expander, Guennadi Liakhovetski, (Thu Jun 12, 4:00 am)