linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
To: Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Rohit Sarkar <rohitsarkar5398@gmail.com>,
	linux-iio <linux-iio@vger.kernel.org>
Subject: Re: [PATCH] iio: imu: inv_mpu6050: add debugfs register r/w interface
Date: Sat, 21 Mar 2020 18:31:54 +0000	[thread overview]
Message-ID: <20200321183154.128d8920@archlinux> (raw)
In-Reply-To: <MN2PR12MB4422876C03060876ACBB4414C4F40@MN2PR12MB4422.namprd12.prod.outlook.com>

On Thu, 19 Mar 2020 11:08:44 +0000
Jean-Baptiste Maneyrol <JManeyrol@invensense.com> wrote:

> Hello,
> 
> iio debugfs register interface is quite handy because we can read a single register and write a value.
> 
> regmap debugfs is only a dump of all registers, as far as I know (may have missed something).

So this is something Mark has discussed before around regmap
and more generally IIRC.  The issue is that a write
interface does make it somewhat easy to do really nasty things
in some drivers that use regmap (to the extent of setting boards
on fire etc).  For IIO we are much safer - the worst you can do
is break the IIO driver.

I've never been that fussed myself about the debugfs interfaces
as it's easy to hack them in when needed for actual debugging, but
have taken the view that if someone has enough of a usecase to
want to add them to a particular driver, then it's up to them.

Jonathan

> 
> Thanks.
> JB
> 
> From: Andy Shevchenko <andy.shevchenko@gmail.com>
> 
> Sent: Thursday, March 19, 2020 11:24
> 
> To: Rohit Sarkar <rohitsarkar5398@gmail.com>
> 
> Cc: linux-iio <linux-iio@vger.kernel.org>; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>; Jonathan Cameron <jic23@kernel.org>; Hartmut Knaack <knaack.h@gmx.de>; Lars-Peter Clausen <lars@metafoo.de>; Peter Meerwald-Stadler <pmeerw@pmeerw.net>;
>  Jean-Baptiste Maneyrol <JManeyrol@invensense.com>; Andy Shevchenko <andriy.shevchenko@linux.intel.com>; Linus Walleij <linus.walleij@linaro.org>
> 
> Subject: Re: [PATCH] iio: imu: inv_mpu6050: add debugfs register r/w interface
> 
>  
> 
> 
>  CAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> 
> 
> On Thu, Mar 19, 2020 at 8:10 AM Rohit Sarkar <rohitsarkar5398@gmail.com> wrote:
> 
> >  
> 
> > The iio debugfs interface provides direct access to read and write device  
> 
> > registers if debugfs is enabled.  
> 
> 
> 
> But regmap API provides at least reading facility. Isn't it enough?
> 
> 
> 
> ...
> 
> 
> 
> >  static const struct iio_info mpu_info = {  
> 
> >         .read_raw = &inv_mpu6050_read_raw,  
> 
> >         .write_raw = &inv_mpu6050_write_raw,  
> 
> >         .write_raw_get_fmt = &inv_write_raw_get_fmt,  
> 
> >         .attrs = &inv_attribute_group,  
> 
> >         .validate_trigger = inv_mpu6050_validate_trigger,  
> 
> 
> 
> > +       .debugfs_reg_access = &inv_mpu6050_reg_access  
> 
> 
> 
> Leaving comma is helpful for future development.
> 
> 
> 
> >  };  
> 
> 
> 
> 
> 


  reply	other threads:[~2020-03-21 18:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19  6:07 [PATCH] iio: imu: inv_mpu6050: add debugfs register r/w interface Rohit Sarkar
2020-03-19 10:24 ` Andy Shevchenko
2020-03-19 11:08   ` Jean-Baptiste Maneyrol
2020-03-21 18:31     ` Jonathan Cameron [this message]
2020-03-21 19:53       ` Andy Shevchenko
2020-03-27 10:56         ` Jean-Baptiste Maneyrol
2020-03-27 12:42           ` Rohit Sarkar

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=20200321183154.128d8920@archlinux \
    --to=jic23@jic23.retrosnub.co.uk \
    --cc=JManeyrol@invensense.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=rohitsarkar5398@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).