Diploma?

2013-12-02 Thread Full Name
Diploma?

http://tiny.cc/5znllggplb
--
To unsubscribe from this list: send the line unsubscribe platform-driver-x86 
in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] dell-laptop: Add back rfkill code

2013-12-02 Thread Stanislaw Gruszka
This is basically a revert of:

commit a6c2390cd6d2083d27a2359658e08f2d3df375ac
Author: Matthew Garrett m...@redhat.com
Date:   Fri Jun 1 12:46:56 2012 -0400

dell-laptop: Remove rfkill code

Except that patch add whilelist of Dell systems where dell-laptop
specific RFKILL code is needed. For now, patch only add Dell Latitude
6430U laptop to whitelist, in the future other systems probably
will be added.

Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=958826

Reported-and-tested-by: Marco Driusso marcodriu...@gmail.com
Reported-and-tested-by: Fabien Archambault marbolan...@gmail.com
Signed-off-by: Stanislaw Gruszka sgrus...@redhat.com
---
Patch is quite big, but it should probably be addressed to -stable.
I'm leaving that decision up to maintainer.

 drivers/platform/x86/dell-laptop.c | 250 +
 1 file changed, 250 insertions(+)

diff --git a/drivers/platform/x86/dell-laptop.c 
b/drivers/platform/x86/dell-laptop.c
index bb77e18..e210819 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -21,6 +21,7 @@
 #include linux/err.h
 #include linux/dmi.h
 #include linux/io.h
+#include linux/rfkill.h
 #include linux/power_supply.h
 #include linux/acpi.h
 #include linux/mm.h
