diff options
author | Nicolas Chauvet <kwizart@gmail.com> | 2014-06-02 21:51:28 +0200 |
---|---|---|
committer | Nicolas Chauvet <kwizart@gmail.com> | 2014-07-07 16:21:17 +0200 |
commit | 33114ec6ba07e8ce38353b92a0554f9a71e83535 (patch) | |
tree | 2ef3cb36cdb930e79ff9dc7d0b12e0ad69b59790 | |
parent | a34e5ddbb0300885755e268f2f9ddab6bdbd284c (diff) | |
download | kernel-33114ec6ba07e8ce38353b92a0554f9a71e83535.tar.gz kernel-33114ec6ba07e8ce38353b92a0554f9a71e83535.tar.xz kernel-33114ec6ba07e8ce38353b92a0554f9a71e83535.zip |
Add marvin24s patches
-rw-r--r-- | 0001-rt2x00-move-frequent-messages-to-debug-level.patch | 47 | ||||
-rw-r--r-- | 0002-NOT_FOR_UPSTREAM-staging-nvec-move-led-init-out-of-p.patch | 129 | ||||
-rw-r--r-- | 0003-NOT_FOR_UPSTREAM-staging-nvec-add-support-for-lid-an.patch | 221 | ||||
-rw-r--r-- | 0004-NOT_FOR_UPSTREAM-staging-nvec-remove-lid-and-power-e.patch | 84 | ||||
-rw-r--r-- | 0005-NOT_FOR_UPSTREAM-staging-nvec-update-TODO.patch | 28 | ||||
-rw-r--r-- | kernel.spec | 15 |
6 files changed, 524 insertions, 0 deletions
diff --git a/0001-rt2x00-move-frequent-messages-to-debug-level.patch b/0001-rt2x00-move-frequent-messages-to-debug-level.patch new file mode 100644 index 00000000..1ae3e779 --- /dev/null +++ b/0001-rt2x00-move-frequent-messages-to-debug-level.patch @@ -0,0 +1,47 @@ +From 425d6115dc8e9b17c190949660e3faf2772a6d5e Mon Sep 17 00:00:00 2001 +From: Stanislaw Gruszka <sgruszka@redhat.com> +Date: Fri, 31 Jan 2014 13:18:09 +0100 +Subject: [PATCH 1/6] rt2x00: move frequent messages to debug level + +On commit 28f2bce9f8bbf704c86f8c684337f82c51592c81 I make change that +print various messages as default. This can cause flood of messages +related to TX status timeout on some environments. I partially fixed +problem on commit bb9c298f3193ac5b80e47b325c690700580b6bcf, but forgot +to move two more messages to debug level. + +Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> +--- + drivers/net/wireless/rt2x00/rt2800usb.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c +index caddc1b..14a90dd 100644 +--- a/drivers/net/wireless/rt2x00/rt2800usb.c ++++ b/drivers/net/wireless/rt2x00/rt2800usb.c +@@ -125,9 +125,9 @@ static inline bool rt2800usb_entry_txstatus_timeout(struct queue_entry *entry) + + tout = time_after(jiffies, entry->last_action + msecs_to_jiffies(100)); + if (unlikely(tout)) +- rt2x00_warn(entry->queue->rt2x00dev, +- "TX status timeout for entry %d in queue %d\n", +- entry->entry_idx, entry->queue->qid); ++ rt2x00_dbg(entry->queue->rt2x00dev, ++ "TX status timeout for entry %d in queue %d\n", ++ entry->entry_idx, entry->queue->qid); + return tout; + + } +@@ -566,8 +566,8 @@ static void rt2800usb_txdone(struct rt2x00_dev *rt2x00dev) + queue = rt2x00queue_get_tx_queue(rt2x00dev, qid); + + if (unlikely(rt2x00queue_empty(queue))) { +- rt2x00_warn(rt2x00dev, "Got TX status for an empty queue %u, dropping\n", +- qid); ++ rt2x00_dbg(rt2x00dev, "Got TX status for an empty queue %u, dropping\n", ++ qid); + break; + } + +-- +1.8.3.1 + diff --git a/0002-NOT_FOR_UPSTREAM-staging-nvec-move-led-init-out-of-p.patch b/0002-NOT_FOR_UPSTREAM-staging-nvec-move-led-init-out-of-p.patch new file mode 100644 index 00000000..b5f914be --- /dev/null +++ b/0002-NOT_FOR_UPSTREAM-staging-nvec-move-led-init-out-of-p.patch @@ -0,0 +1,129 @@ +From 207bed1a3e5b0a1c2f824b986d55972c31e99938 Mon Sep 17 00:00:00 2001 +From: Marc Dietrich <marvin24@gmx.de> +Date: Sun, 17 Jun 2012 19:53:33 +0200 +Subject: [PATCH 2/6] NOT_FOR_UPSTREAM: staging: nvec: move led init out of + probe to its own function + +Moves the led init to its own function. This is in preparation to +the following speaker mute inclusion via a gpio driver. + +Signed-off-by: Marc Dietrich <marvin24@gmx.de> +--- + drivers/staging/nvec/nvec_paz00.c | 73 +++++++++++++++++++-------------------- + 1 file changed, 35 insertions(+), 38 deletions(-) + +diff --git a/drivers/staging/nvec/nvec_paz00.c b/drivers/staging/nvec/nvec_paz00.c +index 934b796..a10385d 100644 +--- a/drivers/staging/nvec/nvec_paz00.c ++++ b/drivers/staging/nvec/nvec_paz00.c +@@ -11,72 +11,69 @@ + * + */ + +-#include <linux/module.h> + #include <linux/err.h> +-#include <linux/slab.h> + #include <linux/leds.h> ++#include <linux/module.h> ++#include <linux/slab.h> + #include <linux/platform_device.h> + #include "nvec.h" + +-#define to_nvec_led(led_cdev) \ +- container_of(led_cdev, struct nvec_led, cdev) ++#define NVEC_LED_MAX 8 + +-#define NVEC_LED_REQ {'\x0d', '\x10', '\x45', '\x10', '\x00'} ++enum nvec_oem0_subcmds { ++ EXEC_EC_CMD = 0x10, ++}; + +-#define NVEC_LED_MAX 8 ++enum nvec_oem0_ec_cmds { ++ SET_DEVICE_STATUS = 0x45, ++}; + +-struct nvec_led { +- struct led_classdev cdev; ++struct nvec_paz00_struct { + struct nvec_chip *nvec; ++ struct led_classdev *led_dev; + }; + ++struct nvec_paz00_struct nvec_paz00; ++ + static void nvec_led_brightness_set(struct led_classdev *led_cdev, + enum led_brightness value) + { +- struct nvec_led *led = to_nvec_led(led_cdev); +- unsigned char buf[] = NVEC_LED_REQ; +- buf[4] = value; +- +- nvec_write_async(led->nvec, buf, sizeof(buf)); +- +- led->cdev.brightness = value; ++ unsigned char buf[] = { NVEC_OEM0, EXEC_EC_CMD, SET_DEVICE_STATUS, ++ '\x10', value }; + ++ nvec_paz00.led_dev->brightness = value; ++ nvec_write_async(nvec_paz00.nvec, buf, sizeof(buf)); + } + +-static int nvec_paz00_probe(struct platform_device *pdev) ++static int paz00_init_leds(struct device *dev) + { +- struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent); +- struct nvec_led *led; +- int ret = 0; +- +- led = devm_kzalloc(&pdev->dev, sizeof(*led), GFP_KERNEL); +- if (led == NULL) ++ nvec_paz00.led_dev = devm_kzalloc(dev, sizeof(struct led_classdev), ++ GFP_KERNEL); ++ if (!nvec_paz00.led_dev) + return -ENOMEM; + +- led->cdev.max_brightness = NVEC_LED_MAX; ++ nvec_paz00.led_dev->max_brightness = NVEC_LED_MAX; ++ nvec_paz00.led_dev->brightness_set = nvec_led_brightness_set; ++ nvec_paz00.led_dev->brightness = 0; ++ nvec_paz00.led_dev->name = "paz00-led"; ++ nvec_paz00.led_dev->flags |= LED_CORE_SUSPENDRESUME; + +- led->cdev.brightness_set = nvec_led_brightness_set; +- led->cdev.name = "paz00-led"; +- led->cdev.flags |= LED_CORE_SUSPENDRESUME; +- led->nvec = nvec; +- +- platform_set_drvdata(pdev, led); ++ return led_classdev_register(dev, nvec_paz00.led_dev); ++} + +- ret = led_classdev_register(&pdev->dev, &led->cdev); +- if (ret < 0) +- return ret; ++static int nvec_paz00_probe(struct platform_device *pdev) ++{ ++ struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent); + +- /* to expose the default value to userspace */ +- led->cdev.brightness = 0; ++ platform_set_drvdata(pdev, &nvec_paz00); ++ nvec_paz00.nvec = nvec; + +- return 0; ++ return paz00_init_leds(&pdev->dev); + } + + static int nvec_paz00_remove(struct platform_device *pdev) + { +- struct nvec_led *led = platform_get_drvdata(pdev); +- +- led_classdev_unregister(&led->cdev); ++ led_classdev_unregister(nvec_paz00.led_dev); + + return 0; + } +-- +1.8.3.1 + diff --git a/0003-NOT_FOR_UPSTREAM-staging-nvec-add-support-for-lid-an.patch b/0003-NOT_FOR_UPSTREAM-staging-nvec-add-support-for-lid-an.patch new file mode 100644 index 00000000..3bf54c5c --- /dev/null +++ b/0003-NOT_FOR_UPSTREAM-staging-nvec-add-support-for-lid-an.patch @@ -0,0 +1,221 @@ +From febeab9b47096c0dce5eaeaceba4a1b8950e563c Mon Sep 17 00:00:00 2001 +From: Marc Dietrich <marvin24@gmx.de> +Date: Tue, 11 Mar 2014 13:00:38 +0100 +Subject: [PATCH 3/6] NOT_FOR_UPSTREAM: staging: nvec: add support for lid and + power button events + +The support is hardcoded in the board specific driver for now until we +get proper DT support. + +Signed-off-by: Marc Dietrich <marvin24@gmx.de> +--- + drivers/staging/nvec/nvec_paz00.c | 154 +++++++++++++++++++++++++++++++++++++- + 1 file changed, 152 insertions(+), 2 deletions(-) + +diff --git a/drivers/staging/nvec/nvec_paz00.c b/drivers/staging/nvec/nvec_paz00.c +index a10385d..732e9ff 100644 +--- a/drivers/staging/nvec/nvec_paz00.c ++++ b/drivers/staging/nvec/nvec_paz00.c +@@ -12,6 +12,7 @@ + */ + + #include <linux/err.h> ++#include <linux/input.h> + #include <linux/leds.h> + #include <linux/module.h> + #include <linux/slab.h> +@@ -19,6 +20,7 @@ + #include "nvec.h" + + #define NVEC_LED_MAX 8 ++#define NVEC_SYSTEM_EVENT_VAR_LENGTH (0xC5 & 0x8F) + + enum nvec_oem0_subcmds { + EXEC_EC_CMD = 0x10, +@@ -28,12 +30,47 @@ enum nvec_oem0_ec_cmds { + SET_DEVICE_STATUS = 0x45, + }; + ++enum nvec_sys_ec_cmds { ++ CONF_EV_REPORTING = 1, ++}; ++ + struct nvec_paz00_struct { + struct nvec_chip *nvec; + struct led_classdev *led_dev; ++ struct notifier_block notifier; ++}; ++ ++struct nvec_paz00_event { ++ char name[32]; ++ struct input_dev *dev; ++ int input_type; ++ int key_code; ++ unsigned long status_mask; ++}; ++ ++struct nvec_sys_event { ++ unsigned char command; ++ unsigned char length; ++ unsigned long payload; + }; + +-struct nvec_paz00_struct nvec_paz00; ++static struct nvec_paz00_struct nvec_paz00; ++ ++static struct nvec_paz00_event nvec_paz00_events[] = { ++ { ++ .name = "lid switch", ++ .input_type = EV_SW, ++ .key_code = SW_LID, ++ .status_mask = BIT(1), ++ }, { ++ .name = "power key", ++ .input_type = EV_KEY, ++ .key_code = KEY_POWER, ++ .status_mask = BIT(7), ++ }, { ++ /* sentinel */ ++ }, ++}; + + static void nvec_led_brightness_set(struct led_classdev *led_cdev, + enum led_brightness value) +@@ -61,20 +98,133 @@ static int paz00_init_leds(struct device *dev) + return led_classdev_register(dev, nvec_paz00.led_dev); + } + ++static int nvec_event_notifier(struct notifier_block *nb, ++ unsigned long event_type, void *data) ++{ ++ struct nvec_sys_event *event = data; ++ struct nvec_paz00_event *e = nvec_paz00_events; ++ ++ if (event_type != NVEC_SYSTEM_EVENT_VAR_LENGTH || ++ (event->command & (NVEC_VAR_SIZE << 5)) == 0 || ++ event->length != 4) ++ return NOTIFY_DONE; ++ ++ print_hex_dump(KERN_DEBUG, "payload: ", DUMP_PREFIX_NONE, 16, 1, ++ &event->command, event->length + 2, false); ++ ++ for (; e->name[0]; e++) { ++ if (e->status_mask & event->payload) { ++ if (test_bit(EV_KEY, e->dev->evbit)) { ++ input_report_key(e->dev, e->key_code, 1); ++ input_sync(e->dev); ++ input_report_key(e->dev, e->key_code, 0); ++ } else if (test_bit(EV_SW, e->dev->evbit)) { ++ input_report_switch(e->dev, e->key_code, 1); ++ } else { ++ pr_err("unknown event type\n"); ++ return NOTIFY_OK; ++ } ++ } else if (event->payload == 0) ++ input_report_switch(e->dev, e->key_code, 0); ++ ++ input_sync(e->dev); ++ } ++ ++ return NOTIFY_STOP; ++} ++ ++static void nvec_configure_event(struct nvec_chip *nvec, long mask, int state) ++{ ++ char buf[7] = { NVEC_SYS, CONF_EV_REPORTING, state }; ++ ++ buf[3] = (mask >> 16) & 0xff; ++ buf[4] = (mask >> 24) & 0xff; ++ buf[5] = (mask >> 0) & 0xff; ++ buf[6] = (mask >> 8) & 0xff; ++ ++ nvec_write_async(nvec, buf, 7); ++}; ++ ++static int paz00_init_events(struct device *dev) ++{ ++ struct nvec_paz00_event *event = nvec_paz00_events; ++ int err; ++ ++ for (; event->name[0]; event++) { ++ ++ event->dev = input_allocate_device(); ++ if (event->dev == NULL) { ++ dev_err(dev, "failed to allocate input device\n"); ++ break; ++ } ++ ++ event->dev->name = event->name; ++ event->dev->phys = "NVEC"; ++ event->dev->evbit[0] = BIT_MASK(event->input_type); ++ ++ if (event->input_type == EV_KEY) ++ set_bit(event->key_code, event->dev->keybit); ++ else if (event->input_type == EV_SW) ++ set_bit(event->key_code, event->dev->swbit); ++ else { ++ dev_err(dev, "unsupported event type %d\n", ++ event->input_type); ++ input_free_device(event->dev); ++ break; ++ } ++ ++ err = input_register_device(event->dev); ++ if (err) { ++ dev_err(dev, "failed to register input device (%d)\n", ++ err); ++ input_free_device(event->dev); ++ break; ++ } ++ ++ nvec_configure_event(nvec_paz00.nvec, event->status_mask, 1); ++ } ++ ++ nvec_paz00.notifier.notifier_call = nvec_event_notifier; ++ nvec_register_notifier(nvec_paz00.nvec, &nvec_paz00.notifier, 0); ++ ++ return err; ++} ++ + static int nvec_paz00_probe(struct platform_device *pdev) + { + struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent); ++ int ret; + + platform_set_drvdata(pdev, &nvec_paz00); + nvec_paz00.nvec = nvec; + +- return paz00_init_leds(&pdev->dev); ++ ret = paz00_init_leds(&pdev->dev); ++ if (!ret) ++ dev_err(&pdev->dev, "error registrating led device %d\n", ++ ret); ++ ++ ret = paz00_init_events(&pdev->dev); ++ if (!ret) ++ dev_err(&pdev->dev, "error registrating input device %d\n", ++ ret); ++ ++ return ret; + } + + static int nvec_paz00_remove(struct platform_device *pdev) + { ++ struct nvec_paz00_event *event = nvec_paz00_events; ++ + led_classdev_unregister(nvec_paz00.led_dev); + ++ nvec_unregister_notifier(nvec_paz00.nvec, &nvec_paz00.notifier); ++ ++ for (; event->name[0]; event++) { ++ nvec_configure_event(nvec_paz00.nvec, event->status_mask, 0); ++ input_unregister_device(event->dev); ++ input_free_device(event->dev); ++ } ++ + return 0; + } + +-- +1.8.3.1 + diff --git a/0004-NOT_FOR_UPSTREAM-staging-nvec-remove-lid-and-power-e.patch b/0004-NOT_FOR_UPSTREAM-staging-nvec-remove-lid-and-power-e.patch new file mode 100644 index 00000000..5ad1ccc6 --- /dev/null +++ b/0004-NOT_FOR_UPSTREAM-staging-nvec-remove-lid-and-power-e.patch @@ -0,0 +1,84 @@ +From 80fc2e686bf4b5b2f726241c77842bce23bd75e3 Mon Sep 17 00:00:00 2001 +From: Marc Dietrich <marvin24@gmx.de> +Date: Tue, 11 Mar 2014 21:04:07 +0100 +Subject: [PATCH 4/6] NOT_FOR_UPSTREAM: staging: nvec: remove lid and power + events enable from core driver + +This is done now in the board specific driver. + +Signed-off-by: Marc Dietrich <marvin24@gmx.de> +--- + drivers/staging/nvec/nvec.c | 35 +---------------------------------- + 1 file changed, 1 insertion(+), 34 deletions(-) + +diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c +index 3ee0b18..ae2ee77 100644 +--- a/drivers/staging/nvec/nvec.c ++++ b/drivers/staging/nvec/nvec.c +@@ -75,10 +75,7 @@ enum nvec_sleep_subcmds { + AP_SUSPEND, + }; + +-#define CNF_EVENT_REPORTING 0x01 + #define GET_FIRMWARE_VERSION 0x15 +-#define LID_SWITCH BIT(1) +-#define PWR_BUTTON BIT(15) + + static struct nvec_chip *nvec_power_handle; + +@@ -350,27 +347,6 @@ static void nvec_toggle_global_events(struct nvec_chip *nvec, bool state) + } + + /** +- * nvec_event_mask - fill the command string with event bitfield +- * ev: points to event command string +- * mask: bit to insert into the event mask +- * +- * Configure event command expects a 32 bit bitfield which describes +- * which events to enable. The bitfield has the following structure +- * (from highest byte to lowest): +- * system state bits 7-0 +- * system state bits 15-8 +- * oem system state bits 7-0 +- * oem system state bits 15-8 +- */ +-static void nvec_event_mask(char *ev, u32 mask) +-{ +- ev[3] = mask >> 16 & 0xff; +- ev[4] = mask >> 24 & 0xff; +- ev[5] = mask >> 0 & 0xff; +- ev[6] = mask >> 8 & 0xff; +-} +- +-/** + * nvec_request_master - Process outgoing messages + * @work: A &struct work_struct (the tx_worker member of &struct nvec_chip) + * +@@ -799,8 +775,7 @@ static int tegra_nvec_probe(struct platform_device *pdev) + struct resource *res; + void __iomem *base; + char get_firmware_version[] = { NVEC_CNTL, GET_FIRMWARE_VERSION }, +- unmute_speakers[] = { NVEC_OEM0, 0x10, 0x59, 0x95 }, +- enable_event[7] = { NVEC_SYS, CNF_EVENT_REPORTING, true }; ++ unmute_speakers[] = { NVEC_OEM0, 0x10, 0x59, 0x95 }; + + if (!pdev->dev.of_node) { + dev_err(&pdev->dev, "must be instantiated using device tree\n"); +@@ -903,14 +878,6 @@ static int tegra_nvec_probe(struct platform_device *pdev) + /* unmute speakers? */ + nvec_write_async(nvec, unmute_speakers, 4); + +- /* enable lid switch event */ +- nvec_event_mask(enable_event, LID_SWITCH); +- nvec_write_async(nvec, enable_event, 7); +- +- /* enable power button event */ +- nvec_event_mask(enable_event, PWR_BUTTON); +- nvec_write_async(nvec, enable_event, 7); +- + return 0; + } + +-- +1.8.3.1 + diff --git a/0005-NOT_FOR_UPSTREAM-staging-nvec-update-TODO.patch b/0005-NOT_FOR_UPSTREAM-staging-nvec-update-TODO.patch new file mode 100644 index 00000000..189ebbd5 --- /dev/null +++ b/0005-NOT_FOR_UPSTREAM-staging-nvec-update-TODO.patch @@ -0,0 +1,28 @@ +From dae19aa6e59d89f211f47e09763b2fa9e5434bd1 Mon Sep 17 00:00:00 2001 +From: Marc Dietrich <marvin24@gmx.de> +Date: Tue, 11 Mar 2014 21:24:49 +0100 +Subject: [PATCH 5/6] NOT_FOR_UPSTREAM: staging: nvec: update TODO + +Module support and suspend/resume was fixed in last kernels already. + +Signed-off-by: Marc Dietrich <marvin24@gmx.de> +--- + drivers/staging/nvec/TODO | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/staging/nvec/TODO b/drivers/staging/nvec/TODO +index e5ae42a..662bdcd 100644 +--- a/drivers/staging/nvec/TODO ++++ b/drivers/staging/nvec/TODO +@@ -1,8 +1,6 @@ + ToDo list (incomplete, unordered) +- - add compile as module support + - move half of the nvec init stuff to i2c-tegra.c + - move event handling to nvec_events +- - finish suspend/resume support + - modifiy the sync_write method to return the received + message in a variable (and return the error code). + - add support for more device implementations +-- +1.8.3.1 + diff --git a/kernel.spec b/kernel.spec index 5e09d5bd..58b2dbc4 100644 --- a/kernel.spec +++ b/kernel.spec @@ -606,6 +606,14 @@ Patch15000: nowatchdog-on-virt.patch # ARMv7 Patch21020: arm-tegra-usb-no-reset-linux33.patch +#Patches from marvin24s linux-ac100-3.14 branch +# git://gitorious.org/~marvin24/ac100/marvin24s-kernel.git +Patch21201: 0001-rt2x00-move-frequent-messages-to-debug-level.patch +Patch21202: 0002-NOT_FOR_UPSTREAM-staging-nvec-move-led-init-out-of-p.patch +Patch21203: 0003-NOT_FOR_UPSTREAM-staging-nvec-add-support-for-lid-an.patch +Patch21204: 0004-NOT_FOR_UPSTREAM-staging-nvec-remove-lid-and-power-e.patch +Patch21205: 0005-NOT_FOR_UPSTREAM-staging-nvec-update-TODO.patch + #rhbz 754518 Patch21235: scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch @@ -1240,6 +1248,13 @@ ApplyPatch 0001-lib-cpumask-Make-CPUMASK_OFFSTACK-usable-without-deb.patch # ApplyPatch arm-tegra-usb-no-reset-linux33.patch +ApplyPatch 0001-rt2x00-move-frequent-messages-to-debug-level.patch +ApplyPatch 0002-NOT_FOR_UPSTREAM-staging-nvec-move-led-init-out-of-p.patch +ApplyPatch 0003-NOT_FOR_UPSTREAM-staging-nvec-add-support-for-lid-an.patch +ApplyPatch 0004-NOT_FOR_UPSTREAM-staging-nvec-remove-lid-and-power-e.patch +ApplyPatch 0005-NOT_FOR_UPSTREAM-staging-nvec-update-TODO.patch + + # # bugfixes to drivers and filesystems # |