linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
To: Matheus Tavares Bernardino <matheus.bernardino@usp.br>
Cc: linux-iio@vger.kernel.org, kernel-usp@googlegroups.com,
	Victor Colombo <victorcolombo@gmail.com>
Subject: Re: Work plan on ad2s90
Date: Tue, 23 Oct 2018 10:45:54 +0100	[thread overview]
Message-ID: <20181023104554.155dcdcf@archlinux> (raw)
In-Reply-To: <CAHd-oW7fA_1H3jnUTOhs7VXJ3Zciq6j2WthAytE39NedYpTibg@mail.gmail.com>

On Fri, 19 Oct 2018 23:49:06 -0300
Matheus Tavares Bernardino <matheus.bernardino@usp.br> wrote:

> Hello everyone.
Hi Matheus.
> 
> I'm looking at the code and datasheet of ad2s90, trying to understand
> what is needed to move it to the main tree. I and my study group
> intend to work on it.

Great,

> 
> I do not understand all the necessary steps yet, but I will present
> here some brief items for discussion. I'd like to ask if I'm on the
> right track. All feedback will be much appreciated.
> 
> Some of the things that I think need to be done:
> - The IIO_CHAN_INFO_SCALE information mask is not set yet
Good point, that should be possible to establish for a resolver.

> - The read_raw function does not return the error code returned by
> spi_read on failure
Good spot (I missed that one at first glance ;)

> - There is no channel for velocity yet

I'm fairly sure that's because the device doesn't allow you to read that
via the serial bus.  There is an analog velocity outlook so you could
read it via an ADC and do the appropriate chaining of IIO devices
to provide that in this driver, but I wouldn't necessarily suggest doing
that without some hardware to test it.

> - There are two minor codestyle corrections to be made
> - Maybe it's possible to change the bit operations at the read_raw for
> a bitops.h function call
Not really.  It is a weird form of shifted endian conversion, so you
'could' do it that way and in theory make it a single shift in once case
and swap and shift in the other.  Probably not worth it though.

a few additions.
* Devicetree support with standard devicetree id table.

* The spi setup at the end of probe occurs 'after' the device is ready
for use.  A definite race condition that needs fixing.

* Some pointless variable initial assignments that are always overwritten.

> 
> Best regards,
> Matheus

Thanks,

Jonathan

  reply	other threads:[~2018-10-23 18:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-20  2:49 Work plan on ad2s90 Matheus Tavares Bernardino
2018-10-23  9:45 ` Jonathan Cameron [this message]
2018-10-26  6:35   ` Victor Colombo
2018-10-28 14:12     ` Jonathan Cameron
2018-11-04 16:34       ` Matheus Tavares Bernardino
2018-11-04 18:27         ` Jonathan Cameron

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=20181023104554.155dcdcf@archlinux \
    --to=jic23@jic23.retrosnub.co.uk \
    --cc=kernel-usp@googlegroups.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=matheus.bernardino@usp.br \
    --cc=victorcolombo@gmail.com \
    /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).