lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB8PR10MB3436A78B153E566464AA07E085770@DB8PR10MB3436.EURPRD10.PROD.OUTLOOK.COM>
Date:   Fri, 24 Jul 2020 02:06:22 +0000
From:   Roy Im <roy.im.opensource@...semi.com>
To:     Randy Dunlap <rdunlap@...radead.org>,
        Roy Im <roy.im.opensource@...semi.com>,
        Uwe Kleine-Koenig <u.kleine-koenig@...gutronix.de>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Brian Masney <masneyb@...tation.org>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Greg KH <gregkh@...uxfoundation.org>,
        Lee Jones <lee.jones@...aro.org>, Luca Weiss <luca@...tu.xyz>,
        Maximilian Luz <luzmaximilian@...il.com>,
        Pascal PAILLET-LME <p.paillet@...com>,
        Rob Herring <robh@...nel.org>,
        Samuel Ortiz <sameo@...ux.intel.com>,
        Thierry Reding <thierry.reding@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>
CC:     Support Opensource <Support.Opensource@...semi.com>,
        "linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-pwm@...r.kernel.org" <linux-pwm@...r.kernel.org>
Subject: RE: [PATCH V17 3/3] Input: new da7280 haptic driver

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@...il.com>.
> >
> > Signed-off-by: Roy Im <roy.im.opensource@...semi.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@...semi.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