@@ -89,6 +90,9 @@ static struct platform_driver platform_driver = {
 
 static struct platform_device *platform_device;
 static struct backlight_device *dell_backlight_device;
+static struct rfkill *wifi_rfkill;
+static struct rfkill *bluetooth_rfkill;
+static struct rfkill *wwan_rfkill;
 
 static const struct dmi_system_id dell_device_table[] __initconst = {
{
@@ -263,6 +267,17 @@ static struct dmi_system_id dell_quirks[] = {
{ }
 };
 
+/* List of systems that need Dell specific RFKILL handling */
+static struct dmi_system_id dell_rfkill_whitelist[] = {
+   {
+   .ident = Dell Latitude 6430U,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, Dell Inc.),
+   DMI_MATCH(DMI_PRODUCT_NAME, Latitude 6430U),
+   },
+   },
+};
+
 static struct calling_interface_buffer *buffer;
 static struct page *bufferpage;
 static DEFINE_MUTEX(buffer_mutex);
@@ -355,6 +370,94 @@ dell_send_request(struct calling_interface_buffer *buffer, 
int class,
return buffer;
 }
 
+/* Derived from information in DellWirelessCtl.cpp:
+   Class 17, select 11 is radio control. It returns an array of 32-bit values.
+
+   Input byte 0 = 0: Wireless information
+
+   result[0]: return code
+   result[1]:
+ Bit 0:  Hardware switch supported
+ Bit 1:  Wifi locator supported
+ Bit 2:  Wifi is supported
+ Bit 3:  Bluetooth is supported
+ Bit 4:  WWAN is supported
+ Bit 5:  Wireless keyboard supported
+ Bits 6-7:   Reserved
+ Bit 8:  Wifi is installed
+ Bit 9:  Bluetooth is installed
+ Bit 10: WWAN is installed
+ Bits 11-15: Reserved
+ Bit 16: Hardware switch is on
+ Bit 17: Wifi is blocked
+ Bit 18: Bluetooth is blocked
+ Bit 19: WWAN is blocked
+ Bits 20-31: Reserved
+   result[2]: NVRAM size in bytes
+   result[3]: NVRAM format version number
+
+   Input byte 0 = 2: Wireless switch configuration
+   result[0]: return code
+   result[1]:
+ Bit 0:  Wifi controlled by switch
+ Bit 1:  Bluetooth controlled by switch
+ Bit 2:  WWAN controlled by switch
+ Bits 3-6:   Reserved
+ Bit 7:  Wireless switch config locked
+ Bit 8:  Wifi locator enabled
+ Bits 9-14:  Reserved
+ Bit 15: Wifi locator setting locked
+ Bits 16-31: Reserved
+*/
+
+static int dell_rfkill_set(void *data, bool blocked)
+{
+   int disable = blocked ? 1 : 0;
+   unsigned long radio = (unsigned long)data;
+   int hwswitch_bit = (unsigned long)data - 1;
+   int ret = 0;
+
+   get_buffer();
+   dell_send_request(buffer, 17, 11);
+
+   /* If the hardware switch controls this radio, and the hardware
+  switch is disabled, don't allow changing the software state */
+   if ((hwswitch_state  BIT(hwswitch_bit)) 
+   !(buffer-output[1]  BIT(16))) {
+   ret = -EINVAL;
+   goto out;
+   }
+
+   buffer-input[0] = (1 | (radio8) | (disable  16));
+   dell_send_request(buffer, 17, 11);
+
+out:
+   release_buffer();
+   return ret;
+}
+
+static void dell_rfkill_query(struct rfkill *rfkill, void *data)
+{
+   int status;
+   int bit = (unsigned long)data + 16;
+   int hwswitch_bit = (unsigned long)data - 1;
+
+   get_buffer();
+   dell_send_request(buffer, 17, 11);
+   status = buffer-output[1];
+   release_buffer();
+
+   rfkill_set_sw_state(rfkill, !!(status  BIT(bit)));
+
+   if (hwswitch_state  (BIT(hwswitch_bit)))
+   rfkill_set_hw_state(rfkill, !(status  BIT(16)));
+}
+
+static const struct rfkill_ops dell_rfkill_ops = {
+   .set_block = 

Re: [PATCH] dell-laptop: Add back rfkill code

2013-12-02 Thread Matthew Garrett
On Mon, Dec 02, 2013 at 01:11:05PM +0100, Stanislaw Gruszka wrote:
 This is basically a revert of:
 
 commit a6c2390cd6d2083d27a2359658e08f2d3df375ac
 Author: Matthew Garrett m...@redhat.com
 Date:   Fri Jun 1 12:46:56 2012 -0400
 
 dell-laptop: Remove rfkill code
 
 Except that patch add whilelist of Dell systems where dell-laptop
 specific RFKILL code is needed. For now, patch only add Dell Latitude
 6430U laptop to whitelist, in the future other systems probably
 will be added.

It's already added back to 3.13, along with a whitelist entry for all 
latitudes. I'm not going to add whitelisting for specific modules, and 
I'm not enthusiastic about pushing to stable.

-- 
Matthew Garrett | mj...@srcf.ucam.org
--
To unsubscribe from this list: send the line unsubscribe platform-driver-x86 
in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


PATCH 23/39] platform: x86: remove DEFINE_PCI_DEVICE_TABLE macro

2013-12-02 Thread Jingoo Han
Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro
is not preferred.

Signed-off-by: Jingoo Han jg1@samsung.com
---
 drivers/platform/x86/intel_ips.c |2 +-
 drivers/platform/x86/intel_scu_ipc.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
index 18dcb58..a0d1f57 100644
--- a/drivers/platform/x86/intel_ips.c
+++ b/drivers/platform/x86/intel_ips.c
@@ -1478,7 +1478,7 @@ ips_link_to_i915_driver(void)
 }
 EXPORT_SYMBOL_GPL(ips_link_to_i915_driver);
 
