Merge branches 'acerhdf', 'acpi-pci-bind', 'bjorn-pci-root', 'bugzilla-12904', 'bugzi...
authorLen Brown <len.brown@intel.com>
Wed, 24 Jun 2009 05:19:50 +0000 (01:19 -0400)
committerLen Brown <len.brown@intel.com>
Wed, 24 Jun 2009 05:19:50 +0000 (01:19 -0400)
20 files changed:
1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18 
Documentation/kernel-parameters.txt
Documentation/laptops/thinkpad-acpi.txt
MAINTAINERS
arch/x86/include/asm/pci_x86.h
arch/x86/kernel/acpi/boot.c
drivers/acpi/pci_irq.c
drivers/acpi/pci_root.c
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/scan.c
drivers/acpi/video.c
drivers/platform/x86/Kconfig
drivers/platform/x86/hp-wmi.c
drivers/platform/x86/thinkpad_acpi.c
drivers/pnp/pnpacpi/rsparser.c
include/acpi/acpi_bus.h
include/acpi/acpi_drivers.h
include/linux/acpi.h
include/linux/pci_hotplug.h
init/main.c

Simple merge
diff --cc MAINTAINERS
index 303129ab4b7509bff0ed0ce3960d5c6b7bc53ff9,e9457feb7eba6f9f138815977c165b6749e93461,cf4abddfc8a40dcc161e851c26294480fff3076f,cf4abddfc8a40dcc161e851c26294480fff3076f,cf4abddfc8a40dcc161e851c26294480fff3076f,cf4abddfc8a40dcc161e851c26294480fff3076f,cf4abddfc8a40dcc161e851c26294480fff3076f,cf4abddfc8a40dcc161e851c26294480fff3076f,cf4abddfc8a40dcc161e851c26294480fff3076f,77cbfb1a696c7c676d0b1526b05155674d4b3cd7,77cbfb1a696c7c676d0b1526b05155674d4b3cd7,cf4abddfc8a40dcc161e851c26294480fff3076f,cf4abddfc8a40dcc161e851c26294480fff3076f,77cbfb1a696c7c676d0b1526b05155674d4b3cd7,77cbfb1a696c7c676d0b1526b05155674d4b3cd7,cf4abddfc8a40dcc161e851c26294480fff3076f,cf4abddfc8a40dcc161e851c26294480fff3076f,cf4abddfc8a40dcc161e851c26294480fff3076f..7d9d3745aab9d7eb4e0868cec9e9868069fdb1ce
                  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
                  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.*
                  
