linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Roy Im <roy.im.opensource@diasemi.com>
Cc: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Brian Masney <masneyb@onstation.org>,
	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-kernel@vger.kernel.org,
	linux-pwm@vger.kernel.org
Subject: Re: [PATCH v18 3/3] Input: new da7280 haptic driver
Date: Tue, 28 Jul 2020 23:36:38 -0700	[thread overview]
Message-ID: <20200729063638.GY1665100@dtor-ws> (raw)
In-Reply-To: <23b3470401ec5cf525add8e1227cb67586b9f294.1595991580.git.Roy.Im@diasemi.com>

Hi Roy,

On Wed, Jul 29, 2020 at 11:59:40AM +0900, 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.

A few questions/suggestions...

> 
> Reviewed-by: Jes Sorensen <Jes.Sorensen@gmail.com>.
> 
> Signed-off-by: Roy Im <roy.im.opensource@diasemi.com>
> 
> ---
> v18:
> 	- Corrected comments in Kconfig
> 	- Updated to preferred style for multi line comments in c file.
> v17:
> 	- fixed an issue.
> v16:
> 	- Corrected some code and updated description in Kconfig.
> v15:
> 	- Removed some defines and updated some comments.
> v14:
> 	- Updated pwm related code, alignments and comments.
> v13:
> 	- Updated some conditions in pwm function and alignments.
> v12: No changes.
> v11: 
> 	- Updated the pwm related code, comments and typo.
> v10: 
> 	- Updated the pwm related function and added some comments.
> v9: 
> 	- Removed the header file and put the definitions into the c file.
> 	- Updated the pwm code and error logs with %pE

I believe the %pE is to format an escaped buffer, you probably want to
%pe (lowercase) to print errors. I am also not quite sure if we want to
use it in cases when we have non-pointer error, or we should stick with
%d as most of the kernel does.

...
> +
> +/* DA7280_ACTUATOR3 (Address 0x0e) */
> +#define DA7280_IMAX_MASK			(31 << 0)

We have GENMASK(h,l) macro in include/linux/bits.h that could be used
here and in other mask definitions.

> +
> +	bool legacy;
> +	struct delayed_work work_duration;
> +	struct work_struct work_playback;
> +	struct work_struct work_setgain;

How do we ensure that all these works do not clash with each other?
As far as I can see we could have the "duration" work executing
simultaneously with playback...

> +static int da7280_haptics_playback(struct input_dev *dev,
> +				   int effect_id, int val)
> +{
> +	struct da7280_haptic *haptics = input_get_drvdata(dev);
> +
> +	if (!haptics->op_mode) {
> +		dev_warn(haptics->dev,
> +			 "Any effects are not uploaded yet\n");

"No effects have been uploaded"?

> +		return -EPERM;

I'd say EINVAL.

> +static DEVICE_ATTR_RW(ps_seq_id);
> +static DEVICE_ATTR_RW(ps_seq_loop);
> +static DEVICE_ATTR_RW(gpi_seq_id0);
> +static DEVICE_ATTR_RW(gpi_seq_id1);
> +static DEVICE_ATTR_RW(gpi_seq_id2);
> +static DEVICE_ATTR_WO(patterns);

Should this be a binary attribute instead of having string parsing in
the kernel?

Thanks.

-- 
Dmitry

  reply	other threads:[~2020-07-29  6:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29  2:59 [PATCH v18 0/3] da7280: haptic driver submission Roy Im
2020-07-29  2:59 ` [PATCH v18 3/3] Input: new da7280 haptic driver Roy Im
2020-07-29  6:36   ` Dmitry Torokhov [this message]
2020-07-29  7:21     ` Uwe Kleine-König
2020-07-30  5:06       ` Dmitry Torokhov
2020-07-30  6:16         ` Uwe Kleine-König
2020-07-30  6:34           ` Dmitry Torokhov
2020-07-30  7:00             ` Uwe Kleine-König
2020-07-30  8:30           ` Andy Shevchenko
2020-07-30 16:21             ` Dmitry Torokhov
2020-07-29 14:09     ` Roy Im
2020-07-30  5:10       ` Dmitry Torokhov
2020-07-31 13:26         ` Roy Im
2020-08-02 11:54     ` Pavel Machek
2020-08-03  1:13       ` Roy Im
2020-07-29  2:59 ` [PATCH v18 2/3] dt-bindings: input: Add document bindings for DA7280 Roy Im

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=20200729063638.GY1665100@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=bgolaszewski@baylibre.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=roy.im.opensource@diasemi.com \
    --cc=sameo@linux.intel.com \
    --cc=support.opensource@diasemi.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).