|
@@ -1,13 +1,25 @@
|
|
-// #define DEBUG
|
|
|
|
|
|
+/*
|
|
|
|
+ * NVEC: NVIDIA compliant embedded controller interface
|
|
|
|
+ *
|
|
|
|
+ * Copyright (C) 2011 The AC100 Kernel Team <ac100@lists.lauchpad.net>
|
|
|
|
+ *
|
|
|
|
+ * Authors: Pierre-Hugues Husson <phhusson@free.fr>
|
|
|
|
+ * Ilya Petrov <ilya.muromec@gmail.com>
|
|
|
|
+ * Marc Dietrich <marvin24@gmx.de>
|
|
|
|
+ *
|
|
|
|
+ * This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
+ * License. See the file "COPYING" in the main directory of this archive
|
|
|
|
+ * for more details.
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+/* #define DEBUG */
|
|
|
|
|
|
-/* ToDo list (incomplete, unorderd)
|
|
|
|
- - convert mouse, keyboard, and power to platform devices
|
|
|
|
-*/
|
|
|
|
-
|
|
|
|
-#include <asm/io.h>
|
|
|
|
#include <asm/irq.h>
|
|
#include <asm/irq.h>
|
|
|
|
+
|
|
#include <linux/completion.h>
|
|
#include <linux/completion.h>
|
|
#include <linux/interrupt.h>
|
|
#include <linux/interrupt.h>
|
|
|
|
+#include <linux/io.h>
|
|
#include <linux/irq.h>
|
|
#include <linux/irq.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/gpio.h>
|
|
#include <linux/gpio.h>
|
|
@@ -16,57 +28,60 @@
|
|
#include <linux/input.h>
|
|
#include <linux/input.h>
|
|
#include <linux/workqueue.h>
|
|
#include <linux/workqueue.h>
|
|
#include <linux/clk.h>
|
|
#include <linux/clk.h>
|
|
-#include <mach/iomap.h>
|
|
|
|
-#include <mach/clk.h>
|
|
|
|
|
|
+
|
|
#include <linux/semaphore.h>
|
|
#include <linux/semaphore.h>
|
|
#include <linux/list.h>
|
|
#include <linux/list.h>
|
|
#include <linux/notifier.h>
|
|
#include <linux/notifier.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/mfd/core.h>
|
|
#include <linux/mfd/core.h>
|
|
|
|
+
|
|
|
|
+#include <mach/iomap.h>
|
|
|
|
+#include <mach/clk.h>
|
|
|
|
+
|
|
#include "nvec.h"
|
|
#include "nvec.h"
|
|
|
|
|
|
-static unsigned char EC_DISABLE_EVENT_REPORTING[] = {'\x04','\x00','\x00'};
|
|
|
|
-static unsigned char EC_ENABLE_EVENT_REPORTING[] = {'\x04','\x00','\x01'};
|
|
|
|
-static unsigned char EC_GET_FIRMWARE_VERSION[] = {'\x07','\x15'};
|
|
|
|
|
|
+static const unsigned char EC_DISABLE_EVENT_REPORTING[3] = "\x04\x00\x00";
|
|
|
|
+static const unsigned char EC_ENABLE_EVENT_REPORTING[3] = "\x04\x00\x01";
|
|
|
|
+static const unsigned char EC_GET_FIRMWARE_VERSION[2] = "\x07\x15";
|
|
|
|
|
|
static struct nvec_chip *nvec_power_handle;
|
|
static struct nvec_chip *nvec_power_handle;
|
|
|
|
|
|
static struct mfd_cell nvec_devices[] = {
|
|
static struct mfd_cell nvec_devices[] = {
|
|
{
|
|
{
|
|
- .name = "nvec-kbd",
|
|
|
|
- .id = 1,
|
|
|
|
|
|
+ .name = "nvec-kbd",
|
|
|
|
+ .id = 1,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- .name = "nvec-mouse",
|
|
|
|
- .id = 1,
|
|
|
|
|
|
+ .name = "nvec-mouse",
|
|
|
|
+ .id = 1,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- .name = "nvec-power",
|
|
|
|
- .id = 1,
|
|
|
|
|
|
+ .name = "nvec-power",
|
|
|
|
+ .id = 1,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- .name = "nvec-power",
|
|
|
|
- .id = 2,
|
|
|
|
|
|
+ .name = "nvec-power",
|
|
|
|
+ .id = 2,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
|
|
int nvec_register_notifier(struct nvec_chip *nvec, struct notifier_block *nb,
|
|
int nvec_register_notifier(struct nvec_chip *nvec, struct notifier_block *nb,
|
|
- unsigned int events)
|
|
|
|
|
|
+ unsigned int events)
|
|
{
|
|
{
|
|
return atomic_notifier_chain_register(&nvec->notifier_list, nb);
|
|
return atomic_notifier_chain_register(&nvec->notifier_list, nb);
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(nvec_register_notifier);
|
|
EXPORT_SYMBOL_GPL(nvec_register_notifier);
|
|
|
|
|
|
-static int nvec_status_notifier(struct notifier_block *nb, unsigned long event_type,
|
|
|
|
- void *data)
|
|
|
|
|
|
+static int nvec_status_notifier(struct notifier_block *nb,
|
|
|
|
+ unsigned long event_type, void *data)
|
|
{
|
|
{
|
|
unsigned char *msg = (unsigned char *)data;
|
|
unsigned char *msg = (unsigned char *)data;
|
|
int i;
|
|
int i;
|
|
|
|
|
|
- if(event_type != NVEC_CNTL)
|
|
|
|
|
|
+ if (event_type != NVEC_CNTL)
|
|
return NOTIFY_DONE;
|
|
return NOTIFY_DONE;
|
|
|
|
|
|
- printk("unhandled msg type %ld, payload: ", event_type);
|
|
|
|
|
|
+ printk(KERN_WARNING "unhandled msg type %ld, payload: ", event_type);
|
|
for (i = 0; i < msg[1]; i++)
|
|
for (i = 0; i < msg[1]; i++)
|
|
printk("%0x ", msg[i+2]);
|
|
printk("%0x ", msg[i+2]);
|
|
printk("\n");
|
|
printk("\n");
|
|
@@ -74,7 +89,8 @@ static int nvec_status_notifier(struct notifier_block *nb, unsigned long event_t
|
|
return NOTIFY_OK;
|
|
return NOTIFY_OK;
|
|
}
|
|
}
|
|
|
|
|
|
-void nvec_write_async(struct nvec_chip *nvec, unsigned char *data, short size)
|
|
|
|
|
|
+void nvec_write_async(struct nvec_chip *nvec, const unsigned char *data,
|
|
|
|
+ short size)
|
|
{
|
|
{
|
|
struct nvec_msg *msg = kzalloc(sizeof(struct nvec_msg), GFP_NOWAIT);
|
|
struct nvec_msg *msg = kzalloc(sizeof(struct nvec_msg), GFP_NOWAIT);
|
|
|
|
|
|
@@ -95,42 +111,43 @@ static void nvec_request_master(struct work_struct *work)
|
|
{
|
|
{
|
|
struct nvec_chip *nvec = container_of(work, struct nvec_chip, tx_work);
|
|
struct nvec_chip *nvec = container_of(work, struct nvec_chip, tx_work);
|
|
|
|
|
|
- if(!list_empty(&nvec->tx_data)) {
|
|
|
|
|
|
+ if (!list_empty(&nvec->tx_data))
|
|
gpio_set_value(nvec->gpio, 0);
|
|
gpio_set_value(nvec->gpio, 0);
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static int parse_msg(struct nvec_chip *nvec, struct nvec_msg *msg)
|
|
static int parse_msg(struct nvec_chip *nvec, struct nvec_msg *msg)
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
|
|
|
|
- if((msg->data[0] & 1<<7) == 0 && msg->data[3]) {
|
|
|
|
- dev_err(nvec->dev, "ec responded %02x %02x %02x %02x\n", msg->data[0],
|
|
|
|
- msg->data[1], msg->data[2], msg->data[3]);
|
|
|
|
|
|
+ if ((msg->data[0] & 1 << 7) == 0 && msg->data[3]) {
|
|
|
|
+ dev_err(nvec->dev, "ec responded %02x %02x %02x %02x\n",
|
|
|
|
+ msg->data[0], msg->data[1], msg->data[2], msg->data[3]);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
- if ((msg->data[0] >> 7 ) == 1 && (msg->data[0] & 0x0f) == 5)
|
|
|
|
- {
|
|
|
|
|
|
+ if ((msg->data[0] >> 7) == 1 && (msg->data[0] & 0x0f) == 5) {
|
|
dev_warn(nvec->dev, "ec system event ");
|
|
dev_warn(nvec->dev, "ec system event ");
|
|
- for (i=0; i < msg->data[1]; i++)
|
|
|
|
|
|
+ for (i = 0; i < msg->data[1]; i++)
|
|
dev_warn(nvec->dev, "%02x ", msg->data[2+i]);
|
|
dev_warn(nvec->dev, "%02x ", msg->data[2+i]);
|
|
dev_warn(nvec->dev, "\n");
|
|
dev_warn(nvec->dev, "\n");
|
|
}
|
|
}
|
|
|
|
|
|
- atomic_notifier_call_chain(&nvec->notifier_list, msg->data[0] & 0x8f, msg->data);
|
|
|
|
|
|
+ atomic_notifier_call_chain(&nvec->notifier_list, msg->data[0] & 0x8f,
|
|
|
|
+ msg->data);
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static struct nvec_msg *nvec_write_sync(struct nvec_chip *nvec, unsigned char *data, short size)
|
|
|
|
|
|
+static struct nvec_msg *nvec_write_sync(struct nvec_chip *nvec,
|
|
|
|
+ const unsigned char *data, short size)
|
|
{
|
|
{
|
|
down(&nvec->sync_write_mutex);
|
|
down(&nvec->sync_write_mutex);
|
|
|
|
|
|
nvec->sync_write_pending = (data[1] << 8) + data[0];
|
|
nvec->sync_write_pending = (data[1] << 8) + data[0];
|
|
nvec_write_async(nvec, data, size);
|
|
nvec_write_async(nvec, data, size);
|
|
|
|
|
|
- dev_dbg(nvec->dev, "nvec_sync_write: 0x%04x\n", nvec->sync_write_pending);
|
|
|
|
|
|
+ dev_dbg(nvec->dev, "nvec_sync_write: 0x%04x\n",
|
|
|
|
+ nvec->sync_write_pending);
|
|
wait_for_completion(&nvec->sync_write);
|
|
wait_for_completion(&nvec->sync_write);
|
|
dev_dbg(nvec->dev, "nvec_sync_write: pong!\n");
|
|
dev_dbg(nvec->dev, "nvec_sync_write: pong!\n");
|
|
|
|
|
|
@@ -145,21 +162,21 @@ static void nvec_dispatch(struct work_struct *work)
|
|
struct nvec_chip *nvec = container_of(work, struct nvec_chip, rx_work);
|
|
struct nvec_chip *nvec = container_of(work, struct nvec_chip, rx_work);
|
|
struct nvec_msg *msg;
|
|
struct nvec_msg *msg;
|
|
|
|
|
|
- while(!list_empty(&nvec->rx_data))
|
|
|
|
- {
|
|
|
|
|
|
+ while (!list_empty(&nvec->rx_data)) {
|
|
msg = list_first_entry(&nvec->rx_data, struct nvec_msg, node);
|
|
msg = list_first_entry(&nvec->rx_data, struct nvec_msg, node);
|
|
list_del_init(&msg->node);
|
|
list_del_init(&msg->node);
|
|
|
|
|
|
- if(nvec->sync_write_pending == (msg->data[2] << 8) + msg->data[0])
|
|
|
|
- {
|
|
|
|
|
|
+ if (nvec->sync_write_pending ==
|
|
|
|
+ (msg->data[2] << 8) + msg->data[0]) {
|
|
dev_dbg(nvec->dev, "sync write completed!\n");
|
|
dev_dbg(nvec->dev, "sync write completed!\n");
|
|
nvec->sync_write_pending = 0;
|
|
nvec->sync_write_pending = 0;
|
|
nvec->last_sync_msg = msg;
|
|
nvec->last_sync_msg = msg;
|
|
complete(&nvec->sync_write);
|
|
complete(&nvec->sync_write);
|
|
} else {
|
|
} else {
|
|
parse_msg(nvec, msg);
|
|
parse_msg(nvec, msg);
|
|
- if((!msg) || (!msg->data))
|
|
|
|
- dev_warn(nvec->dev, "attempt access zero pointer\n");
|
|
|
|
|
|
+ if ((!msg) || (!msg->data))
|
|
|
|
+ dev_warn(nvec->dev,
|
|
|
|
+ "attempt access zero pointer\n");
|
|
else {
|
|
else {
|
|
kfree(msg->data);
|
|
kfree(msg->data);
|
|
kfree(msg);
|
|
kfree(msg);
|
|
@@ -179,20 +196,13 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
|
|
|
|
|
|
status = readl(base + I2C_SL_STATUS);
|
|
status = readl(base + I2C_SL_STATUS);
|
|
|
|
|
|
- if(!(status & I2C_SL_IRQ))
|
|
|
|
- {
|
|
|
|
|
|
+ if (!(status & I2C_SL_IRQ)) {
|
|
dev_warn(nvec->dev, "nvec Spurious IRQ\n");
|
|
dev_warn(nvec->dev, "nvec Spurious IRQ\n");
|
|
- //Yup, handled. ahum.
|
|
|
|
goto handled;
|
|
goto handled;
|
|
}
|
|
}
|
|
- if(status & END_TRANS && !(status & RCVD))
|
|
|
|
- {
|
|
|
|
- //Reenable IRQ only when even has been sent
|
|
|
|
- //printk("Write sequence ended !\n");
|
|
|
|
- //parse_msg(nvec);
|
|
|
|
|
|
+ if (status & END_TRANS && !(status & RCVD)) {
|
|
nvec->state = NVEC_WAIT;
|
|
nvec->state = NVEC_WAIT;
|
|
- if(nvec->rx->size > 1)
|
|
|
|
- {
|
|
|
|
|
|
+ if (nvec->rx->size > 1) {
|
|
list_add_tail(&nvec->rx->node, &nvec->rx_data);
|
|
list_add_tail(&nvec->rx->node, &nvec->rx_data);
|
|
schedule_work(&nvec->rx_work);
|
|
schedule_work(&nvec->rx_work);
|
|
} else {
|
|
} else {
|
|
@@ -200,41 +210,31 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
|
|
kfree(nvec->rx);
|
|
kfree(nvec->rx);
|
|
}
|
|
}
|
|
return IRQ_HANDLED;
|
|
return IRQ_HANDLED;
|
|
- } else if(status & RNW)
|
|
|
|
- {
|
|
|
|
- // Work around for AP20 New Slave Hw Bug. Give 1us extra.
|
|
|
|
- // nvec/smbus/nvec_i2c_transport.c in NV`s crap for reference
|
|
|
|
- if(status & RCVD)
|
|
|
|
|
|
+ } else if (status & RNW) {
|
|
|
|
+ if (status & RCVD)
|
|
udelay(3);
|
|
udelay(3);
|
|
|
|
|
|
- if(status & RCVD)
|
|
|
|
- {
|
|
|
|
|
|
+ if (status & RCVD)
|
|
nvec->state = NVEC_WRITE;
|
|
nvec->state = NVEC_WRITE;
|
|
- //Master wants something from us. New communication
|
|
|
|
-// dev_dbg(nvec->dev, "New read comm!\n");
|
|
|
|
- } else {
|
|
|
|
- //Master wants something from us from a communication we've already started
|
|
|
|
-// dev_dbg(nvec->dev, "Read comm cont !\n");
|
|
|
|
- }
|
|
|
|
- //if(msg_pos<msg_size) {
|
|
|
|
- if(list_empty(&nvec->tx_data))
|
|
|
|
- {
|
|
|
|
|
|
+
|
|
|
|
+ if (list_empty(&nvec->tx_data)) {
|
|
dev_err(nvec->dev, "nvec empty tx - sending no-op\n");
|
|
dev_err(nvec->dev, "nvec empty tx - sending no-op\n");
|
|
to_send = 0x8a;
|
|
to_send = 0x8a;
|
|
nvec_write_async(nvec, "\x07\x02", 2);
|
|
nvec_write_async(nvec, "\x07\x02", 2);
|
|
-// to_send = 0x01;
|
|
|
|
} else {
|
|
} else {
|
|
- msg = list_first_entry(&nvec->tx_data, struct nvec_msg, node);
|
|
|
|
- if(msg->pos < msg->size) {
|
|
|
|
|
|
+ msg =
|
|
|
|
+ list_first_entry(&nvec->tx_data, struct nvec_msg,
|
|
|
|
+ node);
|
|
|
|
+ if (msg->pos < msg->size) {
|
|
to_send = msg->data[msg->pos];
|
|
to_send = msg->data[msg->pos];
|
|
msg->pos++;
|
|
msg->pos++;
|
|
} else {
|
|
} else {
|
|
- dev_err(nvec->dev, "nvec crap! %d\n", msg->size);
|
|
|
|
|
|
+ dev_err(nvec->dev, "nvec crap! %d\n",
|
|
|
|
+ msg->size);
|
|
to_send = 0x01;
|
|
to_send = 0x01;
|
|
}
|
|
}
|
|
|
|
|
|
- if(msg->pos >= msg->size)
|
|
|
|
- {
|
|
|
|
|
|
+ if (msg->pos >= msg->size) {
|
|
list_del_init(&msg->node);
|
|
list_del_init(&msg->node);
|
|
kfree(msg->data);
|
|
kfree(msg->data);
|
|
kfree(msg);
|
|
kfree(msg);
|
|
@@ -251,14 +251,13 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
|
|
goto handled;
|
|
goto handled;
|
|
} else {
|
|
} else {
|
|
received = readl(base + I2C_SL_RCVD);
|
|
received = readl(base + I2C_SL_RCVD);
|
|
- //Workaround?
|
|
|
|
- if(status & RCVD) {
|
|
|
|
|
|
+
|
|
|
|
+ if (status & RCVD) {
|
|
writel(0, base + I2C_SL_RCVD);
|
|
writel(0, base + I2C_SL_RCVD);
|
|
goto handled;
|
|
goto handled;
|
|
}
|
|
}
|
|
|
|
|
|
- if (nvec->state == NVEC_WAIT)
|
|
|
|
- {
|
|
|
|
|
|
+ if (nvec->state == NVEC_WAIT) {
|
|
nvec->state = NVEC_READ;
|
|
nvec->state = NVEC_READ;
|
|
msg = kzalloc(sizeof(struct nvec_msg), GFP_NOWAIT);
|
|
msg = kzalloc(sizeof(struct nvec_msg), GFP_NOWAIT);
|
|
msg->data = kzalloc(32, GFP_NOWAIT);
|
|
msg->data = kzalloc(32, GFP_NOWAIT);
|
|
@@ -272,7 +271,8 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
|
|
msg->data[msg->pos] = received;
|
|
msg->data[msg->pos] = received;
|
|
msg->pos++;
|
|
msg->pos++;
|
|
msg->size = msg->pos;
|
|
msg->size = msg->pos;
|
|
- dev_dbg(nvec->dev, "Got %02lx from Master (pos: %d)!\n", received, msg->pos);
|
|
|
|
|
|
+ dev_dbg(nvec->dev, "Got %02lx from Master (pos: %d)!\n",
|
|
|
|
+ received, msg->pos);
|
|
}
|
|
}
|
|
handled:
|
|
handled:
|
|
return IRQ_HANDLED;
|
|
return IRQ_HANDLED;
|
|
@@ -318,7 +318,7 @@ static int __devinit tegra_nvec_probe(struct platform_device *pdev)
|
|
void __iomem *base;
|
|
void __iomem *base;
|
|
|
|
|
|
nvec = kzalloc(sizeof(struct nvec_chip), GFP_KERNEL);
|
|
nvec = kzalloc(sizeof(struct nvec_chip), GFP_KERNEL);
|
|
- if(nvec == NULL) {
|
|
|
|
|
|
+ if (nvec == NULL) {
|
|
dev_err(&pdev->dev, "failed to reserve memory\n");
|
|
dev_err(&pdev->dev, "failed to reserve memory\n");
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
}
|
|
}
|
|
@@ -367,7 +367,7 @@ static int __devinit tegra_nvec_probe(struct platform_device *pdev)
|
|
|
|
|
|
/* Set the gpio to low when we've got something to say */
|
|
/* Set the gpio to low when we've got something to say */
|
|
err = gpio_request(nvec->gpio, "nvec gpio");
|
|
err = gpio_request(nvec->gpio, "nvec gpio");
|
|
- if(err < 0)
|
|
|
|
|
|
+ if (err < 0)
|
|
dev_err(nvec->dev, "couldn't request gpio\n");
|
|
dev_err(nvec->dev, "couldn't request gpio\n");
|
|
|
|
|
|
ATOMIC_INIT_NOTIFIER_HEAD(&nvec->notifier_list);
|
|
ATOMIC_INIT_NOTIFIER_HEAD(&nvec->notifier_list);
|
|
@@ -392,7 +392,7 @@ static int __devinit tegra_nvec_probe(struct platform_device *pdev)
|
|
|
|
|
|
/* enable event reporting */
|
|
/* enable event reporting */
|
|
nvec_write_async(nvec, EC_ENABLE_EVENT_REPORTING,
|
|
nvec_write_async(nvec, EC_ENABLE_EVENT_REPORTING,
|
|
- sizeof(EC_ENABLE_EVENT_REPORTING));
|
|
|
|
|
|
+ sizeof(EC_ENABLE_EVENT_REPORTING));
|
|
|
|
|
|
nvec->nvec_status_notifier.notifier_call = nvec_status_notifier;
|
|
nvec->nvec_status_notifier.notifier_call = nvec_status_notifier;
|
|
nvec_register_notifier(nvec, &nvec->nvec_status_notifier, 0);
|
|
nvec_register_notifier(nvec, &nvec->nvec_status_notifier, 0);
|
|
@@ -402,17 +402,17 @@ static int __devinit tegra_nvec_probe(struct platform_device *pdev)
|
|
|
|
|
|
/* Get Firmware Version */
|
|
/* Get Firmware Version */
|
|
msg = nvec_write_sync(nvec, EC_GET_FIRMWARE_VERSION,
|
|
msg = nvec_write_sync(nvec, EC_GET_FIRMWARE_VERSION,
|
|
- sizeof(EC_GET_FIRMWARE_VERSION));
|
|
|
|
|
|
+ sizeof(EC_GET_FIRMWARE_VERSION));
|
|
|
|
|
|
dev_warn(nvec->dev, "ec firmware version %02x.%02x.%02x / %02x\n",
|
|
dev_warn(nvec->dev, "ec firmware version %02x.%02x.%02x / %02x\n",
|
|
- msg->data[4], msg->data[5], msg->data[6], msg->data[7]);
|
|
|
|
|
|
+ msg->data[4], msg->data[5], msg->data[6], msg->data[7]);
|
|
|
|
|
|
kfree(msg->data);
|
|
kfree(msg->data);
|
|
kfree(msg);
|
|
kfree(msg);
|
|
|
|
|
|
ret = mfd_add_devices(nvec->dev, -1, nvec_devices,
|
|
ret = mfd_add_devices(nvec->dev, -1, nvec_devices,
|
|
- ARRAY_SIZE(nvec_devices), base, 0);
|
|
|
|
- if(ret)
|
|
|
|
|
|
+ ARRAY_SIZE(nvec_devices), base, 0);
|
|
|
|
+ if (ret)
|
|
dev_err(nvec->dev, "error adding subdevices\n");
|
|
dev_err(nvec->dev, "error adding subdevices\n");
|
|
|
|
|
|
/* unmute speakers? */
|
|
/* unmute speakers? */
|
|
@@ -460,8 +460,8 @@ static int tegra_nvec_suspend(struct platform_device *pdev, pm_message_t state)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static int tegra_nvec_resume(struct platform_device *pdev) {
|
|
|
|
-
|
|
|
|
|
|
+static int tegra_nvec_resume(struct platform_device *pdev)
|
|
|
|
+{
|
|
struct nvec_chip *nvec = platform_get_drvdata(pdev);
|
|
struct nvec_chip *nvec = platform_get_drvdata(pdev);
|
|
|
|
|
|
dev_dbg(nvec->dev, "resuming\n");
|
|
dev_dbg(nvec->dev, "resuming\n");
|
|
@@ -476,13 +476,12 @@ static int tegra_nvec_resume(struct platform_device *pdev) {
|
|
#define tegra_nvec_resume NULL
|
|
#define tegra_nvec_resume NULL
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-static struct platform_driver nvec_device_driver =
|
|
|
|
-{
|
|
|
|
- .probe = tegra_nvec_probe,
|
|
|
|
- .remove = __devexit_p(tegra_nvec_remove),
|
|
|
|
|
|
+static struct platform_driver nvec_device_driver = {
|
|
|
|
+ .probe = tegra_nvec_probe,
|
|
|
|
+ .remove = __devexit_p(tegra_nvec_remove),
|
|
.suspend = tegra_nvec_suspend,
|
|
.suspend = tegra_nvec_suspend,
|
|
- .resume = tegra_nvec_resume,
|
|
|
|
- .driver = {
|
|
|
|
|
|
+ .resume = tegra_nvec_resume,
|
|
|
|
+ .driver = {
|
|
.name = "nvec",
|
|
.name = "nvec",
|
|
.owner = THIS_MODULE,
|
|
.owner = THIS_MODULE,
|
|
}
|
|
}
|
|
@@ -494,4 +493,8 @@ static int __init tegra_nvec_init(void)
|
|
}
|
|
}
|
|
|
|
|
|
module_init(tegra_nvec_init);
|
|
module_init(tegra_nvec_init);
|
|
|
|
+
|
|
MODULE_ALIAS("platform:nvec");
|
|
MODULE_ALIAS("platform:nvec");
|
|
|
|
+MODULE_DESCRIPTION("NVIDIA compliant embedded controller interface");
|
|
|
|
+MODULE_AUTHOR("Marc Dietrich <marvin24@gmx.de>");
|
|
|
|
+MODULE_LICENSE("GPL");
|