Skip to content

Commit

Permalink
Merge tag 'platform-drivers-x86-v5.1-1' of git://git.infradead.org/li…
Browse files Browse the repository at this point in the history
…nux-platform-drivers-x86

Pull x86 platform driver updates from Darren Hart:

 - use MODULE_DEVICE_TABLE across several wmi drivers, keeping
   wmi_device_id and MODULE_ALIAS() declarations in sync

 - add several Ideapad models to the no_hw_rfkill list

 - add support for new Mellanox platforms, including new fan and LED
   functionality

 - address Dell keyboard backlight change event and power button release
   issues

 - update dell_rbu to use appropriate memory allocation mechanisms

 - several small fixes and Ice Lake support for intel_pmc_core

 - fix a suspend regression for Cherry Trail based devices in
   intel_int0002_vgpio

 - a few other routine fixes

* tag 'platform-drivers-x86-v5.1-1' of git://git.infradead.org/linux-platform-drivers-x86: (50 commits)
  MAINTAINERS: Include mlxreg.h in Mellanox Platform Driver files
  platform/x86: ideapad-laptop: Add S130-14IGM to no_hw_rfkill list
  platform/x86: mlx-platform: Fix access mode for fan_dir attribute
  platform/x86: mlx-platform: Add UID LED for the next generation systems
  platform/x86: mlx-platform: Add extra CPLD for next generation systems
  platform/x86: wmi-bmof: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
  platform/x86: intel-wmi-thunderbolt: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
  platform/x86: huawei-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
  platform/x86: dell-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
  platform/x86: dell-wmi-descriptor: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
  platform/x86: dell-smbios-wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS()
  platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()
  platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h
  modpost: file2alias: define size of alias
  platform/x86: touchscreen_dmi: Add info for the CHUWI Hi10 Air tablet
  platform/x86: ideapad-laptop: Add Ideapad 530S-14ARR to no_hw_rfkill list
  platform/x86: ideapad-laptop: Add Yoga C930 to no_hw_rfkill_list
  platform/x86: intel_pmc_core: Quirk to ignore XTAL shutdown
  platform/x86: intel_pmc_core: Add Package cstates residency info
  platform/x86: intel_pmc_core: Add ICL platform support
  ...
  • Loading branch information
torvalds committed Mar 10, 2019
2 parents 45ba8d5 + 9c22cc0 commit dbbdf54
Show file tree
Hide file tree
Showing 27 changed files with 541 additions and 100 deletions.
14 changes: 13 additions & 1 deletion Documentation/ABI/stable/sysfs-driver-mlxreg-io
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,19 @@ Description: These files show with which CPLD versions have been burned
The files are read only.

What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/
cpld3_version
fan_dir

Date: December 2018
KernelVersion: 5.0
Contact: Vadim Pasternak <vadimpmellanox.com>
Description: This file shows the system fans direction:
forward direction - relevant bit is set 0;
reversed direction - relevant bit is set 1.

The files are read only.

What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/
jtag_enable

Date: November 2018
KernelVersion: 5.0
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -9900,6 +9900,7 @@ M: Vadim Pasternak <vadimp@mellanox.com>
L: platform-driver-x86@vger.kernel.org
S: Supported
F: drivers/platform/mellanox/
F: include/linux/platform_data/mlxreg.h

MELLANOX MLX4 core VPI driver
M: Tariq Toukan <tariqt@mellanox.com>
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
*/
static const struct acpi_device_id i2c_multi_instantiate_ids[] = {
{"BSG1160", },
{"BSG2150", },
{"INT33FE", },
{"INT3515", },
{}
Expand Down
19 changes: 19 additions & 0 deletions drivers/leds/leds-mlxreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define MLXREG_LED_AMBER_SOLID 0x09 /* Solid amber */
#define MLXREG_LED_BLINK_3HZ 167 /* ~167 msec off/on - HW support */
#define MLXREG_LED_BLINK_6HZ 83 /* ~83 msec off/on - HW support */
#define MLXREG_LED_CAPABILITY_CLEAR GENMASK(31, 8) /* Clear mask */

/**
* struct mlxreg_led_data - led control data:
Expand Down Expand Up @@ -187,6 +188,7 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv)
struct mlxreg_led_data *led_data;
struct led_classdev *led_cdev;
enum led_brightness brightness;
u32 regval;
int i;
int err;

Expand All @@ -196,6 +198,23 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv)
if (!led_data)
return -ENOMEM;

if (data->capability) {
err = regmap_read(led_pdata->regmap, data->capability,
&regval);
if (err) {
dev_err(&priv->pdev->dev, "Failed to query capability register\n");
return err;
}
if (!(regval & data->bit))
continue;
/*
* Field "bit" can contain one capability bit in 0 byte
* and offset bit in 1-3 bytes. Clear capability bit and
* keep only offset bit.
*/
data->bit &= MLXREG_LED_CAPABILITY_CLEAR;
}