Simple merge
index 631086159c53b0be5f28df92d3e2ed976cffa7a8,723989d7f8029711c0a6fda92e8016101ac2ede7,723989d7f8029711c0a6fda92e8016101ac2ede7,723989d7f8029711c0a6fda92e8016101ac2ede7,723989d7f8029711c0a6fda92e8016101ac2ede7,723989d7f8029711c0a6fda92e8016101ac2ede7,723989d7f8029711c0a6fda92e8016101ac2ede7,723989d7f8029711c0a6fda92e8016101ac2ede7,723989d7f8029711c0a6fda92e8016101ac2ede7,723989d7f8029711c0a6fda92e8016101ac2ede7,723989d7f8029711c0a6fda92e8016101ac2ede7,f54e0e557cd293b8ee5e84b92b75d0907898223e,723989d7f8029711c0a6fda92e8016101ac2ede7,723989d7f8029711c0a6fda92e8016101ac2ede7,723989d7f8029711c0a6fda92e8016101ac2ede7,723989d7f8029711c0a6fda92e8016101ac2ede7,723989d7f8029711c0a6fda92e8016101ac2ede7,723989d7f8029711c0a6fda92e8016101ac2ede7..6b8ca3a0285d77512219724750bca449fa3a8a67
                                       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;
                  }
                  
                  /*
Simple merge
Simple merge
Simple merge
index 10a2d913635a99d76502309efb55895d7a92c5e4,10a2d913635a99d76502309efb55895d7a92c5e4,10a2d913635a99d76502309efb55895d7a92c5e4,10a2d913635a99d76502309efb55895d7a92c5e4,10a2d913635a99d76502309efb55895d7a92c5e4,10a2d913635a99d76502309efb55895d7a92c5e4,10a2d913635a99d76502309efb55895d7a92c5e4,10a2d913635a99d76502309efb55895d7a92c5e4,10a2d913635a99d76502309efb55895d7a92c5e4,4840c79fd8e010ceab40ff1706efc575aad4e5bc,72069ba5f1edc666d765f0131d509290e74244ab,1f60ccbd4c398e520740faa0f129cf6ab4d281a7,10a2d913635a99d76502309efb55895d7a92c5e4,72069ba5f1edc666d765f0131d509290e74244ab,72069ba5f1edc666d765f0131d509290e74244ab,10a2d913635a99d76502309efb55895d7a92c5e4,10a2d913635a99d76502309efb55895d7a92c5e4,10a2d913635a99d76502309efb55895d7a92c5e4..0efa59e7e3afd16095fa538f333f11f37ca7a9d4
@@@@@@@@@@@@@@@@@@@ -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();
                  
                        local_irq_enable();
                        cx->usage++;
---------   -  ---      acpi_state_timer_broadcast(pr, cx, 0);
+++++++++++ ++++++      lapic_timer_state_broadcast(pr, cx, 0);
                  
                        return idle_time;
                  }
Simple merge
index 1bdfb37377e32d58bcd1f3e35e858c1cc681aa5c,1bdfb37377e32d58bcd1f3e35e858c1cc681aa5c,5adbf9361e6081fe63f194eed5521f39d1386031,1bdfb37377e32d58bcd1f3e35e858c1cc681aa5c,1bdfb37377e32d58bcd1f3e35e858c1cc681aa5c,1eff1625672a151969adcb79d83fa255c3473f60,a63566ba230b941790e0d714ced395089c1cf946,1bdfb37377e32d58bcd1f3e35e858c1cc681aa5c,1bdfb37377e32d58bcd1f3e35e858c1cc681aa5c,810cca90ca7f0e390c2ad3a4dee33353848a0d43,810cca90ca7f0e390c2ad3a4dee33353848a0d43,1bdfb37377e32d58bcd1f3e35e858c1cc681aa5c,1bdfb37377e32d58bcd1f3e35e858c1cc681aa5c,810cca90ca7f0e390c2ad3a4dee33353848a0d43,810cca90ca7f0e390c2ad3a4dee33353848a0d43,1bdfb37377e32d58bcd1f3e35e858c1cc681aa5c,9de143af3625908f6d43e471b255c76d56af1cd5,1bdfb37377e32d58bcd1f3e35e858c1cc681aa5c..8851315ce858a2e2eb1e4ffd2d2b6b695fa8bfb8
@@@@@@@@@@@@@@@@@@@ -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;
                  }
Simple merge
index 16fffe44e3335ee34b4053e7b309b6e4dd3a631b,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,50d9019de2be2b33beae302ef0d99480073c0b52,46a7a6e8ed9119e4001c1323c98f415144bf1c01..4ac2311c00afe9fae55fcf1334522a564fd943e5
@@@@@@@@@@@@@@@@@@@ -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);
index 40d64c03278ca4bd18db3cf8214e11a9412cc0e7,912be65b62619570d3521dd0b83664ce16582278,912be65b62619570d3521dd0b83664ce16582278,912be65b62619570d3521dd0b83664ce16582278,912be65b62619570d3521dd0b83664ce16582278,912be65b62619570d3521dd0b83664ce16582278,912be65b62619570d3521dd0b83664ce16582278,912be65b62619570d3521dd0b83664ce16582278,912be65b62619570d3521dd0b83664ce16582278,912be65b62619570d3521dd0b83664ce16582278,912be65b62619570d3521dd0b83664ce16582278,912be65b62619570d3521dd0b83664ce16582278,912be65b62619570d3521dd0b83664ce16582278,912be65b62619570d3521dd0b83664ce16582278,912be65b62619570d3521dd0b83664ce16582278,27ca676a7092e1fe98288e8757489b95131e8951,912be65b62619570d3521dd0b83664ce16582278,912be65b62619570d3521dd0b83664ce16582278..a463fd72c49560a7c5d7fe2f8744a614519f7f34
                  {
                        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,
                                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) {
                        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;
                  }
                  
               -        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;
 ++++++++++++++ ++/* procfs -------------------------------------------------------------- */
 ++++++++++++++ ++static int bluetooth_read(char *p)
 ++++++++++++++ ++{
               -        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_read(TPACPI_RFK_BLUETOOTH_SW_ID, p);
 ++++++++++++++ ++}
 ++++++++++++++ ++
 ++++++++++++++ ++static int bluetooth_write(char *buf)
 ++++++++++++++ ++{
 +++++++++++++++++      return tpacpi_rfk_procfs_write(TPACPI_RFK_BLUETOOTH_SW_ID, buf);
 ++++++++++++++ ++}
 ++++++++++++++ ++
                  static struct ibm_struct bluetooth_driver_data = {
                        .name = "bluetooth",
                        .read = bluetooth_read,
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc init/main.c
Simple merge