linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Dyer <nick.dyer@itdev.co.uk>
To: Mark Brown <broonie@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Daniel Kurtz <djkurtz@chromium.org>,
	Henrik Rydberg <rydberg@euromail.se>,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	Alan.Bowens@atmel.com, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org, pmeerw@pmeerw.net,
	bleung@chromium.org, olofj@chromium.org
Subject: Re: [PATCH 10/53] Input: atmel_mxt_ts - Add memory access interface via sysfs
Date: Tue, 11 Jun 2013 11:39:37 +0100	[thread overview]
Message-ID: <51B6FE69.6060505@itdev.co.uk> (raw)
In-Reply-To: <20130607164700.GW31367@sirena.org.uk>

Mark Brown wrote:
> I don't think you're using the usual definition of "register map" here.
> You seem to be switching between talking about this object model the
> device has and device registers - perhaps the objects are also registers
> sometimes?

Yes, in Atmel Object Protocol "instances" of "objects" do each have an
assigned register range (they do also correspond to modules of code in the
firmware).

This document is a better description of it than I can give:
http://www.atmel.com/Images/Atmel-9626-AT42-QTouch-BSW-AT421085-Object-Protocol-Guide_Datasheet.pdf

That's a rather old chip now, but the same system is used throughout
maXTouch series chips, and also on some non-touch chips now.

> You appear to be assuming a great deal of familiarity with the specifics
> of this device here.  Where does all thi stuff about reinitialsing the
> device come from?  What are these dependencies and what does all this
> have to do with setting parameters?

I think you're uncomfortable with the idea of giving full access by
default. I'm not sure how I can convince you that that is OK by design, I
can only assert it.

Essentially, the device is designed (and tested) on the assumption that
touch processing can be going on whilst various parameters are changed in a
live fashion. If poking around in the register map caused it to lock up or
behave oddly then that would be considered a firmware bug. In general it
will fail gracefully - for example if you write a configuration that is
invalid it will just stop and emit a CFGERR message.

In my previous messages in this thread, I tried to answer some of the
particular cases in which you might expect the driver to have to cope with
the configuration changing "under it". It's difficult to be exhaustive
without having to impart a huge amount of domain knowledge first.

In the patch under discussion, the driver would have to trap writes to
particular registers and take appropriate action, or provide a mechanism to
be told that it needs to reinitialise itself. In practice (it's been widely
tested outside of mainline) I haven't found a case where doing this has
been essential, although there's nothing about this patch that stops us
adding them.

The absolute worst thing that I can think of is that you can try to beat
the interrupt handler to reading the "message processor" registers, which
would possibly leave touches stuck on screen. But even that operation is
useful in debugging interrupt line issues.

>> OK. I think that the ABI offered to the application layer should also be
>> object protocol, implemented over a binary attribute, which is what the
>> patch under discussion does. Is the problem that I need to provide better
>> documentation of object protocol?
> 
> As Greg says you do need to document any new sysfs ABIs you're adding
> anyway.  However if this is some stateful protocol you're implementing
> then does it really map onto sysfs well, sysfs attributes are normally
> more just data values?

Perhaps it is a little unusual. There was an older ioctl-based
implementation, but I think that would be rejected for different reasons.

> Won't the driver end up getting into a fight with the magic userspace
> stuff if the driver has no idea what the magic userspace is doing?  How
> would suspend and resume work?

