linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ath5k: support LEDs on Acer Aspire One netbook
@ 2009-01-01 20:01 Bob Copeland
  2009-01-11 13:10 ` Andreas Mohr
  0 siblings, 1 reply; 11+ messages in thread
From: Bob Copeland @ 2009-01-01 20:01 UTC (permalink / raw)
  To: linville, maximlevitsky, andi; +Cc: linux-wireless, ath5k-devel, Bob Copeland

Add vendor ID for Foxconn and use it to set the ath5k LED gpio and
polarity for Acer branded laptops.

base.c:
Changes-licensed-under: 3-Clause-BSD

Reported-by: Maxim Levitsky <maximlevitsky@gmail.com>
Tested-by: Maxim Levitsky <maximlevitsky@gmail.com>
Tested-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
 drivers/net/wireless/ath5k/base.c |    7 +++++++
 include/linux/pci_ids.h           |    2 ++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index 40c0155..fd3a6f4 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -2595,6 +2595,13 @@ ath5k_init_leds(struct ath5k_softc *sc)
 		sc->led_pin = 1;
 		sc->led_on = 1;  /* active high */
 	}
+	/* Pin 3 on Foxconn chips used in Acer Aspire One (0x105b:e008) */
+	if (pdev->subsystem_vendor == PCI_VENDOR_ID_FOXCONN) {
+		__set_bit(ATH_STAT_LEDSOFT, sc->status);
+		sc->led_pin = 3;
+		sc->led_on = 0;  /* active low */
+	}
+
 	if (!test_bit(ATH_STAT_LEDSOFT, sc->status))
 		goto out;
 
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 1800f1d..c1fb01c 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -834,6 +834,8 @@
 #define PCI_DEVICE_ID_PROMISE_20276	0x5275
 #define PCI_DEVICE_ID_PROMISE_20277	0x7275
 
+#define PCI_VENDOR_ID_FOXCONN		0x105b
+
 #define PCI_VENDOR_ID_UMC		0x1060
 #define PCI_DEVICE_ID_UMC_UM8673F	0x0101
 #define PCI_DEVICE_ID_UMC_UM8886BF	0x673a
-- 
1.6.0.6



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

* Re: [PATCH 1/2] ath5k: support LEDs on Acer Aspire One netbook
  2009-01-01 20:01 [PATCH 1/2] ath5k: support LEDs on Acer Aspire One netbook Bob Copeland
@ 2009-01-11 13:10 ` Andreas Mohr
  2009-01-11 14:42   ` Bob Copeland
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Mohr @ 2009-01-11 13:10 UTC (permalink / raw)
  To: Bob Copeland; +Cc: linville, maximlevitsky, andi, linux-wireless, ath5k-devel

On Thu, Jan 01, 2009 at 03:01:44PM -0500, Bob Copeland wrote:
> Add vendor ID for Foxconn and use it to set the ath5k LED gpio and
> polarity for Acer branded laptops.

My LED is dead again on 2.6.29-rc1 (reason: doesn't contain this patch).

Thanks,

Andreas Mohr

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

* Re: [PATCH 1/2] ath5k: support LEDs on Acer Aspire One netbook
  2009-01-11 13:10 ` Andreas Mohr
@ 2009-01-11 14:42   ` Bob Copeland
  2009-01-11 16:53     ` Andreas Mohr
  2009-03-16 10:04     ` Andreas Mohr
  0 siblings, 2 replies; 11+ messages in thread
From: Bob Copeland @ 2009-01-11 14:42 UTC (permalink / raw)
  To: Andreas Mohr; +Cc: linville, maximlevitsky, linux-wireless, ath5k-devel

On Sun, Jan 11, 2009 at 02:10:15PM +0100, Andreas Mohr wrote:
> On Thu, Jan 01, 2009 at 03:01:44PM -0500, Bob Copeland wrote:
> > Add vendor ID for Foxconn and use it to set the ath5k LED gpio and
> > polarity for Acer branded laptops.
> 
> My LED is dead again on 2.6.29-rc1 (reason: doesn't contain this patch).

It's in wireless-testing, it just hasn't made it through the pipeline yet.

-- 
Bob Copeland %% www.bobcopeland.com


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

* Re: [PATCH 1/2] ath5k: support LEDs on Acer Aspire One netbook
  2009-01-11 14:42   ` Bob Copeland
@ 2009-01-11 16:53     ` Andreas Mohr
  2009-03-16 10:04     ` Andreas Mohr
  1 sibling, 0 replies; 11+ messages in thread
