-3

I have a throw-away cheap laptop I'd like to twiddle around, a Thinkpad SL 500.

What bothers me are two leds, the one for wireless connectivity, and the one for hibernation, which don't light up at all, although they're functional, I've tried it on windows.

So I would like to write a kernel driver for them, nothing big, it just looks like a good idea to play around with the kernel.

My question is what methodology should I follow systematically to find out what devices are responsible for those leds (in general, not necessarily specific to my hardware), and what drivers are responsible for the other two leds that work, bluetooth and the battery indicator?

And when I say methodology, I really mean the methodology, step by step, with reasons for each step, like in the answer I've gave to someone else over here: What does && mean in void *p = &&abc;

I am profficient at fgrepping through big code repositories, using static code analysers & co, but I think my lack of hardware knowledge hinders me on this problem.

PS: I'm using ArchLinux, so almost the latest kernel version.

Community
  • 1
  • 1
Flavius
  • 13,566
  • 13
  • 80
  • 126
  • 1
    I would like to know from the people voting it for being closed as "not constructive", what EXACTLY is not constructive? I'd like to write a very simple kernel driver, it looks constructive to me. – Flavius Sep 06 '12 at 17:23
  • The problem may be (I didn't vote to close, and I even upvoted) that this is a very wide question. It's not off topic in my opinion but asking for " the methodology, step by step, with reasons for each step" may be a little out of the custom here. – Denys Séguret Sep 06 '12 at 17:30
  • 3
    Even though it's a programming question, it's very open ended and difficult to impossible to provide you with an authoritative answer that is both specific enough for your needs and general enough to be applicable to a wider audience. That's why you're getting close votes. http://stackoverflow.com/faq#dontask – OmnipotentEntity Sep 06 '12 at 18:02
  • 1
    @OmnipotentEntity I see in there: "However, if your motivation is “I would like others to explain ______ to me”, then you are probably OK". I'll address this on meta, because the community seems poisonous to me. – Flavius Sep 07 '12 at 05:52
  • 2
    Could be more on-topic on [unix.se]. –  Sep 07 '12 at 06:56
  • 1
    @darvids0n UNIX C API and System Interfaces questions are on-topic, on Unix and Linux, but general programming questions are not. – apaderno Sep 07 '12 at 23:46
  • @dystroy please help reopen it then. – Flavius Sep 08 '12 at 10:13

3 Answers3

4

This page might be a good place to start. I believe that ACPI drivers are usually responsible for things like hibernate LEDs in laptops. Where to go from there, I leave as an exercise for the reader.

Karl Bielefeldt
  • 47,314
  • 10
  • 60
  • 94
2

I'm not sure your question is appropriate on SO.

However, I would first try to guess what hardware do you have precisely. Commands like hwinfo, lspci, lsusb should help.

Then you could search the web for the outputs which might be relevant.

And you should know if your wifi is working on Linux, and if yes, with which drivers. If it is ndiswrapper you are probably out of luck.

Actually, you should have a precise understanding of your hardware as possible.

I would ask more precise questions on kernel or driver related lists.

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
  • It is a programming question, of course it's appropiate on SO. – Flavius Sep 06 '12 at 17:27
  • My problem is, what do I do after I find out those "device ids"? Where to look after that? How to be sure the hardware information I've extracted are actually relevant to what I'm trying to accomplish? – Flavius Sep 06 '12 at 17:28
  • You might google for these device ids, and if you are lucky you'll find something relevant. Otherwise, you'll need to reverse engineer everything... – Basile Starynkevitch Sep 06 '12 at 18:02
  • 1
    But it is not a source code related question. http://programmers.stackexchange.com/ is probably a better place to ask. – Basile Starynkevitch Sep 06 '12 at 18:08
  • What do you mean by "everything" in "reverse engineer everything"? – Flavius Sep 06 '12 at 18:12
  • I mean that guessing the programmable aspects of a hardware device without any documentation is not fun. Try to improve the *nouveau* driver (for Nvidia graphic cards) if you want to feel what that means (I didn't try to improve *nouveau*, but I am using it and have reported a bug). – Basile Starynkevitch Sep 06 '12 at 18:15
  • Please help reopen the question. – Flavius Sep 08 '12 at 10:15
2

Have you already tried the lenovo-sl-laptop driver? As far as I can see, it supports the LEDs, and allows you to control at least the lenovocare led via the /sys/class/leds/lensl::lenovocare/ files. See the README file for details.

Note that the driver may be available in the Arch repos already, you don't necessarily need to recompile the driver yourself. Sorry for not being much clearer, but I myself have neither SL500 nor Arch, so I cannot verify the details. If you're interested in the various ways you can use scripts to fiddle with the leds, I might be of assistance. Hope this helps.

Nominal Animal
  • 38,216
  • 5
  • 59
  • 86