On suspend the driver puts chip into "deep sleep" where touch acquisition
is halted and minimal power consumed. But it will still come out of its
sleep state temporarily to service I2C comms if necessary (although one
particular family requires that I2C retry for this case).

  reply	other threads:[~2013-06-11 10:39 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-05 17:36 Atmel updates to atmel_mxt_ts touch controller driver - v5 Daniel Kurtz <djkurtz@chromium.org>, Henrik Rydberg <rydberg@euromail.se>, Joonyoung Shim <jy0922.shim@samsung.com>, Alan.Bowens@atmel.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, pmeerw@pmeerw.net, bleung@chromium.org, olofj@chromium.org Nick Dyer
2013-06-05 17:36 ` [PATCH 01/53] Input: atmel_mxt_ts - Remove unnecessary platform data Nick Dyer
2013-06-05 17:36 ` [PATCH 02/53] Input: atmel_mxt_ts - Improve T19 GPIO keys handling Nick Dyer
2013-06-05 17:36 ` [PATCH 03/53] Input: atmel_mxt_ts - Return IRQ_NONE when interrupt handler fails Nick Dyer
2013-06-05 17:36 ` [PATCH 04/53] Input: atmel_mxt_ts - define helper functions for size and instances Nick Dyer
2013-06-05 17:36 ` [PATCH 05/53] Input: atmel_mxt_ts - Select FW_LOADER for firmware code Nick Dyer
2013-06-05 17:36 ` [PATCH 06/53] Input: atmel_mxt_ts - wait for CHG assert in mxt_check_bootloader Nick Dyer
2013-06-05 17:37 ` [PATCH 07/53] Input: atmel_mxt_ts - wait for CHG after bootloader resets Nick Dyer
2013-06-05 17:37 ` [PATCH 08/53] Input: atmel_mxt_ts - Initialise IRQ before probing Nick Dyer
2013-06-05 17:37 ` [PATCH 09/53] Input: atmel_mxt_ts - Make wait-after-reset period compatible with all chips Nick Dyer
2013-06-05 17:37 ` [PATCH 10/53] Input: atmel_mxt_ts - Add memory access interface via sysfs Nick Dyer
2013-06-05 17:57   ` Dmitry Torokhov
2013-06-05 18:45     ` Nick Dyer
2013-06-05 19:04       ` Dmitry Torokhov
2013-06-05 20:31         ` Nick Dyer
2013-06-05 21:07           ` Dmitry Torokhov
2013-06-05 21:36             ` Nick Dyer
2013-06-06 10:03               ` Mark Brown
2013-06-06 10:31                 ` Nick Dyer
2013-06-06 10:55                   ` Mark Brown
2013-06-06 11:17                     ` Nick Dyer
2013-06-06 13:16                       ` Mark Brown
2013-06-06 16:13                         ` Nick Dyer
2013-06-06 16:46                           ` Mark Brown
2013-06-07 15:12                             ` Nick Dyer
2013-06-07 15:41                               ` Mark Brown
2013-06-07 16:11                                 ` Nick Dyer
2013-06-07 16:47                                   ` Mark Brown
2013-06-11 10:39                                     ` Nick Dyer [this message]
2013-06-11 11:47                                       ` Mark Brown
2013-06-11 12:16                                         ` Nick Dyer
2013-06-19 18:59                                           ` Mark Brown
2013-06-21 16:16                                             ` Nick Dyer
2013-07-02 10:11                                               ` Mark Brown
2013-07-11  7:41                                                 ` Nick Dyer
2013-07-11 10:30                                                   ` Mark Brown
2013-06-06  9:48             ` Mark Brown
2013-06-06 10:40               ` Nick Dyer
2013-06-06 10:46                 ` Mark Brown
2013-06-06 11:00                   ` Nick Dyer
2013-06-06 11:14                     ` Mark Brown
2013-06-06 11:34                       ` Nick Dyer
2013-06-06 13:21                         ` Mark Brown
2013-06-06 18:01   ` Greg KH
2013-06-07 14:47     ` Nick Dyer
2013-06-05 17:37 ` [PATCH 11/53] Input: atmel_mxt_ts - Implement debug output for messages Nick Dyer
2013-06-05 17:37 ` [PATCH 12/53] Input: atmel_mxt_ts - Improve error reporting and debug Nick Dyer
2013-06-05 17:37 ` [PATCH 13/53] Input: atmel_mxt_ts - Implement CRC check for configuration data Nick Dyer
2013-06-05 17:37 ` [PATCH 14/53] Input: atmel_mxt_ts - Download device config using firmware loader Nick Dyer
2013-06-05 17:37 ` [PATCH 15/53] Input: atmel_mxt_ts - Calculate and check CRC in config file Nick Dyer
2013-06-05 17:37 ` [PATCH 16/53] Input: atmel_mxt_ts - Add additional bootloader addresses Nick Dyer
2013-06-05 17:37 ` [PATCH 17/53] Input: atmel_mxt_ts - Read and report bootloader version Nick Dyer
2013-06-05 17:37 ` [PATCH 18/53] Input: atmel_mxt_ts - Implement bootloader frame retries Nick Dyer
2013-06-05 17:37 ` [PATCH 19/53] Input: atmel_mxt_ts - Improve bootloader progress output Nick Dyer
2013-06-05 17:37 ` [PATCH 20/53] Input: atmel_mxt_ts - Add check for incorrect firmware file format Nick Dyer
2013-06-05 17:37 ` [PATCH 21/53] Input: atmel_mxt_ts - Read screen config from chip Nick Dyer
2013-06-05 17:37 ` [PATCH 22/53] Input: atmel_mxt_ts - Set default irqflags when there is no pdata Nick Dyer
2013-06-05 17:37 ` [PATCH 23/53] Input: atmel_mxt_ts - Use deep sleep mode when stopped Nick Dyer
2013-06-05 17:37 ` [PATCH 24/53] Input: atmel_mxt_ts - Add shutdown function Nick Dyer
2013-06-05 17:37 ` [PATCH 25/53] Input: atmel_mxt_ts - Rename pressure to amplitude to match spec Nick Dyer
2013-06-05 17:37 ` [PATCH 26/53] Input: atmel_mxt_ts - Rename touchscreen defines to include T9 Nick Dyer
2013-06-05 17:37 ` [PATCH 27/53] Input: atmel_mxt_ts - Handle multiple input reports in one message Nick Dyer
2013-06-05 17:37 ` [PATCH 28/53] Input: atmel_mxt_ts - Move input device init into separate function Nick Dyer
2013-06-05 17:37 ` [PATCH 29/53] Input: atmel_mxt_ts - Handle APP_CRC_FAIL on startup Nick Dyer
2013-06-05 17:37 ` [PATCH 30/53] Input: atmel_mxt_ts - Handle bootloader previously unlocked Nick Dyer
2013-06-05 17:37 ` [PATCH 31/53] Input: atmel_mxt_ts - Add bootloader addresses for new chips Nick Dyer
2013-06-05 17:37 ` [PATCH 32/53] Input: atmel_mxt_ts - Recover from bootloader on probe Nick Dyer
2013-06-05 17:37 ` [PATCH 33/53] Input: atmel_mxt_ts - Add support for dynamic message size Nick Dyer
2013-06-05 17:37 ` [PATCH 34/53] Input: atmel_mxt_ts - Decode T6 status messages Nick Dyer
2013-06-05 17:37 ` [PATCH 35/53] Input: atmel_mxt_ts - Split message handler into separate functions Nick Dyer
2013-06-05 17:37 ` [PATCH 36/53] Input: atmel_mxt_ts - Implement T44 message handling Nick Dyer
2013-06-05 17:37 ` [PATCH 37/53] Input: atmel_mxt_ts - Output status from T48 Noise Supression Nick Dyer
2013-06-05 17:37 ` [PATCH 38/53] Input: atmel_mxt_ts - Output status from T42 Touch Suppression Nick Dyer
2013-06-05 17:37 ` [PATCH 39/53] Input: atmel_mxt_ts - Implement vector/orientation support Nick Dyer
2013-06-05 17:37 ` [PATCH 40/53] Input: atmel_mxt_ts - implement I2C retries Nick Dyer
2013-06-05 17:37 ` [PATCH 41/53] Input: atmel_mxt_ts - Implement T63 Active Stylus support Nick Dyer
2013-06-05 17:37 ` [PATCH 42/53] Input: atmel_mxt_ts - Implement support for T15 Key Array Nick Dyer
2013-06-05 17:37 ` [PATCH 43/53] Input: atmel_mxt_ts - Remove unused defines Nick Dyer
2013-06-05 17:37 ` [PATCH 44/53] Input: atmel_mxt_ts - Verify Information Block checksum on probe Nick Dyer
2013-06-07 18:37   ` Yufeng Shen
2013-06-10  9:35     ` Nick Dyer
2013-06-05 17:37 ` [PATCH 45/53] Input: atmel_mxt_ts - Use T18 RETRIGEN to handle IRQF_TRIGGER_LOW Nick Dyer
2013-06-05 17:37 ` [PATCH 46/53] Input: atmel_mxt_ts - Handle reports from T47 Stylus object Nick Dyer
2013-06-05 17:37 ` [PATCH 47/53] Input: atmel_mxt_ts - Release touch state during suspend Nick Dyer
2013-06-05 17:37 ` [PATCH 48/53] Input: atmel_mxt_ts - Initialize power config before and after downloading cfg Nick Dyer
2013-06-05 17:37 ` [PATCH 49/53] Input: atmel_mxt_ts - Add regulator control support Nick Dyer
2013-06-05 17:37 ` [PATCH 50/53] Input: atmel_mxt_ts - Implement support for T100 touch object Nick Dyer
2013-06-05 17:37 ` [PATCH 51/53] Input: atmel_mxt_ts - Allow specification of firmware file name Nick Dyer
2013-06-05 17:37 ` [PATCH 52/53] Input: atmel_mxt_ts - Handle cfg filename via pdata/sysfs Nick Dyer
2013-06-05 17:37 ` [PATCH 53/53] Input: atmel_mxt_ts - Only use first T9 instance Nick Dyer
2013-06-06 19:18 ` Atmel updates to atmel_mxt_ts touch controller driver - v5 Daniel Kurtz <djkurtz@chromium.org>, Henrik Rydberg <rydberg@euromail.se>, Joonyoung Shim <jy0922.shim@samsung.com>, Alan.Bowens@atmel.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, pmeerw@pmeerw.net, bleung@chromium.org, olofj@chromium.org Dmitry Torokhov
     [not found]   ` <CAPDwgkPdtj0Th8P+y9e5O7swARfzS40sG1A3Ba=pAmeXfMx0Dw@mail.gmail.com>
2013-06-06 19:46     ` Dmitry Torokhov
2013-06-07 20:21       ` Yufeng Shen

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=51B6FE69.6060505@itdev.co.uk \
    --to=nick.dyer@itdev.co.uk \
    --cc=Alan.Bowens@atmel.com \
    --cc=bleung@chromium.org \
    --cc=broonie@kernel.org \
    --cc=djkurtz@chromium.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jy0922.shim@samsung.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olofj@chromium.org \
    --cc=pmeerw@pmeerw.net \
    --cc=rydberg@euromail.se \
    /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).