linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roy Im <roy.im.opensource@diasemi.com>
To: Randy Dunlap <rdunlap@infradead.org>,
	Roy Im <roy.im.opensource@diasemi.com>,
	Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>,
	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>
Cc: 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 V17 3/3] Input: new da7280 haptic driver
Date: Fri, 24 Jul 2020 02:06:22 +0000	[thread overview]
Message-ID: <DB8PR10MB3436A78B153E566464AA07E085770@DB8PR10MB3436.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <ad4f8a07-9e78-ce97-021f-094210d99a3c@infradead.org>

On Fri July 24, 2020 5:55 AM, Randy Dunlap wrote: 
> On 7/23/20 8:01 AM, Roy Im wrote:
> > Adds support for the Dialog DA7280 LRA/ERM Haptic Driver with multiple
> > mode and integrated waveform memory and wideband support.
> > It communicates via an I2C bus to the device.
> >
> > Reviewed-by: Jes Sorensen <Jes.Sorensen@gmail.com>.
> >
> > Signed-off-by: Roy Im <roy.im.opensource@diasemi.com>
> >
> > ---
> >
> >
> >  drivers/input/misc/Kconfig  |   13 +
> >  drivers/input/misc/Makefile |    1 +
> >  drivers/input/misc/da7280.c | 1840
> > +++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 1854 insertions(+)
> >  create mode 100644 drivers/input/misc/da7280.c
> >
> 
> > diff --git a/drivers/input/misc/da7280.c b/drivers/input/misc/da7280.c
> > new file mode 100644 index 0000000..6e3ead5
> > --- /dev/null
> > +++ b/drivers/input/misc/da7280.c
> > @@ -0,0 +1,1840 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * DA7280 Haptic device driver
> > + *
> > + * Copyright (c) 2020 Dialog Semiconductor.
> > + * Author: Roy Im <Roy.Im.Opensource@diasemi.com>  */
> > +
> > +#include <linux/err.h>
> > +#include <linux/i2c.h>
> > +#include <linux/input.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/module.h>
> > +#include <linux/pwm.h>
> > +#include <linux/regmap.h>
> > +#include <linux/workqueue.h>
> > +#include <linux/uaccess.h>
> > +#include <linux/bitops.h>
> > +#include <linux/bitfield.h>
> > +
> 
> ...
> 
> 
> > +static int da7280_haptic_set_pwm(struct da7280_haptic *haptics, bool
> > +enabled) {
> > +	struct pwm_state state;
> > +	u64 period_mag_multi;
> > +	int error;
> > +
> > +	if (!haptics->gain && enabled) {
> > +		dev_err(haptics->dev,
> > +			"Please set the gain first for the pwm mode\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	pwm_get_state(haptics->pwm_dev, &state);
> > +	state.enabled = enabled;
> > +	if (enabled) {
> > +		period_mag_multi = (u64)state.period * haptics->gain;
> > +		period_mag_multi >>= MAX_MAGNITUDE_SHIFT;
> > +
> > +		/* The interpretation of duty cycle depends on the acc_en,
> > +		 * it should be between 50% and 100% for acc_en = 0.
> > +		 * See datasheet 'PWM mode' section.
> > +		 */
> 
> from coding-style.rst:
> 
> 	/*
> 	 * This is the preferred style for multi-line
> 	 * comments in the Linux kernel source code.
> 	 * Please use it consistently.
> 	 *
> 	 * Description:  A column of asterisks on the left side,
> 	 * with beginning and ending almost-blank lines.
> 	 */
> 
> (except for networking code)
> 
> Please fix multiple locations.
OK, I will fix them.

> 
> 
> thanks.
> --
> ~Randy

Kind regards,
Roy

      reply	other threads:[~2020-07-24  2:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1595516501.git.Roy.Im@diasemi.com>
2020-07-23 15:01 ` [PATCH V17 3/3] Input: new da7280 haptic driver Roy Im
2020-07-23 20:50   ` Randy Dunlap
2020-07-24  1:54     ` Roy Im
2020-07-24  2:56       ` Randy Dunlap
2020-07-24  5:47         ` Roy Im
2020-07-24  5:47           ` Roy Im
2020-07-24  5:48           ` Randy Dunlap
2020-07-24  5:48             ` Randy Dunlap
2020-07-23 20:55   ` Randy Dunlap
2020-07-24  2:06     ` 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=DB8PR10MB3436A78B153E566464AA07E085770@DB8PR10MB3436.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=rdunlap@infradead.org \
    --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).