All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shem Multinymous <multinymous@gmail.com>
To: Robert Love <rlove@rlove.org>
Cc: linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: tp_smapi conflict with IDE, hdaps
Date: Tue, 13 Dec 2005 17:43:40 +0200	[thread overview]
Message-ID: <41840b750512130743n39acbe28qced81c909c7c5187@mail.gmail.com> (raw)
In-Reply-To: <1134486843.28684.89.camel@betsy.boston.ximian.com>

On 12/13/05, Robert Love <rlove@rlove.org> wrote:
> On Tue, 2005-12-13 at 16:35 +0200, Shem Multinymous wrote:
> Alan's response is the correct course of action here,

Ideally, but I'm not sure we understand the interface sufficiently
well to abstract it beyond a mere mutex. Compare your hdaps.c code to
the following relevant code from tp_smapi.c (stripped down a bit for
simplicty):

----------------------------------------
#define APS_ROW_LEN 16
static int read_aps_row(u8 arg1610, u8 arg161F, u8* buf) {
	int retries, i;
	int ret = -EIO;

	for (retries=APS_MAX_RETRIES; retries>0; --retries) {
		if (inb(0x1604)&0x40) { /* readout pending? */
			inb(0x161F); /* discard it */
			udelay(10);
		} else {
			outb(arg1610, 0x1610);
			if (inb(0x1604)&0x20)
				goto wrote1610;
		}
	}
	goto out;
wrote1610:
	outb(arg161F, 0x161F);
	for (retries=APS_MAX_RETRIES; retries>0; --retries) {
		if (inb(0x1604)&0x40) /* readout pending? */
			goto gotdata;
			udelay(10);
	}
	goto out;
gotdata:
	for (i=0; i<APS_ROW_LEN; ++i) {
		buf[i] = inb(0x1610+i);
	}
	ret = 0;
out:
	return ret;
}
----------------------------------------
(Yes, the loop/goto structure should be cleanup up a bit.)

Not to mention the HDAPS init code, which is voodoo.


> question: What other data in 0x1604-0x161F is there?

I looked only at the readout "rows" given by arg1610=1,..,18 and
arg161F=0,1. In that range, I didn't see anything obviously
interesting in the "rows" not already used by the battery readout and
HDAPS. I don't think any of the Windows driver reads other "rows". But
for all we know, this could be a window into the embedded controller's
memory or something of the sorts. Also, some of these "rows" are
actually commands given during HDAPS init, so the "read_row"
abstraction is obviously not accurate.

  Shem

      reply	other threads:[~2005-12-13 15:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-13 14:35 tp_smapi conflict with IDE, hdaps Shem Multinymous
2005-12-13 14:43 ` Shem Multinymous
2005-12-13 15:03 ` Alan Cox
2005-12-13 15:29   ` Shem Multinymous
2005-12-13 15:38     ` Alan Cox
2005-12-13 16:04       ` Shem Multinymous
2005-12-13 16:16         ` Alan Cox
2005-12-14 16:32           ` Shem Multinymous
2005-12-13 18:41     ` Shem Multinymous
2005-12-13 19:18       ` Alan Cox
2005-12-14 15:03         ` Shem Multinymous
2005-12-15  3:05           ` Mark Lord
2005-12-13 15:14 ` Robert Love
2005-12-13 15:43   ` Shem Multinymous [this message]

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=41840b750512130743n39acbe28qced81c909c7c5187@mail.gmail.com \
    --to=multinymous@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rlove@rlove.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.