From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: Philip Langdale <philipl@overt.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Matthew Garrett <mjg59@srcf.ucam.org>,
toshiba_acpi@memebeam.org, Ivo van Doorn <ivdoorn@gmail.com>,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/1] toshiba_acpi: Add support for bluetooth toggling through rfkill (v5)
Date: Tue, 19 Aug 2008 22:29:36 -0300 [thread overview]
Message-ID: <20080820012936.GE29336@khazad-dum.debian.net> (raw)
In-Reply-To: <48A728B0.8030206@overt.org>
On Sat, 16 Aug 2008, Philip Langdale wrote:
> @@ -607,7 +796,66 @@ static int __init toshiba_acpi_init(void)
> }
> toshiba_backlight_device->props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1;
>
> - return (ACPI_SUCCESS(status)) ? 0 : -ENODEV;
> + /* Register rfkill switch for Bluetooth */
> + if (hci_get_bt_present(&bt_present) == HCI_SUCCESS && bt_present) {
> + toshiba_acpi.rfk_dev = rfkill_allocate(&toshiba_acpi.p_dev->dev,
> + RFKILL_TYPE_BLUETOOTH);
> + if (!toshiba_acpi.rfk_dev) {
> + printk(MY_ERR "unable to allocate rfkill device\n");
> + toshiba_acpi_exit();
> + return -ENOMEM;
> + }
> +
> + toshiba_acpi.rfk_dev->name = toshiba_acpi.bt_name;
> + toshiba_acpi.rfk_dev->state = RFKILL_STATE_OFF;
Where did that RFKILL_STATE_OFF came from ? :-) Just get rid of it, you
override it four statements later anyway...
> + toshiba_acpi.rfk_dev->toggle_radio = bt_rfkill_toggle_radio;
> + toshiba_acpi.rfk_dev->user_claim_unsupported = 1;
> + toshiba_acpi.rfk_dev->data = &toshiba_acpi;
> +
> + if (hci_get_bt_on(&bt_on) == HCI_SUCCESS && bt_on) {
> + toshiba_acpi.rfk_dev->state = RFKILL_STATE_UNBLOCKED;
> + } else if (hci_get_radio_state(&radio_on) == HCI_SUCCESS && radio_on) {
> + toshiba_acpi.rfk_dev->state = RFKILL_STATE_SOFT_BLOCKED;
> + } else {
> + toshiba_acpi.rfk_dev->state = RFKILL_STATE_HARD_BLOCKED;
> + }
i.e. in the code above.
Other than that, the rfkill bits look fine to me.
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
next prev parent reply other threads:[~2008-08-20 1:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-16 19:21 Philip Langdale
2008-08-20 1:29 ` Henrique de Moraes Holschuh [this message]
2008-08-20 3:02 ` Philip Langdale
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=20080820012936.GE29336@khazad-dum.debian.net \
--to=hmh@hmh.eng.br \
--cc=ivdoorn@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=philipl@overt.org \
--cc=toshiba_acpi@memebeam.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®