linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* wm97xx_read_aux_adc() for battery & pen down?
@ 2011-06-24 13:00 Wolfram Sang
  2011-06-24 16:52 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2011-06-24 13:00 UTC (permalink / raw)
  To: linux-input; +Cc: Mark Brown

[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]

Hi,

I have one question I got while hacking on this cheap tablet thingie I don't
have schematics or documentation for. It uses a WM9715 for (at least) touch and
battery-status, but I need the following dirty hack for 3.0-rc4 in
wm97xx_read_aux_adc():

...
-       if (!(*sample & WM97XX_PEN_DOWN)) {
+       /* HACK! Disable check for battery channel on Jaytech PID7901 */
+       if ((adcsel != 0x6000) && !(*sample & WM97XX_PEN_DOWN)) {
                wm->pen_probably_down = 0;
                return RC_PENUP;
        }

        return RC_VALID;
}

So, it uses WM97XX_AUX_ID3 as the battery channel which never sets PEN_DOWN. As
a result, I always see timeouts when reading the current voltage (without the
patch). My question is: How to avoid this hack? Did I forget to configure
something somewhere? I read through the wm9715-docs and the driver source, yet
I think I missed something (or the current implementation cannot work?).

Thanks,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: wm97xx_read_aux_adc() for battery & pen down?
  2011-06-24 13:00 wm97xx_read_aux_adc() for battery & pen down? Wolfram Sang
@ 2011-06-24 16:52 ` Mark Brown
  2011-06-24 16:58   ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2011-06-24 16:52 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-input, dp

On Fri, Jun 24, 2011 at 03:00:49PM +0200, Wolfram Sang wrote:

> battery-status, but I need the following dirty hack for 3.0-rc4 in
> wm97xx_read_aux_adc():

> ...
> -       if (!(*sample & WM97XX_PEN_DOWN)) {
> +       /* HACK! Disable check for battery channel on Jaytech PID7901 */
> +       if ((adcsel != 0x6000) && !(*sample & WM97XX_PEN_DOWN)) {
>                 wm->pen_probably_down = 0;
>                 return RC_PENUP;
>         }

I don't see this code in that function?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: wm97xx_read_aux_adc() for battery & pen down?
  2011-06-24 16:52 ` Mark Brown
@ 2011-06-24 16:58   ` Wolfram Sang
  2011-06-26 11:00     ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2011-06-24 16:58 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-input, dp

[-- Attachment #1: Type: text/plain, Size: 923 bytes --]

On Fri, Jun 24, 2011 at 05:52:04PM +0100, Mark Brown wrote:
> On Fri, Jun 24, 2011 at 03:00:49PM +0200, Wolfram Sang wrote:
> 
> > battery-status, but I need the following dirty hack for 3.0-rc4 in
> > wm97xx_read_aux_adc():
> 
> > ...
> > -       if (!(*sample & WM97XX_PEN_DOWN)) {
> > +       /* HACK! Disable check for battery channel on Jaytech PID7901 */
> > +       if ((adcsel != 0x6000) && !(*sample & WM97XX_PEN_DOWN)) {
> >                 wm->pen_probably_down = 0;
> >                 return RC_PENUP;
> >         }
> 
> I don't see this code in that function?

Ahem, sorry, I mixed the function names. wm97xx_read_aux_adc() uses the
poll_sample-pointer which points to wm9712_poll_sample() in my case.
There I need the above code.

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: wm97xx_read_aux_adc() for battery & pen down?
  2011-06-24 16:58   ` Wolfram Sang
@ 2011-06-26 11:00     ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2011-06-26 11:00 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-input, dp

On Fri, Jun 24, 2011 at 06:58:02PM +0200, Wolfram Sang wrote:

> Ahem, sorry, I mixed the function names. wm97xx_read_aux_adc() uses the
> poll_sample-pointer which points to wm9712_poll_sample() in my case.
> There I need the above code.

It looks like poll_sample() needs to be passed a flag to disable the pen
down checking.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-26 11:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-24 13:00 wm97xx_read_aux_adc() for battery & pen down? Wolfram Sang
2011-06-24 16:52 ` Mark Brown
2011-06-24 16:58   ` Wolfram Sang
2011-06-26 11:00     ` Mark Brown

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).