public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jonas Mark (BT-FIR/ENG1)" <Mark.Jonas@de.bosch.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"hs@denx.de" <hs@denx.de>,
	"ZHU Yi (BT-FIR/ENG1-Zhu)" <Yi.Zhu5@cn.bosch.com>,
	"Jonas Mark (BT-FIR/ENG1)" <Mark.Jonas@de.bosch.com>
Subject: Re: [PATCH] Input: add bu21029 touch driver
Date: Tue, 27 Mar 2018 06:57:42 +0000	[thread overview]
Message-ID: <7ab56efbafd34c11968d8cef2369c6a5@de.bosch.com> (raw)

Hello Dmitry,

> > +++ b/drivers/input/touchscreen/bu21029_ts.c
> > @@ -0,0 +1,456 @@
> 
> Please add SPDX tag for the driver.

We will do.

> Please use GPIOD API (and include linux/gpio/consumer.h instead of
> of_gpio.h).

We will do the change.

> > +/* HW_ID1 Register (PAGE=0, ADDR=0x0E, Reset value=0x02, Read only)
> 
> Multi-line comments start with empty comment line:
> 
> /*
>  * Multi
>  * line.
>  */

Will be fixed.

> > +	/* calculate Rz (pressure resistance value) by equation:
> > +	 * Rz = Rx * (x/Q) * ((z2/z1) - 1), where
> > +	 * Rx is x-plate resistance,
> > +	 * Q  is the touch screen resolution (8bit = 256, 12bit = 4096)
> > +	 * x, z1, z2 are the measured positions.
> > +	 */
> > +	rz  = z2 - z1;
> > +	rz *= x;
> > +	rz *= bu21029->x_plate_ohms;
> > +	rz /= z1;
> > +	rz  = DIV_ROUND_CLOSEST(rz, SCALE_12BIT);
> > +	if (rz <= bu21029->max_pressure) {
> > +		input_report_abs(bu21029->in_dev, ABS_X, x);
> > +		input_report_abs(bu21029->in_dev, ABS_Y, y);
> > +		input_report_abs(bu21029->in_dev, ABS_PRESSURE, rz);
> 
> What is the values of pressure reported when finger is touching the
> surface? IOW is 'rz' pressure or resistance?

Rz is pressure measured in Ohms. That is, it is a resistance which
correlates with finger pressure.

I fear that I do not understand your question. Does ABS_PRESSURE have
to be reported in a specific unit, e.g. milli Newton? We thought that
it is a device specific scale and that it will be converted into a
calibrated value (just like the coordinates) in user space.

> > +	if (of_property_read_u32(np, "touchscreen-max-pressure", &val32))
> > +		bu21029->max_pressure = MAX_12BIT;
> > +	else
> > +		bu21029->max_pressure = val32;
> 
> Please use infrastructure form include/linux/input/touchscreen.h
> so that you handle different sizes and orientations.

Thank you for this recommendation. We will check it out and send a new
proposal.

> > +	in_dev->name       = DRIVER_NAME;
> > +	in_dev->id.bustype = BUS_I2C;
> > +	in_dev->dev.parent = &client->dev;
> 
> Not needed with devm_input_allocate_device().

We will have a look at the other drivers.

> > +static int bu21029_remove(struct i2c_client *client)
> > +{
> > +	struct bu21029_ts_data *bu21029 = i2c_get_clientdata(client);
> > +
> > +	del_timer_sync(&bu21029->timer);
> 
> If interrupt comes here kernel will be unhappy. You need to either work
> canceling timer into devm unwid stream (devm_add_action_or_reset()) or
> somehow make sure that you shut off interrupts before canceling the
> timer.

We will work on a solution. Thank you for spotting this.

> 
> > +
> > +	return 0;
> > +}

> > +static struct i2c_driver bu21029_driver = {
> > +	.driver = {
> > +		.name  = DRIVER_NAME,
> > +		.owner = THIS_MODULE,
> 
> Not needed.

OK, we will remove the .owner assignment.

Greetings,
Mark Jonas

Building Technologies, Panel Software Fire (BT-FIR/ENG1) 
Bosch Sicherheitssysteme GmbH | Postfach 11 11 | 85626 Grasbrunn | GERMANY | www.boschsecurity.com

Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart HRB 23118 
Aufsichtsratsvorsitzender: Stefan Hartung; Geschäftsführung: Gert van Iperen, Andreas Bartz, Thomas Quante, Bernhard Schuster

             reply	other threads:[~2018-03-27  6:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27  6:57 Jonas Mark (BT-FIR/ENG1) [this message]
2018-03-30 18:19 ` [PATCH] Input: add bu21029 touch driver Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2018-03-27  6:52 Jonas Mark (BT-FIR/ENG1)
2018-03-21 17:04 Mark Jonas
2018-03-26 22:24 ` Rob Herring
2018-03-26 22:39   ` Dmitry Torokhov
2018-03-26 22:53 ` Dmitry Torokhov

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=7ab56efbafd34c11968d8cef2369c6a5@de.bosch.com \
    --to=mark.jonas@de.bosch.com \
    --cc=Yi.Zhu5@cn.bosch.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hs@denx.de \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /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