-static DEFINE_PCI_DEVICE_TABLE(ips_id_table) = {
+static const struct pci_device_id ips_id_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL,
 PCI_DEVICE_ID_INTEL_THERMAL_SENSOR), },
{ 0, }
diff --git a/drivers/platform/x86/intel_scu_ipc.c 
b/drivers/platform/x86/intel_scu_ipc.c
index 60ea476..6a39f03 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -649,7 +649,7 @@ static void ipc_remove(struct pci_dev *pdev)
intel_scu_devices_destroy();
 }
 
-static DEFINE_PCI_DEVICE_TABLE(pci_ids) = {
+static const struct pci_device_id pci_ids[] = {
{PCI_VDEVICE(INTEL, 0x082a), SCU_IPC_LINCROFT},
{PCI_VDEVICE(INTEL, 0x080e), SCU_IPC_PENWELL},
{PCI_VDEVICE(INTEL, 0x08ea), SCU_IPC_CLOVERVIEW},
-- 
1.7.10.4


--
To unsubscribe from this list: send the line unsubscribe platform-driver-x86 
in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] ipc: simplify platform data approach

2013-12-02 Thread David Cohen
This patch removes the unnecessary enum for platform type to handle the
array of pdatas. We can set pdata directly to pci_device_id struct
instead.

Signed-off-by: David Cohen david.a.co...@linux.intel.com
---
 drivers/platform/x86/intel_scu_ipc.c | 84 +---
 1 file changed, 40 insertions(+), 44 deletions(-)

diff --git a/drivers/platform/x86/intel_scu_ipc.c 
b/drivers/platform/x86/intel_scu_ipc.c
index 60ea476a9130..259969d31055 100644
--- a/drivers/platform/x86/intel_scu_ipc.c
+++ b/drivers/platform/x86/intel_scu_ipc.c
@@ -62,13 +62,6 @@
 #define IPC_RWBUF_SIZE20   /* IPC Read buffer Size */
 #define IPC_IOC  0x100 /* IPC command register IOC bit 
*/
 
-enum {
-   SCU_IPC_LINCROFT,
-   SCU_IPC_PENWELL,
-   SCU_IPC_CLOVERVIEW,
-   SCU_IPC_TANGIER,
-};
-
 /* intel scu ipc driver data*/
 struct intel_scu_ipc_pdata_t {
u32 ipc_base;
@@ -78,35 +71,29 @@ struct intel_scu_ipc_pdata_t {
u8 irq_mode;
 };
 
-static struct intel_scu_ipc_pdata_t intel_scu_ipc_pdata[] = {
-   [SCU_IPC_LINCROFT] = {
-   .ipc_base = 0xff11c000,
-   .i2c_base = 0xff12b000,
-   .ipc_len = 0x100,
-   .i2c_len = 0x10,
-   .irq_mode = 0,
-   },
-   [SCU_IPC_PENWELL] = {
-   .ipc_base = 0xff11c000,
-   .i2c_base = 0xff12b000,
-   .ipc_len = 0x100,
-   .i2c_len = 0x10,
-   .irq_mode = 1,
-   },
-   [SCU_IPC_CLOVERVIEW] = {
-   .ipc_base = 0xff11c000,
-   .i2c_base = 0xff12b000,
-   .ipc_len = 0x100,
-   .i2c_len = 0x10,
-   .irq_mode = 1,
-   },
-   [SCU_IPC_TANGIER] = {
-   .ipc_base = 0xff009000,
-   .i2c_base  = 0xff00d000,
-   .ipc_len  = 0x100,
-   .i2c_len = 0x10,
-   .irq_mode = 0,
-   },
+static struct intel_scu_ipc_pdata_t intel_scu_ipc_lincroft_pdata = {
+   .ipc_base = 0xff11c000,
+   .i2c_base = 0xff12b000,
+   .ipc_len = 0x100,
+   .i2c_len = 0x10,
+   .irq_mode = 0,
+};
+
+/* Penwell and Cloverview */
+static struct intel_scu_ipc_pdata_t intel_scu_ipc_penwell_pdata = {
+   .ipc_base = 0xff11c000,
+   .i2c_base = 0xff12b000,
+   .ipc_len = 0x100,
+   .i2c_len = 0x10,
+   .irq_mode = 1,
+};
+
+static struct intel_scu_ipc_pdata_t intel_scu_ipc_tangier_pdata = {
+   .ipc_base = 0xff009000,
+   .i2c_base  = 0xff00d000,
+   .ipc_len  = 0x100,
+   .i2c_len = 0x10,
+   .irq_mode = 0,
 };
 
 static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id);
@@ -583,15 +570,14 @@ static irqreturn_t ioc(int irq, void *dev_id)
  */
 static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
-   int err, pid;
+   int err;
struct intel_scu_ipc_pdata_t *pdata;
resource_size_t pci_resource;
 
if (ipcdev.pdev)/* We support only one SCU */
return -EBUSY;
 
-   pid = id-driver_data;
-   pdata = intel_scu_ipc_pdata[pid];
+   pdata = (struct intel_scu_ipc_pdata_t *)id-driver_data;
 
ipcdev.pdev = pci_dev_get(dev);
ipcdev.irq_mode = pdata-irq_mode;
@@ -650,11 +636,21 @@ static void ipc_remove(struct pci_dev *pdev)
 }
 
 static DEFINE_PCI_DEVICE_TABLE(pci_ids) = {
-   {PCI_VDEVICE(INTEL, 0x082a), SCU_IPC_LINCROFT},
-   {PCI_VDEVICE(INTEL, 0x080e), SCU_IPC_PENWELL},
-   {PCI_VDEVICE(INTEL, 0x08ea), SCU_IPC_CLOVERVIEW},
-   {PCI_VDEVICE(INTEL, 0x11a0), SCU_IPC_TANGIER},
-   { 0,}
+   {
+   PCI_VDEVICE(INTEL, 0x082a),
+   (kernel_ulong_t)intel_scu_ipc_lincroft_pdata,
+   }, {
+   PCI_VDEVICE(INTEL, 0x080e),
+   (kernel_ulong_t)intel_scu_ipc_penwell_pdata,
+   }, {
+   PCI_VDEVICE(INTEL, 0x08ea),
+   (kernel_ulong_t)intel_scu_ipc_penwell_pdata,
+   }, {
+   PCI_VDEVICE(INTEL, 0x11a0),
+   (kernel_ulong_t)intel_scu_ipc_tangier_pdata,
+   }, {
+   0,
+   }
 };
 MODULE_DEVICE_TABLE(pci, pci_ids);
 
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe platform-driver-x86 
in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] dell-wmi: Add quirk for Dell Inspiron 3138