From: Andreas Mohr @ 2009-01-11 16:53 UTC (permalink / raw)
  To: Bob Copeland
  Cc: Andreas Mohr, linville, maximlevitsky, linux-wireless,
	ath5k-devel

On Sun, Jan 11, 2009 at 09:42:27AM -0500, Bob Copeland wrote:
> On Sun, Jan 11, 2009 at 02:10:15PM +0100, Andreas Mohr wrote:
> > My LED is dead again on 2.6.29-rc1 (reason: doesn't contain this patch).
> 
> It's in wireless-testing, it just hasn't made it through the pipeline yet.

Thanks, then consider my blurb a heads-up only ;)

BTW, .29-rc1 is a veritable -rc1, there already are about 3 official
suspend/resume regression reports and I've got yet another _different_
one even (for me it locks up on suspend instead of on resume,
and no_console_suspend doesn't help to debug it either...).

So Maxim, if you've got time to waste here's your project ;)

(and if I am forced to endure yet another STR regression then my mood is
going to blow up...)

(and no, unloading microcode, ath5k, snd_hda_intel and r8169 does not work,
plus I've got no time for debugging anyway)

Andreas

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

* Re: [PATCH 1/2] ath5k: support LEDs on Acer Aspire One netbook
  2009-01-11 14:42   ` Bob Copeland
  2009-01-11 16:53     ` Andreas Mohr
@ 2009-03-16 10:04     ` Andreas Mohr
  2009-03-16 10:16       ` Johannes Berg
  1 sibling, 1 reply; 11+ messages in thread
From: Andreas Mohr @ 2009-03-16 10:04 UTC (permalink / raw)
  To: Bob Copeland
  Cc: Andreas Mohr, linville, maximlevitsky, linux-wireless,
	ath5k-devel

Hi,

On Sun, Jan 11, 2009 at 09:42:27AM -0500, Bob Copeland wrote:
> > My LED is dead again on 2.6.29-rc1 (reason: doesn't contain this patch).
> 
> It's in wireless-testing, it just hasn't made it through the pipeline yet.

Just installed -rc8; would be truly sad to see this really small
but important patch (several million machines) not included in .29 proper...
(or would it later get merged via .29 -stable? Then I'm fine with it...)

Thanks,

Andreas Mohr

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

* Re: [PATCH 1/2] ath5k: support LEDs on Acer Aspire One netbook
  2009-03-16 10:04     ` Andreas Mohr
@ 2009-03-16 10:16       ` Johannes Berg
  2009-03-16 10:44         ` Andreas Mohr
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2009-03-16 10:16 UTC (permalink / raw)
  To: Andreas Mohr
  Cc: Bob Copeland, linville, maximlevitsky, linux-wireless,
	ath5k-devel

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

On Mon, 2009-03-16 at 11:04 +0100, Andreas Mohr wrote:

> On Sun, Jan 11, 2009 at 09:42:27AM -0500, Bob Copeland wrote:
> > > My LED is dead again on 2.6.29-rc1 (reason: doesn't contain this patch).
> > 
> > It's in wireless-testing, it just hasn't made it through the pipeline yet.
> 
> Just installed -rc8; would be truly sad to see this really small
> but important patch (several million machines) not included in .29 proper...
> (or would it later get merged via .29 -stable? Then I'm fine with it...)

I don't think "my LED doesn't blink" really counts as important...

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/2] ath5k: support LEDs on Acer Aspire One netbook
  2009-03-16 10:16       ` Johannes Berg
@ 2009-03-16 10:44         ` Andreas Mohr
  2009-03-16 12:21           ` Maxim Levitsky
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Mohr @ 2009-03-16 10:44 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Andreas Mohr, Bob Copeland, linville, maximlevitsky,
	linux-wireless, ath5k-devel

Hi,

On Mon, Mar 16, 2009 at 11:16:17AM +0100, Johannes Berg wrote:
> On Mon, 2009-03-16 at 11:04 +0100, Andreas Mohr wrote:
> 
> > On Sun, Jan 11, 2009 at 09:42:27AM -0500, Bob Copeland wrote:
> > > > My LED is dead again on 2.6.29-rc1 (reason: doesn't contain this patch).
> > > 
> > > It's in wireless-testing, it just hasn't made it through the pipeline yet.
> > 
> > Just installed -rc8; would be truly sad to see this really small
> > but important patch (several million machines) not included in .29 proper...
> > (or would it later get merged via .29 -stable? Then I'm fine with it...)
> 
> I don't think "my LED doesn't blink" really counts as important...

Given that "NOTHING" (*) worked initially with this machine
which has been sold a couple million times, one could have the opinion
that ANY newly working component whatsoever counts...

Thanks,

Andreas Mohr

*):
- SD-card hotplug suspend/resume lockup
- SD-card filesystem _corruption_ after resume
- microphone in most cases not working due to suspected ALSA lib bug
- General Intel-HDA codec dodginess such as randomly toggling
  high noise level in speakers etc.
- X.org wrong dpi issues (now fixed, thanks!)
- X.org i915 suspend/resume lockup / VT switch issues (about to be fixed)
- ath5k suspend/resume issues (fixed)
- ath5k noise level calibration issues (fixed?)
- NetworkManager catastrophy (ongoing nerve corruption)
- libata performance loss down to UDMA/33 upon resume (fixed, (semi-)personally)
- Intel firmware module suspend/resume lockup (fixed, semi-personally)
- non-supported WLAN LED (would-be-fixed, semi-personally)
- flexible fan control not supported in-kernel (support in progress,
  thanks a lot!)
- suspected non-optimal SSD I/O scheduler support
- several very annoying CUPS non-working print issues,
  including an entirely locking-up interfacing to _ALL_ [suspected]
  HP JetDirect servers, whether builtin or not (fixed, semi-personally)
- and probably several others... (e.g. Ubuntu userspace bugs)

See also LKML monster thread "Bugs on aspire one A150"...

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

* Re: [PATCH 1/2] ath5k: support LEDs on Acer Aspire One netbook
  2009-03-16 10:44         ` Andreas Mohr
@ 2009-03-16 12:21           ` Maxim Levitsky
  2009-03-16 13:41             ` Andreas Mohr
  0 siblings, 1 reply; 11+ messages in thread
From: Maxim Levitsky @ 2009-03-16 12:21 UTC (permalink / raw)
  To: Andreas Mohr
  Cc: Johannes Berg, Bob Copeland, linville, maximlevitsky,
	linux-wireless, ath5k-devel

On Mon, 2009-03-16 at 11:44 +0100, Andreas Mohr wrote:
> Hi,
> 
> On Mon, Mar 16, 2009 at 11:16:17AM +0100, Johannes Berg wrote:
> > On Mon, 2009-03-16 at 11:04 +0100, Andreas Mohr wrote:
> > 
> > > On Sun, Jan 11, 2009 at 09:42:27AM -0500, Bob Copeland wrote:
> > > > > My LED is dead again on 2.6.29-rc1 (reason: doesn't contain this patch).
> > > > 
> > > > It's in wireless-testing, it just hasn't made it through the pipeline yet.
> > > 
> > > Just installed -rc8; would be truly sad to see this really small
> > > but important patch (several million machines) not included in .29 proper...
> > > (or would it later get merged via .29 -stable? Then I'm fine with it...)
> > 
> > I don't think "my LED doesn't blink" really counts as important...
> 
> Given that "NOTHING" (*) worked initially with this machine
> which has been sold a couple million times, one could have the opinion
> that ANY newly working component whatsoever counts...
> 
> Thanks,
> 
> Andreas Mohr
> 
> *):
> - SD-card hotplug suspend/resume lockup
> - SD-card filesystem _corruption_ after resume
> - microphone in most cases not working due to suspected ALSA lib bug
> - General Intel-HDA codec dodginess such as randomly toggling
>   high noise level in speakers etc.
> - X.org wrong dpi issues (now fixed, thanks!)
> - X.org i915 suspend/resume lockup / VT switch issues (about to be fixed)
> - ath5k suspend/resume issues (fixed)
> - ath5k noise level calibration issues (fixed?)
> - NetworkManager catastrophy (ongoing nerve corruption)
> - libata performance loss down to UDMA/33 upon resume (fixed, (semi-)personally)
> - Intel firmware module suspend/resume lockup (fixed, semi-personally)
> - non-supported WLAN LED (would-be-fixed, semi-personally)
> - flexible fan control not supported in-kernel (support in progress,
>   thanks a lot!)
> - suspected non-optimal SSD I/O scheduler support
> - several very annoying CUPS non-working print issues,
>   including an entirely locking-up interfacing to _ALL_ [suspected]
>   HP JetDirect servers, whether builtin or not (fixed, semi-personally)
> - and probably several others... (e.g. Ubuntu userspace bugs)
> 
> See also LKML monster thread "Bugs on aspire one A150"...


Well thats the living in linux... :-)
I think this notebook is perfect since, all these bugs were fixed.
Now it is almost perfect.

On the other hand think about my main notebook, acer 5720.
There suspend to ram doesn't work, and no this isn't due to GFX driver,
or anything like that. It just that BIOS doesn't pass control to linux
on resume. It doesn't like something in hardware....
This would I call a NOTHING...



I recommend to to install (if you didn't do that yet) the
compat-wireless package, or even better compile wireless-testing.

You could also patch in latest patches that fix TX power for ath5k, or
wait few days till they are in wireless-testings (maybe they are there
already...)



Best regards,
	Maxim Levitsky


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

* Re: [PATCH 1/2] ath5k: support LEDs on Acer Aspire One netbook
  2009-03-16 12:21           ` Maxim Levitsky
@ 2009-03-16 13:41             ` Andreas Mohr
  2009-03-16 15:33               ` Maxim Levitsky
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Mohr @ 2009-03-16 13:41 UTC (permalink / raw)
  To: Maxim Levitsky
  Cc: Andreas Mohr, Johannes Berg, Bob Copeland, linville,
	linux-wireless, ath5k-devel

Hi,

On Mon, Mar 16, 2009 at 02:21:57PM +0200, Maxim Levitsky wrote:
> On the other hand think about my main notebook, acer 5720.
> There suspend to ram doesn't work, and no this isn't due to GFX driver,
> or anything like that. It just that BIOS doesn't pass control to linux
> on resume. It doesn't like something in hardware....
> This would I call a NOTHING...

Hmm. So the resume vector itself doesn't even get invoked?
AFAIR there's some debugging options at the asm entry point,
but I'm sure you (and several other people) have already looked at this...
Plus booting into a minimal setup (init=/bin/sh) with almost no drivers
loaded at all (thus no fumbled hardware) didn't manage to make resume
work either I guess?

> I recommend to to install (if you didn't do that yet) the
> compat-wireless package, or even better compile wireless-testing.

Thanks, forgot to install this for the newly installed Jaunty's 2.6.28.

> You could also patch in latest patches that fix TX power for ath5k, or
> wait few days till they are in wireless-testings (maybe they are there
> already...)

I'll wait until I know how well ath5k works on -rc8.

Thanks,

Andreas Mohr

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

* Re: [PATCH 1/2] ath5k: support LEDs on Acer Aspire One netbook
  2009-03-16 13:41             ` Andreas Mohr
@ 2009-03-16 15:33               ` Maxim Levitsky
  2009-03-16 16:00                 ` Andreas Mohr
  0 siblings, 1 reply; 11+ messages in thread
From: Maxim Levitsky @ 2009-03-16 15:33 UTC (permalink / raw)
  To: Andreas Mohr
  Cc: Johannes Berg, Bob Copeland, linville, linux-wireless,
	ath5k-devel

On Mon, 2009-03-16 at 14:41 +0100, Andreas Mohr wrote:
> Hi,
> 
> On Mon, Mar 16, 2009 at 02:21:57PM +0200, Maxim Levitsky wrote:
> > On the other hand think about my main notebook, acer 5720.
> > There suspend to ram doesn't work, and no this isn't due to GFX driver,
> > or anything like that. It just that BIOS doesn't pass control to linux
> > on resume. It doesn't like something in hardware....
> > This would I call a NOTHING...
> 
> Hmm. So the resume vector itself doesn't even get invoked?
Exactly.


> AFAIR there's some debugging options at the asm entry point,
> but I'm sure you (and several other people) have already looked at this...
I did my own.. I put there code to write to RTC alarm, and when it hangs
alarm doesn't update.

RTC alarm registers are usually preserved during boots and even during
full power cycle.
This is the case here.



> Plus booting into a minimal setup (init=/bin/sh) with almost no drivers
> loaded at all (thus no fumbled hardware) didn't manage to make resume
> work either I guess?
Exactly, I tried this and very many other debug approaches, but none
help.

Despite the fact that my system has nvidia which I blamed for this bug,
it appears that I am not alone and many acer systems around 5720 are
affected, and don't have an nvidia device.


> 
> > I recommend to to install (if you didn't do that yet) the
> > compat-wireless package, or even better compile wireless-testing.
> 
> Thanks, forgot to install this for the newly installed Jaunty's 2.6.28.

> 
> > You could also patch in latest patches that fix TX power for ath5k, or
> > wait few days till they are in wireless-testings (maybe they are there
> > already...)
> 
> I'll wait until I know how well ath5k works on -rc8.
Here wireless-testing + Nick's pathches work great.


The reason internal microphone doesn't work is that many programs
attempt to record mono from it, but alsa-lib has some bug that make this
work as was described before (works only when there is large difference
between left and right channel)


When I have time I'll fix that, it shouldn't be hard with help of source
and debugger.


(But internal mic is such low quality device, that it hardly worth all
the trouble  - it has same quality in windows, and only way to hear
anything is to yell at it, or bear that horrible noise that appears once
you increase gain level all the way up)


Speaking of the led, I don't understand why you want that patch to be
applied at all. yes it makes the led work, but did you notice how well
it works? It blinks very fast, it often inverts the blinking, so it
constantly on and goes  of when there is activety, or stops blinking at
all. I was told that this is due to low quality code in mac80222 that
controls the leds. Other drivers work around that by using this code
only as a suggestion, and implementing their own ad-hoc timers and
statistics to power the led. Again I will see what I can do there to
improve it. 

Currently I disable the led all together because of that.


Best regards,
	Maxim Levitsky


> 
> Thanks,
> 
> Andreas Mohr


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

* Re: [PATCH 1/2] ath5k: support LEDs on Acer Aspire One netbook
  2009-03-16 15:33               ` Maxim Levitsky
@ 2009-03-16 16:00                 ` Andreas Mohr
  0 siblings, 0 replies; 11+ messages in thread
From: Andreas Mohr @ 2009-03-16 16:00 UTC (permalink / raw)
  To: Maxim Levitsky
  Cc: Andreas Mohr, Johannes Berg, Bob Copeland, linville,
	linux-wireless, ath5k-devel

Hi,

On Mon, Mar 16, 2009 at 05:33:19PM +0200, Maxim Levitsky wrote:
> On Mon, 2009-03-16 at 14:41 +0100, Andreas Mohr wrote:
> > Hmm. So the resume vector itself doesn't even get invoked?
> Exactly.
> 
> 
> > AFAIR there's some debugging options at the asm entry point,
> > but I'm sure you (and several other people) have already looked at this...
> I did my own.. I put there code to write to RTC alarm, and when it hangs
> alarm doesn't update.
> 
> RTC alarm registers are usually preserved during boots and even during
> full power cycle.
> This is the case here.

Perhaps this is because the suspend command/process itself is (slightly?)
wrong (at least "wrong" in the mental universe of this BIOS ;)
and the machine sort-of suspends but due to this doesn't really resume...

> it appears that I am not alone and many acer systems around 5720 are
> affected, and don't have an nvidia device.

So 5520 (I've seen this one already, didn't try resuming) as well perhaps.

> Speaking of the led, I don't understand why you want that patch to be
> applied at all. yes it makes the led work, but did you notice how well
> it works? It blinks very fast, it often inverts the blinking, so it
> constantly on and goes  of when there is activety, or stops blinking at
> all. I was told that this is due to low quality code in mac80222 that
> controls the leds. Other drivers work around that by using this code
> only as a suggestion, and implementing their own ad-hoc timers and
> statistics to power the led. Again I will see what I can do there to
> improve it. 
> 
> Currently I disable the led all together because of that.

Yeah, of course, but the first step would be to activate it, then the
second step should be done (and more LED users would be annoyed about LED
behaviour, thus it would hopefully be fixed soon ;)).

Plus, and that's the more important part, there's certainly not only
one trigger type available but several (some of which without frantic
blinking). Without LED support you'd simply lose all trigger types ;)

Andreas

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

end of thread, other threads:[~2009-03-16 16:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-01 20:01 [PATCH 1/2] ath5k: support LEDs on Acer Aspire One netbook Bob Copeland
2009-01-11 13:10 ` Andreas Mohr
2009-01-11 14:42   ` Bob Copeland
2009-01-11 16:53     ` Andreas Mohr
2009-03-16 10:04     ` Andreas Mohr
2009-03-16 10:16       ` Johannes Berg
2009-03-16 10:44         ` Andreas Mohr
2009-03-16 12:21           ` Maxim Levitsky
2009-03-16 13:41             ` Andreas Mohr
2009-03-16 15:33               ` Maxim Levitsky
2009-03-16 16:00                 ` Andreas Mohr

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