[Debian-eeepc-devel] Bluetooth: how it won't mess older models

Iván Sánchez Ortega ivan at sanchezortega.es
Thu Sep 4 15:51:16 UTC 2008


El Jueves, 4 de Septiembre de 2008, Damyan Ivanov escribió:
[...]
> Are you, by any chance using the eeepc-acpi kernel module? I use the
> laptop-eeepc one from the kernel package.

Yes, I'm quite stuck with 2.6.25, which works perfectly for my needs.

> I ask about this, as I couldn't find the code in laptop-eeepc that is
> responsible for the creation of the bluetooth control file. There is
> code about camera, cardreader, wlan and screen (whatever that is), but
> no bluetooth. Bummer!

I'm browsing the source for the laptop-eeepc as I'm writing this. It seems 
that you just have to add the "BTHG" and "BTHS" ACPI methods to the 
corresponding control methods tables:


const char *cm_getv[] = {
	"WLDG", NULL, NULL, NULL,
	"CAMG", "BTHG", NULL, NULL,
	NULL, "PBLG", NULL, NULL,
	"CFVG", NULL, NULL, NULL,
	"USBG", NULL, NULL, "MODG",
	"CRDG", "LIDG"
};

const char *cm_setv[] = {
	"WLDS", NULL, NULL, NULL,
	"CAMS", "BTHS", NULL, NULL,
	"SDSP", "PBLS", "HDPS", NULL,
	"CFVS", NULL, NULL, NULL,
	"USBG", NULL, NULL, "MODS",
	"CRDS", NULL
};



... then, create the functions and variables that will be hooked to the sysfs 
file (I prefer "/sys/whatever/bluetooth" instead of "/sys/whatever/bt")...



EEEPC_CREATE_DEVICE_ATTR(bluetooth, CM_ASL_BT);



... then, hook the "bluetooth" device into the platform_attributes array so 
the sysfs entry gets created and destroyed when the module is loaded and 
unloaded...



static struct attribute *platform_attributes[] = {
	&dev_attr_camera.attr,
	&dev_attr_cardr.attr,
	&dev_attr_disp.attr,
	&dev_attr_wlan.attr,
	&dev_attr_bluetooth.attr,
	NULL
};


... and that should do it. Please keep in mind that I haven't tested that 
code.

Do you know the best way to get this into the linux git tree?

> Another funny thing is that when the bluetooth is disabled in the
> BIOS, the "control methods" flags still end with 3, meaning bluetooth
> and wlan supported.

The bluetooth control method bit means that the BIOS (via ACPI) is able to 
enable and disable bluetooth, not the current status of bluetooth. Same goes 
for wlan and webcam.


Cheers,
-- 
----------------------------------
Iván Sánchez Ortega <ivan at sanchezortega.es>

MSN:i_eat_s_p_a_m_for_breakfast at hotmail.com
Jabber:ivansanchez at jabber.org ; ivansanchez at kdetalk.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.alioth.debian.org/pipermail/debian-eeepc-devel/attachments/20080904/7f58ff00/attachment.pgp 


More information about the Debian-eeepc-devel mailing list