led_cdev = &led_data->led_cdev;
led_data->data_parent = priv;
if (strstr(data->label, "red") ||
Expand Down
28 changes: 25 additions & 3 deletions drivers/platform/mellanox/mlxreg-hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ mlxreg_hotplug_work_helper(struct mlxreg_hotplug_priv_data *priv,
struct mlxreg_core_item *item)
{
struct mlxreg_core_data *data;
u32 asserted, regval, bit;
unsigned long asserted;
u32 regval, bit;
int ret;

/*
Expand Down Expand Up @@ -281,7 +282,7 @@ mlxreg_hotplug_work_helper(struct mlxreg_hotplug_priv_data *priv,
asserted = item->cache ^ regval;
item->cache = regval;

for_each_set_bit(bit, (unsigned long *)&asserted, 8) {
for_each_set_bit(bit, &asserted, 8) {
data = item->data + bit;
if (regval & BIT(bit)) {
if (item->inversed)
Expand Down Expand Up @@ -495,7 +496,9 @@ static int mlxreg_hotplug_set_irq(struct mlxreg_hotplug_priv_data *priv)
{
struct mlxreg_core_hotplug_platform_data *pdata;
struct mlxreg_core_item *item;
int i, ret;
struct mlxreg_core_data *data;
u32 regval;
int i, j, ret;

pdata = dev_get_platdata(&priv->pdev->dev);
item = pdata->items;
Expand All @@ -507,6 +510,25 @@ static int mlxreg_hotplug_set_irq(struct mlxreg_hotplug_priv_data *priv)
if (ret)
goto out;

/*
* Verify if hardware configuration requires to disable
* interrupt capability for some of components.
*/
data = item->data;
for (j = 0; j < item->count; j++, data++) {
/* Verify if the attribute has capability register. */
if (data->capability) {
/* Read capability register. */
ret = regmap_read(priv->regmap,
data->capability, &regval);
if (ret)
goto out;

if (!(regval & data->bit))
item->mask &= ~BIT(j);
}
}

/* Set group initial status as mask and unmask group event. */
if (item->inversed) {
item->cache = item->mask;
Expand Down
9 changes: 2 additions & 7 deletions drivers/platform/x86/asus-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2265,12 +2265,12 @@ static int asus_wmi_probe(struct platform_device *pdev)
int ret;

if (!wmi_has_guid(ASUS_WMI_MGMT_GUID)) {
pr_warn("Management GUID not found\n");
pr_warn("ASUS Management GUID not found\n");
return -ENODEV;
}

if (wdrv->event_guid && !wmi_has_guid(wdrv->event_guid)) {
pr_warn("Event GUID not found\n");
pr_warn("ASUS Event GUID not found\n");
return -ENODEV;
}

Expand Down Expand Up @@ -2320,11 +2320,6 @@ EXPORT_SYMBOL_GPL(asus_wmi_unregister_driver);

static int __init asus_wmi_init(void)
{
if (!wmi_has_guid(ASUS_WMI_MGMT_GUID)) {
pr_info("Asus Management GUID not found\n");
return -ENODEV;
}

pr_info("ASUS WMI generic driver loaded\n");
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/x86/dell-smbios-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,4 @@ void exit_dell_smbios_wmi(void)
wmi_driver_unregister(&dell_smbios_wmi_driver);
}

MODULE_ALIAS("wmi:" DELL_WMI_SMBIOS_GUID);
MODULE_DEVICE_TABLE(wmi, dell_smbios_wmi_id_table);
2 changes: 1 addition & 1 deletion drivers/platform/x86/dell-wmi-descriptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static struct wmi_driver dell_wmi_descriptor_driver = {

module_wmi_driver(dell_wmi_descriptor_driver);

MODULE_ALIAS("wmi:" DELL_WMI_DESCRIPTOR_GUID);
MODULE_DEVICE_TABLE(wmi, dell_wmi_descriptor_id_table);
MODULE_AUTHOR("Mario Limonciello <mario.limonciello@dell.com>");
MODULE_DESCRIPTION("Dell WMI descriptor driver");
MODULE_LICENSE("GPL");
7 changes: 5 additions & 2 deletions drivers/platform/x86/dell-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ MODULE_LICENSE("GPL");

static bool wmi_requires_smbios_request;

MODULE_ALIAS("wmi:"DELL_EVENT_GUID);

struct dell_wmi_priv {
struct input_dev *input_dev;
u32 interface_version;
Expand Down Expand Up @@ -267,6 +265,9 @@ static const struct key_entry dell_wmi_keymap_type_0010[] = {
/* Fn-lock switched to multimedia keys */
{ KE_IGNORE, 0x1, { KEY_RESERVED } },

/* Keyboard backlight change notification */
{ KE_IGNORE, 0x3f, { KEY_RESERVED } },

/* Mic mute */
{ KE_KEY, 0x150, { KEY_MICMUTE } },

Expand Down Expand Up @@ -738,3 +739,5 @@ static void __exit dell_wmi_exit(void)
wmi_driver_unregister(&dell_wmi_driver);
}
module_exit(dell_wmi_exit);

MODULE_DEVICE_TABLE(wmi, dell_wmi_id_table);
50 changes: 14 additions & 36 deletions drivers/platform/x86/dell_rbu.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ static struct _rbu_data {
unsigned long image_update_buffer_size;
unsigned long bios_image_size;
int image_update_ordernum;
int dma_alloc;
spinlock_t lock;
unsigned long packet_read_count;
unsigned long num_packets;
Expand Down Expand Up @@ -89,7 +88,6 @@ static struct packet_data packet_data_head;

static struct platform_device *rbu_device;
static int context;
static dma_addr_t dell_rbu_dmaaddr;

static void init_packet_head(void)
{
Expand Down Expand Up @@ -380,12 +378,8 @@ static void img_update_free(void)
*/
memset(rbu_data.image_update_buffer, 0,
rbu_data.image_update_buffer_size);
if (rbu_data.dma_alloc == 1)
dma_free_coherent(NULL, rbu_data.bios_image_size,
rbu_data.image_update_buffer, dell_rbu_dmaaddr);
else
free_pages((unsigned long) rbu_data.image_update_buffer,
rbu_data.image_update_ordernum);
free_pages((unsigned long) rbu_data.image_update_buffer,
rbu_data.image_update_ordernum);

/*
* Re-initialize the rbu_data variables after a free
Expand All @@ -394,7 +388,6 @@ static void img_update_free(void)
rbu_data.image_update_buffer = NULL;
rbu_data.image_update_buffer_size = 0;
rbu_data.bios_image_size = 0;
rbu_data.dma_alloc = 0;
}

/*
Expand All @@ -410,10 +403,8 @@ static void img_update_free(void)
static int img_update_realloc(unsigned long size)
{
unsigned char *image_update_buffer = NULL;
unsigned long rc;
unsigned long img_buf_phys_addr;
int ordernum;
int dma_alloc = 0;

/*
* check if the buffer of sufficient size has been
Expand Down Expand Up @@ -444,36 +435,23 @@ static int img_update_realloc(unsigned long size)

ordernum = get_order(size);
image_update_buffer =
(unsigned char *) __get_free_pages(GFP_KERNEL, ordernum);

img_buf_phys_addr =
(unsigned long) virt_to_phys(image_update_buffer);

if (img_buf_phys_addr > BIOS_SCAN_LIMIT) {
free_pages((unsigned long) image_update_buffer, ordernum);
ordernum = -1;
image_update_buffer = dma_alloc_coherent(NULL, size,
&dell_rbu_dmaaddr, GFP_KERNEL);
dma_alloc = 1;
}

(unsigned char *)__get_free_pages(GFP_DMA32, ordernum);
spin_lock(&rbu_data.lock);

if (image_update_buffer != NULL) {
rbu_data.image_update_buffer = image_update_buffer;
rbu_data.image_update_buffer_size = size;
rbu_data.bios_image_size =
rbu_data.image_update_buffer_size;
rbu_data.image_update_ordernum = ordernum;
rbu_data.dma_alloc = dma_alloc;
rc = 0;
} else {
if (!image_update_buffer) {
pr_debug("Not enough memory for image update:"
"size = %ld\n", size);
rc = -ENOMEM;
return -ENOMEM;
}

return rc;
img_buf_phys_addr = (unsigned long)virt_to_phys(image_update_buffer);
if (WARN_ON_ONCE(img_buf_phys_addr > BIOS_SCAN_LIMIT))
return -EINVAL; /* can't happen per definition */

rbu_data.image_update_buffer = image_update_buffer;
rbu_data.image_update_buffer_size = size;
rbu_data.bios_image_size = rbu_data.image_update_buffer_size;
rbu_data.image_update_ordernum = ordernum;
return 0;
}

static ssize_t read_packet_data(char *buffer, loff_t pos, size_t count)
Expand Down
3 changes: 1 addition & 2 deletions drivers/platform/x86/huawei-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ static struct wmi_driver huawei_wmi_driver = {

module_wmi_driver(huawei_wmi_driver);

MODULE_ALIAS("wmi:"WMI0_EVENT_GUID);
MODULE_ALIAS("wmi:"AMW0_EVENT_GUID);
MODULE_DEVICE_TABLE(wmi, huawei_wmi_id_table);
MODULE_AUTHOR("Ayman Bagabas <ayman.bagabas@gmail.com>");
MODULE_DESCRIPTION("Huawei WMI hotkeys");
MODULE_LICENSE("GPL v2");
9 changes: 9 additions & 0 deletions drivers/platform/x86/i2c-multi-instantiate.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ static const struct i2c_inst_data bsg1160_data[] = {
{}
};

static const struct i2c_inst_data bsg2150_data[] = {
{ "bmc150_accel", IRQ_RESOURCE_GPIO, 0 },
{ "bmc150_magn" },
/* The resources describe a 3th client, but it is not really there. */
{ "bsg2150_dummy_dev" },
{}
};

static const struct i2c_inst_data int3515_data[] = {
{ "tps6598x", IRQ_RESOURCE_APIC, 0 },
{ "tps6598x", IRQ_RESOURCE_APIC, 1 },
Expand All @@ -173,6 +181,7 @@ static const struct i2c_inst_data int3515_data[] = {
*/
static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = {
{ "BSG1160", (unsigned long)bsg1160_data },
{ "BSG2150", (unsigned long)bsg2150_data },
{ "INT3515", (unsigned long)int3515_data },
{ }
};
Expand Down
37 changes: 36 additions & 1 deletion drivers/platform/x86/ideapad-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
.ident = "Lenovo RESCUER R720-15IKBN",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_BOARD_NAME, "80WW"),
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo R720-15IKBN"),
},
},
{
Expand Down Expand Up @@ -1090,6 +1090,27 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15ISK"),
},
},
{
.ident = "Lenovo ideapad 330-15ICH",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 330-15ICH"),
},
},
{
.ident = "Lenovo ideapad 530S-14ARR",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 530S-14ARR"),
},
},
{
.ident = "Lenovo ideapad S130-14IGM",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad S130-14IGM"),
},
},
{
.ident = "Lenovo ideapad Y700-14ISK",
.matches = {
Expand Down Expand Up @@ -1153,6 +1174,13 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Legion Y530-15ICH"),
},
},
{
.ident = "Lenovo Legion Y530-15ICH-1060",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Legion Y530-15ICH-1060"),
},
},
{
.ident = "Lenovo Legion Y720-15IKB",
.matches = {
Expand Down Expand Up @@ -1244,6 +1272,13 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 920-13IKB"),
},
},
{
.ident = "Lenovo YOGA C930-13IKB",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA C930-13IKB"),
},
},
{
.ident = "Lenovo Zhaoyang E42-80",
.matches = {
Expand Down
Loading

0 comments on commit dbbdf54

Please sign in to comment.