linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ardelean, Alexandru" <alexandru.Ardelean@analog.com>
To: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"djunho@gmail.com" <djunho@gmail.com>
Cc: "lkcamp@lists.libreplanetbr.org" <lkcamp@lists.libreplanetbr.org>
Subject: Re: Doubts in getting started with the Analog AD7928 driver
Date: Tue, 17 Sep 2019 06:24:52 +0000	[thread overview]
Message-ID: <e2db511fcaad2d1d08180995e836c22791b9e3b6.camel@analog.com> (raw)
In-Reply-To: <CAKxs2cC1Bqoc6kyz9Cidf_3MHQA-6ZAQJns2pU2CqJ-pMj9ZKA@mail.gmail.com>

On Mon, 2019-09-16 at 20:50 -0300, Daniel Junho wrote:
> [External]
> 
> Hello everybody.
> 
> I am still learning about kernel developing. I would like to try to
> develop a device driver for the AD7928 [1], from Analog Device.
> 
> Can someone give some words to guide me?
> 
> I was thinking about forking the analog kernel repo [2] but I don't
> know to which branch should I commit to when doing a pull request. Or
> if this is the correct way for the devices from Analog.
> 

Hey,

Thanks for the interest in writing the driver for this.

In some cases, some new parts may have an existing driver available already
that can be re-used partially or completely.

You're in luck.
There is driver seems to be partially implemented via 
drivers/iio/adc/ad7923.c

I've done only a minor/quick check but the control register bits are
compatible for the AD7928 as well.

Typically, you can extend that driver and add the new parts and test them.

So, my suggestion would be:
1. Get an eval-board or a AD7928 part; depending on the case we could help
with this
2. Try to set it up with a Raspberry Pi with the eval board
   a. it looks to me that you need a 7V-9V power-supply
   b. you can hook the SPI to the test-points on the eval board
3. Write a basic device-tree overlay ; you can adapt something from other
examples.
Look here:
https://github.com/analogdevicesinc/linux/blob/rpi-4.19.y/arch/arm/boot/dts/overlays/Makefile
Usually  rpi-adXXX.dts  are ADI parts.
4. Enable the driver for the kernel.
If using the ADI kernel, there's a guide here for RPi.
https://wiki.analog.com/resources/tools-software/linux-build/generic/raspberrypi
Check the branch that matches your Raspbian image (rpi-4.19.y is the
latest)
5. Build the kernel
6. Write it to the SD-card image
7. Test
8. Modify & repeat

Thanks
Alex

> [1] https://www.analog.com/en/products/ad7928.html
> [2] https://github.com/analogdevicesinc/linux
> 
> Daniel Junho

  reply	other threads:[~2019-09-17  6:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKxs2cBVnL=6ZNbKgYRppaeUBM3xuog5BHdtmJHRxwttSfjugg@mail.gmail.com>
2019-09-16 23:50 ` Doubts in getting started with the Analog AD7928 driver Daniel Junho
2019-09-17  6:24   ` Ardelean, Alexandru [this message]
2019-09-18  0:47     ` Daniel Junho
2019-09-18  6:13       ` Ardelean, Alexandru
2019-11-28 15:13         ` Daniel Junho
2019-11-28 17:49           ` Daniel Junho
2019-11-28 19:16             ` Lars-Peter Clausen
2019-11-30 15:44               ` Daniel Junho
2019-11-30 16:18                 ` Fabio Estevam
2019-11-28 19:23           ` 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=e2db511fcaad2d1d08180995e836c22791b9e3b6.camel@analog.com \
    --to=alexandru.ardelean@analog.com \
    --cc=djunho@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=lkcamp@lists.libreplanetbr.org \
    /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).