Kernel driver for 3000 class lenovo

I've started to create a kernel driver for my 3000 series lenovo, to try and sort out some of the brokenness. At the moment, the driver just polls a bit of memory (0xb9) on the embedded controller and emits a KEY_BRIGHTNESS_XXX INPUT event when it changes. It also expresses a backlight class for the panel, although setting the value doesn't do much yet.

Now the question: for debugging I want to dump all 255 registers of the embedded controller to userspace. In thinkpad_acpi this is done using /proc/acpi/ibm/ecdump but I really don't want to hack proc support into my tiny driver. Should I be using the mem or misc kernel class for this? debugfs? relayfs? All I want to do is be able to read all 255 bytes, and also change them individually if needed.

Ideas? Thanks.

Published by

hughsie

Richard has over 10 years of experience developing open source software. He is the maintainer of GNOME Software, PackageKit, GNOME Packagekit, GNOME Power Manager, GNOME Color Manager, colord, and UPower and also contributes to many other projects and opensource standards. Richard has three main areas of interest on the free desktop, color management, package management, and power management. Richard graduated a few years ago from the University of Surrey with a Masters in Electronics Engineering. He now works for Red Hat in the desktop group, and also manages a company selling open source calibration equipment. Richard's outside interests include taking photos and eating good food.

One thought on “Kernel driver for 3000 class lenovo”

  1. While you're at it, do you think you could fix the fans? [adamw@lenovo build]$ ls /proc/acpi/fan/ [adamw@lenovo build]$ that's on my 3000 V100. According to smart kernel-type people I asked, the fact that there's nothing in /proc/acpi/fan means that the kernel can't control my fans, and the fact that my system frequently powers itself off due to overheating if I try and run a compile job more than five minutes long appears to back up this theory. They told me there is something hideously complicated that could be done to fix this, but it was beyond my feeble capacities. =)

Comments are closed.