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]
Date:	Thu, 20 Mar 2014 09:37:19 +0000
From:	Mark Rutland <mark.rutland@....com>
To:	Lothar Waßmann <LW@...o-electronics.de>
Cc:	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Fugang Duan <B38611@...escale.com>,
	"grant.likely@...aro.org" <grant.likely@...aro.org>,
	Henrik Rydberg <rydberg@...omail.se>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Jingoo Han <jg1.han@...sung.com>,
	Kumar Gala <galak@...eaurora.org>,
	Pawel Moll <Pawel.Moll@....com>,
	Rob Herring <robh+dt@...nel.org>,
	Rob Landley <rob@...dley.net>,
	Sachin Kamat <sachin.kamat@...aro.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Simon Budig <simon.budig@...nelconcepts.de>
Subject: Re: [PATCHv4 2/5] Input: edt-ft5x06: Add DT support

On Wed, Mar 19, 2014 at 01:09:20PM +0000, Lothar Waßmann wrote:
> 
> Signed-off-by: Lothar Waßmann <LW@...O-electronics.de>
> ---
>  .../bindings/input/touchscreen/edt-ft5x06.txt      |   41 ++++++
>  drivers/input/touchscreen/edt-ft5x06.c             |  144 +++++++++++++++-----
>  2 files changed, 154 insertions(+), 31 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
> 
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
> new file mode 100644
> index 0000000..e5adc76
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
> @@ -0,0 +1,41 @@
> +FocalTech EDT-FT5x06 Polytouch driver
> +=====================================
> +
> +Required properties:
> + - compatible:  "edt,edt-ft5x06"

Is the 'x' part of a particular product name, or is this a class of
devices?

It's preferable to have a specific string which another similar variants
can claim compatibility with (while also additionally having a more
specific string), as this makes it possible to handle variants more
specially in future, target workarounds, etc.

> + - reg:         I2C slave address of the chip (0x38)
> + - interrupt-parent: a phandle pointing to the interrupt controller
> +                     serving the interrupt for this chip
> + - interrupts:       interrupt specification for this chip

How many? What are they for?

> +
> +Optional properties:
> + - reset-gpios: GPIO specification for the RESET input
> + - wake-gpios:  GPIO specification for the WAKE input
> +
> + - pinctrl-names: should be "default"
> + - pinctrl-0:   a phandle pointing to the pin settings for the
> +                control gpios

These all looks fine.

> +
> + - threshold:   allows setting the "click"-threshold in the range
> +                from 20 to 80.
> +
> + - gain:        allows setting the sensitivity in the range from 0 to
> +                31. Note that lower values indicate higher
> +                sensitivity.
> +
> + - offset:      allows setting the edge compensation in the range from
> +                0 to 31.

I can see why the sane values for these may differ between boards.

> + - report_rate: allows setting the report rate in the range from 3 to
> +                14.

However, why can the kernel not decide the report rate? This doesn't
sound like something that needs to vary per-board.

Also, s/_/-/ in property names, please.

[...]

> +#define EDT_GET_PROP(name, reg) {					\
> +	const u32 *prop = of_get_property(np, #name, NULL);		\
> +	if (prop)							\
> +		edt_ft5x06_register_write(tsdata, reg, be32_to_cpu(*prop)); \
> +}

Use of_property_read_u32, it'll handle endianness conversion for you.

Use of of_get_property is almost always wrong.

Cheers,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