public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Christopher Heiny <cheiny@synaptics.com>
Cc: Jean Delvare <khali@linux-fr.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Linux Input <linux-input@vger.kernel.org>,
	Allie Xiong <axiong@synaptics.com>, Vivian Ly <vly@synaptics.com>,
	Daniel Rosenberg <daniel.rosenberg@synaptics.com>,
	Alexandra Chin <alexandra.chin@tw.synaptics.com>,
	Joerie de Gram <j.de.gram@gmail.com>,
	Wolfram Sang <w.sang@pengutronix.de>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Linus Walleij <linus.walleij@stericsson.com>
Subject: Re: [PATCH 04/05] input: RMI4 F01 device control
Date: Thu, 31 Jan 2013 00:08:59 -0800	[thread overview]
Message-ID: <20130131080859.GA4356@core.coreip.homeip.net> (raw)
In-Reply-To: <1358557965-29065-5-git-send-email-cheiny@synaptics.com>

Hi Chris,

On Fri, Jan 18, 2013 at 05:12:44PM -0800, Christopher Heiny wrote:
> In addition to the changes described in 0/0 of this patchset, this patch
> includes device serialization updated to conform to the latest RMI4
> specification.

I was looking at the various aspects of the RMI4 patchset, trying to
fix the issues that I see, but there is one big issue that I simply do
not have time to tackle - the driver is completely broken on big endian
architectures due to reliance on bitfileds when exchanging the data with
the device.

Consider the following structures:

>  struct f01_device_status {
> -	u8 status_code:4;
> +	enum rmi_device_status status_code:4;
>  	u8 reserved:2;
>  	u8 flash_prog:1;
>  	u8 unconfigured:1;
> @@ -159,4 +136,113 @@ struct f01_device_control_0 {
>  	u8 configured:1;
>  } __attribute__((__packed__));
>  
> +/**
> + * @reset - set this bit to force a firmware reset of the sensor.
> + */
> +struct f01_device_commands {
> +	u8 reset:1;
> +	u8 reserved:7;
> +};
> +

To make this work on BE boxes you either need to add #ifdefs to the
structures reversing the order of fields or use bit shifts and masks to
get/set specific bits in bytes.

I tried converting F01 code (you can see the [likely broken as I can't
test] result in my tree), but I really do not have time for F11.

Thanks.

-- 
Dmitry

  reply	other threads:[~2013-01-31  8:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-19  1:12 [PATCH 00/05] input: RMI4 Synaptics RMI4 Touchscreen Driver Christopher Heiny
2013-01-19  1:12 ` [PATCH 01/05] input: RMI4 public header file Christopher Heiny
2013-01-19  1:12 ` [PATCH 02/05] input: RMI4 core files Christopher Heiny
2013-01-19  1:12 ` [PATCH 03/05] input: RMI4 I2C physical layer Christopher Heiny
2013-01-19  1:12 ` [PATCH 04/05] input: RMI4 F01 device control Christopher Heiny
2013-01-31  8:08   ` Dmitry Torokhov [this message]
2013-01-31 21:14     ` Christopher Heiny
2013-02-07 23:19       ` Christopher Heiny
2013-01-19  1:12 ` [PATCH 05/05] input: RMI4 F11 2D input Christopher Heiny
2014-02-04  7:56 ` [PATCH 00/05] input: RMI4 Synaptics RMI4 Touchscreen Driver Linus Walleij
2014-02-04 20:20   ` Christopher Heiny

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=20130131080859.GA4356@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=alexandra.chin@tw.synaptics.com \
    --cc=axiong@synaptics.com \
    --cc=cheiny@synaptics.com \
    --cc=daniel.rosenberg@synaptics.com \
    --cc=j.de.gram@gmail.com \
    --cc=khali@linux-fr.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=vly@synaptics.com \
    --cc=w.sang@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