2013-12-02 Thread AceLan Kao
The acpi_video0 interface doesn't not work on Dell Inspiron 3138,
so using the vendor brightness interface, instead of the acpi one.

Signed-off-by: AceLan Kao acelan@canonical.com
---
 drivers/platform/x86/dell-laptop.c | 17 +
 1 file changed, 17 insertions(+)

diff --git a/drivers/platform/x86/dell-laptop.c 
b/drivers/platform/x86/dell-laptop.c
index c608b1d..9d2a4af 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -62,6 +62,7 @@ struct calling_interface_structure {
 
 struct quirk_entry {
u8 touchpad_led;
+   u8 vendor_backlight;
 };
 
 static struct quirk_entry *quirks;
@@ -70,6 +71,10 @@ static struct quirk_entry quirk_dell_vostro_v130 = {
.touchpad_led = 1,
 };
 
+static struct quirk_entry quirk_dell_inspiron_3138 = {
+   .vendor_backlight = 1,
+};
+
 static int dmi_matched(const struct dmi_system_id *dmi)
 {
quirks = dmi-driver_data;
@@ -268,6 +273,15 @@ static struct dmi_system_id dell_quirks[] = {
},
.driver_data = quirk_dell_vostro_v130,
},
+   {
+   .callback = dmi_matched,
+   .ident = Dell Inspiron 3138,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, Dell Inc.),
+   DMI_MATCH(DMI_PRODUCT_NAME, Inspiron 3138),
+   },
+   .driver_data = quirk_dell_inspiron_3138,
+   },
{ }
 };
 
