linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roy Im <roy.im.opensource@diasemi.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Roy Im" <roy.im.opensource@diasemi.com>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Brian Masney <masneyb@onstation.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	Lee Jones <lee.jones@linaro.org>, Luca Weiss <luca@z3ntu.xyz>,
	Maximilian Luz <luzmaximilian@gmail.com>,
	Pascal PAILLET-LME <p.paillet@st.com>,
	Rob Herring <robh@kernel.org>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Support Opensource <Support.Opensource@diasemi.com>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pwm@vger.kernel.org" <linux-pwm@vger.kernel.org>
Subject: RE: [PATCH v14 3/3] Input: new da7280 haptic driver
Date: Mon, 29 Jun 2020 00:29:21 +0000	[thread overview]
Message-ID: <DB8PR10MB33566ABB47A00C8A5F281BE1856E0@DB8PR10MB3356.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20200626155604.poqryunm7fyqmgek@pengutronix.de>

On Sat, June 27, 2020 12:56 AM, Uwe Kleine-König wrote:
> On Fri, Jun 26, 2020 at 01:17:29PM +0000, Roy Im wrote:
> > > On Fri, June 26, 2020 3:19 PM, Uwe Kleine-König wrote:
> > > Hello,
> > > from the PWM POV I'm happy now. Just a few minor comments that I noticed while checking the PWM details.
> >
> > Many thanks for your comments.
> >
> > >
> > > On Thu, Jun 25, 2020 at 01:59:29AM +0900, Roy Im wrote:
> > > > +		val = haptics->ps_seq_id << DA7280_PS_SEQ_ID_SHIFT |
> > > > +			haptics->ps_seq_loop << DA7280_PS_SEQ_LOOP_SHIFT;
> > >
> > > If you write this as:
> > >
> > > 	val = FIELD_PREP(DA7280_PS_SEQ_ID_MASK, haptics->ps_seq_id) |
> > > 		FIELD_PREP(DA7280_PS_SEQ_LOOP_MASK, haptics->ps_seq_loop);
> > >
> > > you get some additional checks for free and can drop all defines for ..._SHIFT .
> >
> > It is not difficult to update that as you advise, but I think having
> > the shift there explicitly makes it more readable, so most of the
> > drivers from my team have the defines(shift) up to now. I guess this
> > is a kind of subjective thing.
> > Do you think it is still necessary? Then I will update as you said.
> 
> No, from my side it's not a hard requirement (and after all I'm not the one who will take your commit). I personally like it better
> with FIELD_PREP, but I can still sleep if you don't agree :-)
> 
> What I don't like about having both ..._SHIFT and ..._MASK is that there is some duplication as ..._SHIFT can be calculated
> from ..._MASK:
> 
> 	#define LALA_SHIFT (ffs(LALA_MASK) - 1)

OK, I got it and I will update.

> 
> Best regards
> Uwe
> 
> --
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | https://www.pengutronix.de/ |

      reply	other threads:[~2020-06-29  0:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24 16:59 [PATCH v14 0/3] da7280: haptic driver submission Roy Im
2020-06-24 15:11 ` [PATCH v14 2/3] dt-bindings: input: Add document bindings for DA7280 Roy Im
2020-06-24 16:59 ` [PATCH v14 3/3] Input: new da7280 haptic driver Roy Im
2020-06-26  6:18   ` Uwe Kleine-König
2020-06-26 13:17     ` Roy Im
2020-06-26 15:56       ` Uwe Kleine-König
2020-06-29  0:29         ` Roy Im [this message]

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=DB8PR10MB33566ABB47A00C8A5F281BE1856E0@DB8PR10MB3356.EURPRD10.PROD.OUTLOOK.COM \
    --to=roy.im.opensource@diasemi.com \
    --cc=Support.Opensource@diasemi.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=luca@z3ntu.xyz \
    --cc=luzmaximilian@gmail.com \
    --cc=masneyb@onstation.org \
    --cc=p.paillet@st.com \
    --cc=robh@kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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).