diff options
author | Stefan Schmidt <stefan@osg.samsung.com> | 2018-01-18 16:17:18 +0100 |
---|---|---|
committer | Stefan Schmidt <stefan@osg.samsung.com> | 2018-02-15 14:47:44 +0100 |
commit | 175473ab305545456be7e32b7afcf297cc9002d6 (patch) | |
tree | b92cf392a48475dac2f247c844abd37b0fb876d6 | |
parent | c30aa45e8acebf8f65c16c527c91c0310cb7e970 (diff) | |
download | linux-mcp2210-175473ab305545456be7e32b7afcf297cc9002d6.tar.gz |
update to latest mainline kernel changes
-rw-r--r-- | drivers/spi/mcp2210-core.c | 34 | ||||
-rw-r--r-- | drivers/spi/mcp2210-spi.c | 5 | ||||
-rw-r--r-- | drivers/spi/mcp2210.h | 5 |
3 files changed, 12 insertions, 32 deletions
diff --git a/drivers/spi/mcp2210-core.c b/drivers/spi/mcp2210-core.c index efc1475a5e1bd1..a03a6141c34af6 100644 --- a/drivers/spi/mcp2210-core.c +++ b/drivers/spi/mcp2210-core.c @@ -14,7 +14,8 @@ #include <linux/usb.h>
#include "mcp2210.h"
-#include "../../hid/usbhid/usbhid.h"
+#include "../hid/usbhid/usbhid.h"
+#include <linux/module.h>
struct info_command {
int id;
@@ -65,7 +66,6 @@ void mcp2210_info_command_interrupted(void *data) { }
static void mcp2210_process_commnds(struct mcp2210_device *dev) {
- int ret = 0;
//printk("mcp2210_process_commnds\n");
// Get the next request from the current command
@@ -80,7 +80,7 @@ static void mcp2210_process_commnds(struct mcp2210_device *dev) { }
static void mcp2210_output_command(struct work_struct *work) {
- struct mcp2210_device *dev = container_of(work, struct mcp2210_device, command_work);
+ //struct mcp2210_device *dev = container_of(work, struct mcp2210_device, command_work);
}
static void mcp2210_output_command_atomic(struct mcp2210_device *dev) {
@@ -137,7 +137,7 @@ static void mcp2210_output_command_atomic(struct mcp2210_device *dev) { field->value[cnt] = dev->requeust_buffer[cnt + 1];
}
- usbhid_submit_report(dev->hid, report, USB_DIR_OUT);
+ hid_hw_request(dev->hid, report, HID_REQ_SET_REPORT);
//dev->hid->hiddev_report_event(dev->hid, report);
//dev->hid->hid_output_raw_report(dev->hid, dev->requeust_buffer, MCP2210_BUFFER_SIZE, HID_OUTPUT_REPORT);
@@ -168,7 +168,6 @@ err_free_field: kfree(field);
err_free_report:
kfree(report);
-err:
pending = dev->current_command->requests_pending;
if(pending == 0) {
if(dev->current_command->interrupted)
@@ -256,7 +255,7 @@ static int mcp2210_probe(struct hid_device *hdev, {
int ret;
struct mcp2210_device *dev;
- struct info_command *cmd_data;
+ //struct info_command *cmd_data;
dev = kzalloc(sizeof(struct mcp2210_device), GFP_KERNEL);
if (!dev)
@@ -384,24 +383,5 @@ static struct hid_driver mcp2210_driver = { .remove = mcp2210_remove
};
-static int __init mcp2210_init(void)
-{
- int ret;
- printk("mcp2210_init\n");
-
- ret = hid_register_driver(&mcp2210_driver);
- if (ret)
- printk(KERN_ERR "can't register mcp2210 driver\n");
-
- return ret;
-}
-
-static void __exit mcp2210_exit(void)
-{
- printk("mcp2210_exit\n");
- hid_unregister_driver(&mcp2210_driver);
-}
-
-module_init(mcp2210_init);
-module_exit(mcp2210_exit);
-MODULE_LICENSE("GPL");
\ No newline at end of file +module_hid_driver(mcp2210_driver);
+MODULE_LICENSE("GPL");
diff --git a/drivers/spi/mcp2210-spi.c b/drivers/spi/mcp2210-spi.c index 8a84e552ed7fbc..859b3748899941 100644 --- a/drivers/spi/mcp2210-spi.c +++ b/drivers/spi/mcp2210-spi.c @@ -167,7 +167,6 @@ static int next_mcp2210_spi_request(void *data, u8 *request) static void mcp2210_spi_response(void *data, u8 *response)
{
struct mcp2210_spi_message *mcp_msg = data;
- int x;
u8 len;
//printk("Received data\n\n");
@@ -268,7 +267,7 @@ static void mcp2210_spi_cleanup(struct spi_device *spi) static struct spi_board_info demo_spi_devices[] = {
{
- .modalias = "spidev",
+ .modalias = "mrf24j40",
.chip_select = 0,
.max_speed_hz = MCP2210_MAX_SPEED,
.bus_num = 0,
@@ -321,4 +320,4 @@ void mcp2210_spi_remove(struct mcp2210_device *dev) struct spi_master *master = ms->master;
spi_unregister_master(master);
-}
\ No newline at end of file +}
diff --git a/drivers/spi/mcp2210.h b/drivers/spi/mcp2210.h index feda958601f46e..5cf9ad27551526 100644 --- a/drivers/spi/mcp2210.h +++ b/drivers/spi/mcp2210.h @@ -63,7 +63,7 @@ int mcp2210_add_command(struct mcp2210_device *dev, void *cmd_data, static inline void print_msg(u8 *data) {
- return;
+#if 0
int x;
for(x = 0; x < 64; x++) {
printk("%02x ", data[x]);
@@ -76,6 +76,7 @@ static inline void print_msg(u8 *data) { }
printk("\n");
+#endif
}
-#endif // _MCP2210_H
\ No newline at end of file +#endif // _MCP2210_H
|