@@ -843,6 +857,9 @@ static int __init dell_init(void)
dell_debugfs_fops);
 
 #ifdef CONFIG_ACPI
+   if (quirks  quirks-vendor_backlight)
+   acpi_video_dmi_promote_vendor();
+
/* In the event of an ACPI backlight being available, don't
 * register the platform controller.
 */
-- 
1.8.3.2

--
To unsubscribe from this list: send the line unsubscribe platform-driver-x86 
in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] dell-wmi: Add quirk for Dell Inspiron 3138

2013-12-02 Thread Matthew Garrett
On Tue, Dec 03, 2013 at 02:50:07PM +0800, AceLan Kao wrote:
 The acpi_video0 interface doesn't not work on Dell Inspiron 3138,
 so using the vendor brightness interface, instead of the acpi one.

No, this needs to be fixed properly by disabling the ACPI interface on 
Windows 8 systems.

-- 
Matthew Garrett | mj...@srcf.ucam.org
--
To unsubscribe from this list: send the line unsubscribe platform-driver-x86 
in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] dell-wmi: Add quirk for Dell Inspiron 3138

2013-12-02 Thread AceLan Kao
Hi Matthew,

Sorry, I don't understand what you mean.

Let me explain it again.
The BIOS engineer refuse to remove the ACPI functions(_BCM) in BIOS code,
so we'll have acpi_video0 interface be created under
/sys/class/backlight/ and that interface doesn't work.
This patch is equal to add this kernel command line acpi_backlight=vendor
So that, there will be no acpi_video0 be create, and we will use
intel_backlight interface instead.

Best regards,
AceLan Kao.

2013/12/3 Matthew Garrett mj...@srcf.ucam.org:
 On Tue, Dec 03, 2013 at 02:50:07PM +0800, AceLan Kao wrote:
 The acpi_video0 interface doesn't not work on Dell Inspiron 3138,
 so using the vendor brightness interface, instead of the acpi one.

 No, this needs to be fixed properly by disabling the ACPI interface on
 Windows 8 systems.

 --
 Matthew Garrett | mj...@srcf.ucam.org
 --
 To unsubscribe from this list: send the line unsubscribe 
 platform-driver-x86 in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Chia-Lin Kao(AceLan)
http://blog.acelan.idv.tw/
E-Mail: acelan.kaoATcanonical.com (s/AT/@/)
--
To unsubscribe from this list: send the line unsubscribe platform-driver-x86 
in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] dell-wmi: Add quirk for Dell Inspiron 3138

2013-12-02 Thread Matthew Garrett
On Tue, Dec 03, 2013 at 03:31:45PM +0800, AceLan Kao wrote:
 Hi Matthew,
 
 Sorry, I don't understand what you mean.
 
 Let me explain it again.
 The BIOS engineer refuse to remove the ACPI functions(_BCM) in BIOS code,
 so we'll have acpi_video0 interface be created under
 /sys/class/backlight/ and that interface doesn't work.
 This patch is equal to add this kernel command line acpi_backlight=vendor
 So that, there will be no acpi_video0 be create, and we will use
 intel_backlight interface instead.

Right. This isn't a Dell-specific problem. Windows 8 doesn't use the 
ACPI backlight interface, so any system that calls _OSI(Windows 2012) 
should use the Intel interface instead. It needs to be fixed in general, 
not in the platform drivers.

-- 
Matthew Garrett | mj...@srcf.ucam.org
--
To unsubscribe from this list: send the line unsubscribe platform-driver-x86 
in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html