From: Len Brown Date: Wed, 24 Jun 2009 05:19:50 +0000 (-0400) Subject: Merge branches 'acerhdf', 'acpi-pci-bind', 'bjorn-pci-root', 'bugzilla-12904', 'bugzi... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fbe8cddd2d85979d273d7937a2b8a47498694d91;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Merge branches 'acerhdf', 'acpi-pci-bind', 'bjorn-pci-root', 'bugzilla-12904', 'bugzilla-13121', 'bugzilla-13396', 'bugzilla-13533', 'bugzilla-13612', 'c3_lock', 'hid-cleanups', 'misc-2.6.31', 'pdc-leak-fix', 'pnpacpi', 'power_nocheck', 'thinkpad_acpi', 'video' and 'wmi' into release --- fbe8cddd2d85979d273d7937a2b8a47498694d91 diff --cc MAINTAINERS index 303129ab4b75,e9457feb7eba,cf4abddfc8a4,cf4abddfc8a4,cf4abddfc8a4,cf4abddfc8a4,cf4abddfc8a4,cf4abddfc8a4,cf4abddfc8a4,77cbfb1a696c,77cbfb1a696c,cf4abddfc8a4,cf4abddfc8a4,77cbfb1a696c,77cbfb1a696c,cf4abddfc8a4,cf4abddfc8a4,cf4abddfc8a4..7d9d3745aab9 --- a/MAINTAINERS +++ b/MAINTAINERS @@@@@@@@@@@@@@@@@@@ -2020,20 -1985,10 -1978,10 -1978,10 -1978,10 -1978,10 -1978,10 -1978,10 -1978,10 -1969,10 -1969,10 -1978,10 -1978,10 -1969,10 -1969,10 -1978,10 -1978,10 -1978,10 +2027,20 @@@@@@@@@@@@@@@@@@@ F: Documentation/edac.tx F: drivers/edac/edac_* F: include/linux/edac.h +++++++++++++++++EDAC-AMD64 +++++++++++++++++P: Doug Thompson +++++++++++++++++M: dougthompson@xmission.com +++++++++++++++++P: Borislav Petkov +++++++++++++++++M: borislav.petkov@amd.com +++++++++++++++++L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) +++++++++++++++++W: bluesmoke.sourceforge.net +++++++++++++++++S: Supported +++++++++++++++++F: drivers/edac/amd64_edac* +++++++++++++++++ EDAC-E752X P: Mark Gross -- -- P: Doug Thompson M: mark.gross@intel.com ++ ++ P: Doug Thompson M: dougthompson@xmission.com L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) W: bluesmoke.sourceforge.net @@@@@@@@@@@@@@@@@@@ -2316,7 -2265,8 -2258,8 -2258,8 -2258,8 -2258,8 -2258,8 -2258,8 -2258,8 -2249,8 -2249,8 -2258,8 -2258,8 -2249,8 -2249,8 -2258,8 -2258,8 -2258,8 +2323,7 @@@@@@@@@@@@@@@@@@@ P: Li Yan M: leoli@freescale.com P: Zhang Wei M: zw@zh-kernel.org -- -- L: linuxppc-embedded@ozlabs.org -- -- L: linux-kernel@vger.kernel.org ++ ++ L: linuxppc-dev@ozlabs.org -------- -- ---L: linux-kernel@vger.kernel.org S: Maintained F: drivers/dma/fsldma.* diff --cc arch/x86/kernel/acpi/boot.c index 631086159c53,723989d7f802,723989d7f802,723989d7f802,723989d7f802,723989d7f802,723989d7f802,723989d7f802,723989d7f802,723989d7f802,723989d7f802,f54e0e557cd2,723989d7f802,723989d7f802,723989d7f802,723989d7f802,723989d7f802,723989d7f802..6b8ca3a0285d --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@@@@@@@@@@@@@@@@@@ -1223,16 -1207,82 -1207,82 -1207,82 -1207,82 -1207,82 -1207,82 -1207,82 -1207,82 -1207,82 -1207,82 -1137,82 -1207,82 -1207,82 -1207,82 -1207,82 -1207,82 -1207,82 +1153,16 @@@@@@@@@@@@@@@@@@@ int mp_register_gsi(struct device *dev ioapic_pin); return gsi; } ----------------- if (test_bit(ioapic_pin, mp_ioapic_routing[ioapic].pin_programmed)) { ----------------- pr_debug("Pin %d-%d already programmed\n", ----------------- mp_ioapic_routing[ioapic].apic_id, ioapic_pin); -----------------#ifdef CONFIG_X86_32 ----------------- return (gsi < IRQ_COMPRESSION_START ? gsi : gsi_to_irq[gsi]); -----------------#else ----------------- return gsi; -----------------#endif ----------------- } ----------------- set_bit(ioapic_pin, mp_ioapic_routing[ioapic].pin_programmed); -----------------#ifdef CONFIG_X86_32 ----------------- /* ----------------- * For GSI >= 64, use IRQ compression ----------------- */ ----------------- if ((gsi >= IRQ_COMPRESSION_START) ----------------- && (triggering == ACPI_LEVEL_SENSITIVE)) { ----------------- /* ----------------- * For PCI devices assign IRQs in order, avoiding gaps ----------------- * due to unused I/O APIC pins. ----------------- */ ----------------- int irq = gsi; ----------------- if (gsi < MAX_GSI_NUM) { ----------------- /* ----------------- * Retain the VIA chipset work-around (gsi > 15), but ----------------- * avoid a problem where the 8254 timer (IRQ0) is setup ----------------- * via an override (so it's not on pin 0 of the ioapic), ----------------- * and at the same time, the pin 0 interrupt is a PCI ----------------- * type. The gsi > 15 test could cause these two pins ----------------- * to be shared as IRQ0, and they are not shareable. ----------------- * So test for this condition, and if necessary, avoid ----------------- * the pin collision. ----------------- */ ----------------- gsi = pci_irq++; ----------------- /* ----------------- * Don't assign IRQ used by ACPI SCI ----------------- */ ----------------- if (gsi == acpi_gbl_FADT.sci_interrupt) ----------------- gsi = pci_irq++; ----------------- gsi_to_irq[irq] = gsi; ----------------- } else { ----------------- printk(KERN_ERR "GSI %u is too high\n", gsi); ----------------- return gsi; ----------------- } ----------------- } -----------------#endif ----------------- io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, ----------------- triggering == ACPI_EDGE_SENSITIVE ? 0 : 1, ----------------- polarity == ACPI_ACTIVE_HIGH ? 0 : 1); ----------------- return gsi; -----------------} +++++++++++++++++ if (enable_update_mptable) +++++++++++++++++ mp_config_acpi_gsi(dev, gsi, trigger, polarity); -----------------int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin, ----------------- u32 gsi, int triggering, int polarity) -----------------{ -----------------#ifdef CONFIG_X86_MPPARSE ----------------- struct mpc_intsrc mp_irq; ----------------- int ioapic; ---------- ------ ---------- ------ if (!acpi_ioapic) ---------- ------ return 0; +++++++++++++++++ set_io_apic_irq_attr(&irq_attr, ioapic, ioapic_pin, +++++++++++++++++ trigger == ACPI_EDGE_SENSITIVE ? 0 : 1, +++++++++++++++++ polarity == ACPI_ACTIVE_HIGH ? 0 : 1); +++++++++++++++++ io_apic_set_pci_routing(dev, gsi, &irq_attr); - if (!acpi_ioapic) - return 0; - ----------------- /* print the entry should happen on mptable identically */ ----------------- mp_irq.type = MP_INTSRC; ----------------- mp_irq.irqtype = mp_INT; ----------------- mp_irq.irqflag = (triggering == ACPI_EDGE_SENSITIVE ? 4 : 0x0c) | ----------------- (polarity == ACPI_ACTIVE_HIGH ? 1 : 3); ----------------- mp_irq.srcbus = number; ----------------- mp_irq.srcbusirq = (((devfn >> 3) & 0x1f) << 2) | ((pin - 1) & 3); ----------------- ioapic = mp_find_ioapic(gsi); ----------------- mp_irq.dstapic = mp_ioapic_routing[ioapic].apic_id; ----------------- mp_irq.dstirq = mp_find_ioapic_pin(ioapic, gsi); ----------------- ----------------- save_mp_irq(&mp_irq); -----------------#endif ----------------- return 0; +++++++++++++++++ return gsi; } /* diff --cc drivers/acpi/processor_idle.c index 10a2d913635a,10a2d913635a,10a2d913635a,10a2d913635a,10a2d913635a,10a2d913635a,10a2d913635a,10a2d913635a,10a2d913635a,4840c79fd8e0,72069ba5f1ed,1f60ccbd4c39,10a2d913635a,72069ba5f1ed,72069ba5f1ed,10a2d913635a,10a2d913635a,10a2d913635a..0efa59e7e3af --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@@@@@@@@@@@@@@@@@@ -839,7 -839,7 -839,7 -839,7 -839,7 -839,7 -839,7 -839,7 -839,7 -838,6 -835,6 -835,7 -839,7 -835,6 -835,6 -839,7 -839,7 -839,7 +838,7 @@@@@@@@@@@@@@@@@@@ static int acpi_idle_enter_c1(struct cp return 0; } --------- - --- acpi_state_timer_broadcast(pr, cx, 1); +++++++++++ ++++++ lapic_timer_state_broadcast(pr, cx, 1); kt1 = ktime_get_real(); acpi_idle_do_entry(cx); kt2 = ktime_get_real(); @@@@@@@@@@@@@@@@@@@ -847,7 -847,7 -847,7 -847,7 -847,7 -847,7 -847,7 -847,7 -847,7 -845,6 -842,6 -843,7 -847,7 -842,6 -842,6 -847,7 -847,7 -847,7 +846,7 @@@@@@@@@@@@@@@@@@@ local_irq_enable(); cx->usage++; --------- - --- acpi_state_timer_broadcast(pr, cx, 0); +++++++++++ ++++++ lapic_timer_state_broadcast(pr, cx, 0); return idle_time; } diff --cc drivers/acpi/video.c index 1bdfb37377e3,1bdfb37377e3,5adbf9361e60,1bdfb37377e3,1bdfb37377e3,1eff1625672a,a63566ba230b,1bdfb37377e3,1bdfb37377e3,810cca90ca7f,810cca90ca7f,1bdfb37377e3,1bdfb37377e3,810cca90ca7f,810cca90ca7f,1bdfb37377e3,9de143af3625,1bdfb37377e3..8851315ce858 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@@@@@@@@@@@@@@@@@@ -570,22 -570,22 -570,22 -570,22 -570,22 -570,30 -571,22 -570,22 -570,22 -570,6 -570,6 -570,22 -570,22 -570,6 -570,6 -570,22 -570,22 -570,22 +571,30 @@@@@@@@@@@@@@@@@@@ static struct dmi_system_id video_dmi_t DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710Z"), }, }, ++ ++ { ++ ++ .callback = video_set_bqc_offset, ++ ++ .ident = "eMachines E510", ++ ++ .matches = { ++ ++ DMI_MATCH(DMI_BOARD_VENDOR, "EMACHINES"), ++ ++ DMI_MATCH(DMI_PRODUCT_NAME, "eMachines E510"), ++ ++ }, ++ ++ }, ++ ++ { ++ ++ .callback = video_set_bqc_offset, ++ ++ .ident = "Acer Aspire 5315", ++ ++ .matches = { ++ ++ DMI_MATCH(DMI_BOARD_VENDOR, "Acer"), ++ ++ DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5315"), ++ ++ }, ++ ++ }, +++++ ++++++++++++ { +++++ ++++++++++++ .callback = video_set_bqc_offset, +++++ ++++++++++++ .ident = "Acer Aspire 7720", +++++ ++++++++++++ .matches = { +++++ ++++++++++++ DMI_MATCH(DMI_BOARD_VENDOR, "Acer"), +++++ ++++++++++++ DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720"), +++++ ++++++++++++ }, +++++ ++++++++++++ }, {} }; @@@@@@@@@@@@@@@@@@@ -2350,12 -2350,12 -2350,12 -2350,12 -2350,12 -2358,12 -2383,9 -2350,12 -2350,12 -2334,12 -2334,12 -2350,12 -2350,12 -2334,12 -2334,12 -2350,12 -2356,12 -2350,12 +2397,9 @@@@@@@@@@@@@@@@@@@ static int __init acpi_video_init(void return acpi_video_register(); } ------ -- -- ---void acpi_video_exit(void) -- -- void __exit acpi_video_exit(void) ++++++ +++++++++++static void __exit acpi_video_exit(void) { ------ ----------- ------ ----------- acpi_bus_unregister_driver(&acpi_video_bus); ------ ----------- ------ ----------- remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir); ++++++ +++++++++++ acpi_video_unregister(); return; } diff --cc drivers/platform/x86/hp-wmi.c index 16fffe44e333,50d9019de2be,50d9019de2be,50d9019de2be,50d9019de2be,50d9019de2be,50d9019de2be,50d9019de2be,50d9019de2be,50d9019de2be,50d9019de2be,50d9019de2be,50d9019de2be,50d9019de2be,50d9019de2be,50d9019de2be,50d9019de2be,46a7a6e8ed91..4ac2311c00af --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@@@@@@@@@@@@@@@@@@ -151,22 -151,34 -151,34 -151,34 -151,34 -151,34 -151,34 -151,34 -151,34 -151,34 -151,34 -151,34 -151,34 -151,34 -151,34 -151,34 -151,34 -150,49 +150,37 @@@@@@@@@@@@@@@@@@@ static int hp_wmi_als_state(void static int hp_wmi_dock_state(void) { ----------------- return hp_wmi_perform_query(HPWMI_DOCK_QUERY, 0, 0); ---------------- } +++++++++++++++++ int ret = hp_wmi_perform_query(HPWMI_HARDWARE_QUERY, 0, 0); + ---------------- static int hp_wmi_wifi_set(void *data, enum rfkill_state state) ---------------- { ---------------- if (state) ---------------- return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, 0x101); ---------------- else ---------------- return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, 0x100); +++++++++++++++++ if (ret < 0) +++++++++++++++++ return ret; +++++++++++++++++ +++++++++++++++++ return ret & 0x1; + } + ---------------- static int hp_wmi_bluetooth_set(void *data, enum rfkill_state state) +++++++++++++++++ static int hp_wmi_tablet_state(void) + { ---------------- if (state) ---------------- return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, 0x202); ---------------- else ---------------- return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, 0x200); +++++++++++++++++ int ret = hp_wmi_perform_query(HPWMI_HARDWARE_QUERY, 0, 0); +++++++++++++++++ +++++++++++++++++ if (ret < 0) +++++++++++++++++ return ret; +++++++++++++++++ +++++++++++++++++ return (ret & 0x4) ? 1 : 0; } ---------------- static int hp_wmi_wwan_set(void *data, enum rfkill_state state) -static int hp_wmi_wifi_set(void *data, enum rfkill_state state) +++++++++++++++++static int hp_wmi_set_block(void *data, bool blocked) { ----------------- if (state) ---------------- return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, 0x404); - return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, 0x101); ----------------- else ---------------- return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, 0x400); - return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, 0x100); -} +++++++++++++++++ unsigned long b = (unsigned long) data; +++++++++++++++++ int query = BIT(b + 8) | ((!!blocked) << b); ++++++++++++++++ -static int hp_wmi_bluetooth_set(void *data, enum rfkill_state state) -{ - if (state) - return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, 0x202); - else - return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, 0x200); +++++++++++++++++ return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, query); } ---------------- static int hp_wmi_wifi_state(void) -static int hp_wmi_wwan_set(void *data, enum rfkill_state state) -{ - if (state) - return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, 0x404); - else - return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, 0x400); -} +++++++++++++++++static const struct rfkill_ops hp_wmi_rfkill_ops = { +++++++++++++++++ .set_block = hp_wmi_set_block, +++++++++++++++++}; ++++++++++++++++ -static int hp_wmi_wifi_state(void) +++++++++++++++++static bool hp_wmi_wifi_state(void) { int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); @@@@@@@@@@@@@@@@@@@ -326,23 -338,23 -338,23 -338,23 -338,23 -338,23 -338,23 -338,23 -338,23 -338,23 -338,23 -338,23 -338,23 -338,23 -338,23 -338,23 -338,23 -362,23 +350,23 @@@@@@@@@@@@@@@@@@@ static void hp_wmi_notify(u32 value, vo key->keycode, 0); input_sync(hp_wmi_input_dev); break; ----------------- case KE_SW: ----------------- input_report_switch(hp_wmi_input_dev, ----------------- key->keycode, ----------------- hp_wmi_dock_state()); ----------------- input_sync(hp_wmi_input_dev); ----------------- break; } +++++++++++++++++ } else if (eventcode == 0x1) { +++++++++++++++++ input_report_switch(hp_wmi_input_dev, SW_DOCK, +++++++++++++++++ hp_wmi_dock_state()); +++++++++++++++++ input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE, +++++++++++++++++ hp_wmi_tablet_state()); +++++++++++++++++ input_sync(hp_wmi_input_dev); } else if (eventcode == 0x5) { if (wifi_rfkill) ----------------- rfkill_force_state(wifi_rfkill, ----------------- hp_wmi_wifi_state()); +++++++++++++++++ rfkill_set_sw_state(wifi_rfkill, +++++++++++++++++ hp_wmi_wifi_state()); if (bluetooth_rfkill) ----------------- rfkill_force_state(bluetooth_rfkill, ----------------- hp_wmi_bluetooth_state()); +++++++++++++++++ rfkill_set_sw_state(bluetooth_rfkill, +++++++++++++++++ hp_wmi_bluetooth_state()); if (wwan_rfkill) ----------------- rfkill_force_state(wwan_rfkill, ----------------- hp_wmi_wwan_state()); +++++++++++++++++ rfkill_set_sw_state(wwan_rfkill, +++++++++++++++++ hp_wmi_wwan_state()); } else printk(KERN_INFO "HP WMI: Unknown key pressed - %x\n", eventcode); diff --cc drivers/platform/x86/thinkpad_acpi.c index 40d64c03278c,912be65b6261,912be65b6261,912be65b6261,912be65b6261,912be65b6261,912be65b6261,912be65b6261,912be65b6261,912be65b6261,912be65b6261,912be65b6261,912be65b6261,912be65b6261,912be65b6261,27ca676a7092,912be65b6261,912be65b6261..a463fd72c495 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@@@@@@@@@@@@@@@@@@ -2503,32 -2230,15 -2230,15 -2230,15 -2230,15 -2230,15 -2230,15 -2230,15 -2230,15 -2230,15 -2230,15 -2230,15 -2230,15 -2230,15 -2230,15 -2301,15 -2230,15 -2230,15 +2574,32 @@@@@@@@@@@@@@@@@@@ static void tpacpi_send_radiosw_update( { int wlsw; ----------------- /* Sync these BEFORE sending any rfkill events */ ----------------- if (tp_features.bluetooth) ----------------- bluetooth_update_rfk(); ----------------- if (tp_features.wan) ----------------- wan_update_rfk(); ----------------- if (tp_features.uwb) ----------------- uwb_update_rfk(); +++++++++++++++++ /* +++++++++++++++++ * We must sync all rfkill controllers *before* issuing any +++++++++++++++++ * rfkill input events, or we will race the rfkill core input +++++++++++++++++ * handler. +++++++++++++++++ * +++++++++++++++++ * tpacpi_inputdev_send_mutex works as a syncronization point +++++++++++++++++ * for the above. +++++++++++++++++ * +++++++++++++++++ * We optimize to avoid numerous calls to hotkey_get_wlsw. +++++++++++++++++ */ +++++++++++++++++ +++++++++++++++++ wlsw = hotkey_get_wlsw(); ++++++++++++++ ++ - if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&wlsw)) { +++++++++++++++++ /* Sync hw blocking state first if it is hw-blocked */ +++++++++++++++++ if (wlsw == TPACPI_RFK_RADIO_OFF) +++++++++++++++++ tpacpi_rfk_update_hwblock_state(true); +++++++++++++++++ +++++++++++++++++ /* Sync sw blocking state */ +++++++++++++++++ tpacpi_rfk_update_swstate_all(); + -------------- -- if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&wlsw)) { +++++++++++++++++ /* Sync hw blocking state last if it is hw-unblocked */ +++++++++++++++++ if (wlsw == TPACPI_RFK_RADIO_ON) +++++++++++++++++ tpacpi_rfk_update_hwblock_state(false); +++++++++++++++++ +++++++++++++++++ /* Issue rfkill input event for WLSW switch */ +++++++++++++++++ if (!(wlsw < 0)) { mutex_lock(&tpacpi_inputdev_send_mutex); input_report_switch(tpacpi_inputdev, @@@@@@@@@@@@@@@@@@@ -3374,16 -3088,41 -3088,41 -3088,41 -3088,41 -3088,41 -3088,41 -3088,41 -3088,41 -3088,41 -3088,41 -3088,41 -3088,41 -3088,41 -3088,41 -3159,41 -3088,41 -3088,41 +3445,16 @@@@@@@@@@@@@@@@@@@ static int bluetooth_get_status(void return -EIO; return ((status & TP_ACPI_BLUETOOTH_RADIOSSW) != 0) ? ----------------- RFKILL_STATE_UNBLOCKED : RFKILL_STATE_SOFT_BLOCKED; - } - - static void bluetooth_update_rfk(void) - { - int status; - - if (!tpacpi_bluetooth_rfkill) - return; - - status = bluetooth_get_radiosw(); - if (status < 0) - return; - rfkill_force_state(tpacpi_bluetooth_rfkill, status); - - vdbg_printk(TPACPI_DBG_RFKILL, - "forced rfkill state to %d\n", - status); +++++++++++++++++ TPACPI_RFK_RADIO_ON : TPACPI_RFK_RADIO_OFF; } -------------- --static void bluetooth_update_rfk(void) - static int bluetooth_set_radiosw(int radio_on, int update_rfk) +++++++++++++++++static int bluetooth_set_status(enum tpacpi_rfkill_state state) { int status; -------------- -- if (!tpacpi_bluetooth_rfkill) -------------- -- return; - if (!tp_features.bluetooth) - return -ENODEV; ----------------- -------------- -- status = bluetooth_get_radiosw(); -------------- -- if (status < 0) -------------- -- return; -------------- -- rfkill_force_state(tpacpi_bluetooth_rfkill, status); - /* WLSW overrides bluetooth in firmware/hardware, but there is no - * reason to risk weird behaviour. */ - if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status - && radio_on) - return -EPERM; ----------------- vdbg_printk(TPACPI_DBG_RFKILL, -------------- -- "forced rfkill state to %d\n", -------------- -- status); -------------- --} -------------- -- -------------- --static int bluetooth_set_radiosw(int radio_on, int update_rfk) -------------- --{ -------------- -- int status; -------------- -- -------------- -- if (!tp_features.bluetooth) -------------- -- return -ENODEV; -------------- -- -------------- -- /* WLSW overrides bluetooth in firmware/hardware, but there is no -------------- -- * reason to risk weird behaviour. */ -------------- -- if (tp_features.hotkey_wlsw && !hotkey_get_wlsw(&status) && !status -------------- -- && radio_on) -------------- -- return -EPERM; -------------- -- -------------- -- vdbg_printk(TPACPI_DBG_RFKILL, ----------------- "will %s bluetooth\n", radio_on ? "enable" : "disable"); +++++++++++++++++ "will attempt to %s bluetooth\n", +++++++++++++++++ (state == TPACPI_RFK_RADIO_ON) ? "enable" : "disable"); #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES if (dbg_bluetoothemul) { @@@@@@@@@@@@@@@@@@@ -3501,35 -3277,71 -3277,71 -3277,71 -3277,71 -3277,71 -3277,71 -3277,71 -3277,71 -3277,71 -3277,71 -3277,71 -3277,71 -3277,71 -3277,71 -3348,71 -3277,71 -3277,71 +3572,35 @@@@@@@@@@@@@@@@@@@ static int __init bluetooth_init(struc if (!tp_features.bluetooth) return 1; ----------------- res = sysfs_create_group(&tpacpi_pdev->dev.kobj, ----------------- &bluetooth_attr_group); ----------------- if (res) ----------------- return res; ----------------- res = tpacpi_new_rfkill(TPACPI_RFK_BLUETOOTH_SW_ID, ----------------- &tpacpi_bluetooth_rfkill, -------------- -- RFKILL_TYPE_BLUETOOTH, -------------- -- TPACPI_RFK_BLUETOOTH_SW_NAME, -------------- -- true, -------------- -- tpacpi_bluetooth_rfk_set, -------------- -- tpacpi_bluetooth_rfk_get); -------------- -- if (res) { -------------- -- bluetooth_exit(); -------------- -- return res; -------------- -- } -------------- -- -------------- -- return 0; -------------- --} -------------- -- -------------- --/* procfs -------------------------------------------------------------- */ -------------- --static int bluetooth_read(char *p) -------------- --{ -------------- -- int len = 0; -------------- -- int status = bluetooth_get_radiosw(); -------------- -- -------------- -- if (!tp_features.bluetooth) -------------- -- len += sprintf(p + len, "status:\t\tnot supported\n"); -------------- -- else { -------------- -- len += sprintf(p + len, "status:\t\t%s\n", -------------- -- (status == RFKILL_STATE_UNBLOCKED) ? -------------- -- "enabled" : "disabled"); -------------- -- len += sprintf(p + len, "commands:\tenable, disable\n"); -------------- -- } -------------- -- -------------- -- return len; -------------- --} -------------- -- -------------- --static int bluetooth_write(char *buf) -------------- --{ -------------- -- char *cmd; -------------- -- int state = -1; -------------- -- -------------- -- if (!tp_features.bluetooth) -------------- -- return -ENODEV; -------------- -- -------------- -- while ((cmd = next_cmd(&buf))) { -------------- -- if (strlencmp(cmd, "enable") == 0) { -------------- -- state = 1; -------------- -- } else if (strlencmp(cmd, "disable") == 0) { -------------- -- state = 0; -------------- -- } else -------------- -- return -EINVAL; -------------- -- } +++++++++++++++++ &bluetooth_tprfk_ops, ++++++++++++++ ++ RFKILL_TYPE_BLUETOOTH, ++++++++++++++ ++ TPACPI_RFK_BLUETOOTH_SW_NAME, - true, - tpacpi_bluetooth_rfk_set, - tpacpi_bluetooth_rfk_get); +++++++++++++++++ true); +++++++++++++++++ if (res) +++++++++++++++++ return res; + -------------- -- if (state != -1) { -------------- -- tpacpi_disclose_usertask("procfs bluetooth", -------------- -- "attempt to %s\n", -------------- -- state ? "enable" : "disable"); -------------- -- bluetooth_set_radiosw(state, 1); +++++++++++++++++ res = sysfs_create_group(&tpacpi_pdev->dev.kobj, +++++++++++++++++ &bluetooth_attr_group); ++++++++++++++ ++ if (res) { - bluetooth_exit(); +++++++++++++++++ tpacpi_destroy_rfkill(TPACPI_RFK_BLUETOOTH_SW_ID); ++++++++++++++ ++ return res; } return 0; } ++++++++++++++ ++/* procfs -------------------------------------------------------------- */ ++++++++++++++ ++static int bluetooth_read(char *p) ++++++++++++++ ++{ - int len = 0; - int status = bluetooth_get_radiosw(); - - if (!tp_features.bluetooth) - len += sprintf(p + len, "status:\t\tnot supported\n"); - else { - len += sprintf(p + len, "status:\t\t%s\n", - (status == RFKILL_STATE_UNBLOCKED) ? - "enabled" : "disabled"); - len += sprintf(p + len, "commands:\tenable, disable\n"); - } - - return len; +++++++++++++++++ return tpacpi_rfk_procfs_read(TPACPI_RFK_BLUETOOTH_SW_ID, p); ++++++++++++++ ++} ++++++++++++++ ++ ++++++++++++++ ++static int bluetooth_write(char *buf) ++++++++++++++ ++{ - char *cmd; - int state = -1; - - if (!tp_features.bluetooth) - return -ENODEV; - - while ((cmd = next_cmd(&buf))) { - if (strlencmp(cmd, "enable") == 0) { - state = 1; - } else if (strlencmp(cmd, "disable") == 0) { - state = 0; - } else - return -EINVAL; - } - - if (state != -1) { - tpacpi_disclose_usertask("procfs bluetooth", - "attempt to %s\n", - state ? "enable" : "disable"); - bluetooth_set_radiosw(state, 1); - } - - return 0; +++++++++++++++++ return tpacpi_rfk_procfs_write(TPACPI_RFK_BLUETOOTH_SW_ID, buf); ++++++++++++++ ++} ++++++++++++++ ++ static struct ibm_struct bluetooth_driver_data = { .name = "bluetooth", .read = bluetooth_read,