Lines 10-15
Link Here
|
10 |
* Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
10 |
* Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
11 |
*/ |
11 |
*/ |
12 |
|
12 |
|
|
|
13 |
#include <linux/dmi.h> |
13 |
#include <linux/err.h> |
14 |
#include <linux/err.h> |
14 |
#include <linux/bug.h> |
15 |
#include <linux/bug.h> |
15 |
#include <linux/kernel.h> |
16 |
#include <linux/kernel.h> |
Lines 36-41
Link Here
|
36 |
#include "pinctrl-utils.h" |
37 |
#include "pinctrl-utils.h" |
37 |
#include "pinctrl-amd.h" |
38 |
#include "pinctrl-amd.h" |
38 |
|
39 |
|
|
|
40 |
struct quirk_entry { |
41 |
u16 ignore_pin; |
42 |
}; |
43 |
|
44 |
static struct quirk_entry quirk_gpio18_bug = { |
45 |
.ignore_pin = 0x12, |
46 |
}; |
47 |
|
48 |
static const struct dmi_system_id fwbug_list[] __initconst = { |
49 |
/* |
50 |
* Interrupt storm on WLAN_WAKEUP pin |
51 |
* https://bugzilla.kernel.org/show_bug.cgi?id=216208 |
52 |
*/ |
53 |
{ |
54 |
.ident = "ASUS ZenBook UX325UAZ_UM325UAZ/UX325UAZ", |
55 |
.driver_data = &quirk_gpio18_bug, |
56 |
.matches = { |
57 |
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
58 |
DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325UAZ_UM325UAZ/UX325UAZ"), |
59 |
}, |
60 |
}, |
61 |
}; |
62 |
|
39 |
static int amd_gpio_get_direction(struct gpio_chip *gc, unsigned offset) |
63 |
static int amd_gpio_get_direction(struct gpio_chip *gc, unsigned offset) |
40 |
{ |
64 |
{ |
41 |
unsigned long flags; |
65 |
unsigned long flags; |
Lines 779-784
static int amd_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
Link Here
|
779 |
enum pin_config_param param; |
803 |
enum pin_config_param param; |
780 |
struct amd_gpio *gpio_dev = pinctrl_dev_get_drvdata(pctldev); |
804 |
struct amd_gpio *gpio_dev = pinctrl_dev_get_drvdata(pctldev); |
781 |
|
805 |
|
|
|
806 |
if (gpio_dev->quirks && (gpio_dev->quirks->ignore_pin == pin)) { |
807 |
dev_warn(&gpio_dev->pdev->dev, "Ignoring programming pin %d due to firmware bug\n", |
808 |
pin); |
809 |
return -ENOTSUPP; |
810 |
} |
782 |
raw_spin_lock_irqsave(&gpio_dev->lock, flags); |
811 |
raw_spin_lock_irqsave(&gpio_dev->lock, flags); |
783 |
for (i = 0; i < num_configs; i++) { |
812 |
for (i = 0; i < num_configs; i++) { |
784 |
param = pinconf_to_config_param(configs[i]); |
813 |
param = pinconf_to_config_param(configs[i]); |
Lines 969-974
static int amd_gpio_probe(struct platform_device *pdev)
Link Here
|
969 |
struct resource *res; |
998 |
struct resource *res; |
970 |
struct amd_gpio *gpio_dev; |
999 |
struct amd_gpio *gpio_dev; |
971 |
struct gpio_irq_chip *girq; |
1000 |
struct gpio_irq_chip *girq; |
|
|
1001 |
const struct dmi_system_id *dmi_id; |
972 |
|
1002 |
|
973 |
gpio_dev = devm_kzalloc(&pdev->dev, |
1003 |
gpio_dev = devm_kzalloc(&pdev->dev, |
974 |
sizeof(struct amd_gpio), GFP_KERNEL); |
1004 |
sizeof(struct amd_gpio), GFP_KERNEL); |
Lines 1058-1063
static int amd_gpio_probe(struct platform_device *pdev)
Link Here
|
1058 |
platform_set_drvdata(pdev, gpio_dev); |
1088 |
platform_set_drvdata(pdev, gpio_dev); |
1059 |
acpi_register_wakeup_handler(gpio_dev->irq, amd_gpio_check_wake, gpio_dev); |
1089 |
acpi_register_wakeup_handler(gpio_dev->irq, amd_gpio_check_wake, gpio_dev); |
1060 |
|
1090 |
|
|
|
1091 |
dmi_id = dmi_first_match(fwbug_list); |
1092 |
if (dmi_id) |
1093 |
gpio_dev->quirks = dmi_id->driver_data; |
1094 |
|
1061 |
dev_dbg(&pdev->dev, "amd gpio driver loaded\n"); |
1095 |
dev_dbg(&pdev->dev, "amd gpio driver loaded\n"); |
1062 |
return ret; |
1096 |
return ret; |
1063 |
|
1097 |
|