2008-03-05 07:23:45 +08:00
|
|
|
/*
|
|
|
|
* SuperH KEYSC Keypad Driver
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008 Magnus Damm
|
|
|
|
*
|
|
|
|
* Based on gpio_keys.c, Copyright 2005 Phil Blundell
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/irq.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/platform_device.h>
|
|
|
|
#include <linux/input.h>
|
2009-11-27 15:32:24 +08:00
|
|
|
#include <linux/input/sh_keysc.h>
|
2010-02-11 14:13:21 +08:00
|
|
|
#include <linux/bitmap.h>
|
2011-04-29 00:32:44 +08:00
|
|
|
#include <linux/pm_runtime.h>
|
2008-03-05 07:23:45 +08:00
|
|
|
#include <linux/io.h>
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 16:04:11 +08:00
|
|
|
#include <linux/slab.h>
|
2008-03-05 07:23:45 +08:00
|
|
|
|
|
|
|
static const struct {
|
|
|
|
unsigned char kymd, keyout, keyin;
|
|
|
|
} sh_keysc_mode[] = {
|
|
|
|
[SH_KEYSC_MODE_1] = { 0, 6, 5 },
|
|
|
|
[SH_KEYSC_MODE_2] = { 1, 5, 6 },
|
|
|
|
[SH_KEYSC_MODE_3] = { 2, 4, 7 },
|
2010-01-21 16:02:36 +08:00
|
|
|
[SH_KEYSC_MODE_4] = { 3, 6, 6 },
|
|
|
|
[SH_KEYSC_MODE_5] = { 4, 6, 7 },
|
2011-06-18 17:51:52 +08:00
|
|
|
[SH_KEYSC_MODE_6] = { 5, 8, 8 },
|
2008-03-05 07:23:45 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct sh_keysc_priv {
|
|
|
|
void __iomem *iomem_base;
|
2010-02-11 14:13:21 +08:00
|
|
|
DECLARE_BITMAP(last_keys, SH_KEYSC_MAXKEYS);
|
2008-03-05 07:23:45 +08:00
|
|
|
struct input_dev *input;
|
|
|
|
struct sh_keysc_info pdata;
|
|
|
|
};
|
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
#define KYCR1 0
|
|
|
|
#define KYCR2 1
|
|
|
|
#define KYINDR 2
|
|
|
|
#define KYOUTDR 3
|
|
|
|
|
|
|
|
#define KYCR2_IRQ_LEVEL 0x10
|
|
|
|
#define KYCR2_IRQ_DISABLED 0x00
|
|
|
|
|
|
|
|
static unsigned long sh_keysc_read(struct sh_keysc_priv *p, int reg_nr)
|
|
|
|
{
|
|
|
|
return ioread16(p->iomem_base + (reg_nr << 2));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sh_keysc_write(struct sh_keysc_priv *p, int reg_nr,
|
|
|
|
unsigned long value)
|
|
|
|
{
|
|
|
|
iowrite16(value, p->iomem_base + (reg_nr << 2));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sh_keysc_level_mode(struct sh_keysc_priv *p,
|
|
|
|
unsigned long keys_set)
|
|
|
|
{
|
|
|
|
struct sh_keysc_info *pdata = &p->pdata;
|
|
|
|
|
|
|
|
sh_keysc_write(p, KYOUTDR, 0);
|
|
|
|
sh_keysc_write(p, KYCR2, KYCR2_IRQ_LEVEL | (keys_set << 8));
|
|
|
|
|
|
|
|
if (pdata->kycr2_delay)
|
|
|
|
udelay(pdata->kycr2_delay);
|
|
|
|
}
|
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
static void sh_keysc_map_dbg(struct device *dev, unsigned long *map,
|
|
|
|
const char *str)
|
|
|
|
{
|
|
|
|
int k;
|
|
|
|
|
|
|
|
for (k = 0; k < BITS_TO_LONGS(SH_KEYSC_MAXKEYS); k++)
|
|
|
|
dev_dbg(dev, "%s[%d] 0x%lx\n", str, k, map[k]);
|
|
|
|
}
|
|
|
|
|
2008-03-05 07:23:45 +08:00
|
|
|
static irqreturn_t sh_keysc_isr(int irq, void *dev_id)
|
|
|
|
{
|
|
|
|
struct platform_device *pdev = dev_id;
|
|
|
|
struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
|
|
|
|
struct sh_keysc_info *pdata = &priv->pdata;
|
2010-02-11 14:13:21 +08:00
|
|
|
int keyout_nr = sh_keysc_mode[pdata->mode].keyout;
|
|
|
|
int keyin_nr = sh_keysc_mode[pdata->mode].keyin;
|
|
|
|
DECLARE_BITMAP(keys, SH_KEYSC_MAXKEYS);
|
|
|
|
DECLARE_BITMAP(keys0, SH_KEYSC_MAXKEYS);
|
|
|
|
DECLARE_BITMAP(keys1, SH_KEYSC_MAXKEYS);
|
2008-03-05 07:23:45 +08:00
|
|
|
unsigned char keyin_set, tmp;
|
2010-02-11 14:13:21 +08:00
|
|
|
int i, k, n;
|
2008-03-05 07:23:45 +08:00
|
|
|
|
|
|
|
dev_dbg(&pdev->dev, "isr!\n");
|
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
bitmap_fill(keys1, SH_KEYSC_MAXKEYS);
|
|
|
|
bitmap_zero(keys0, SH_KEYSC_MAXKEYS);
|
2008-03-05 07:23:45 +08:00
|
|
|
|
|
|
|
do {
|
2010-02-11 14:13:21 +08:00
|
|
|
bitmap_zero(keys, SH_KEYSC_MAXKEYS);
|
2008-03-05 07:23:45 +08:00
|
|
|
keyin_set = 0;
|
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
sh_keysc_write(priv, KYCR2, KYCR2_IRQ_DISABLED);
|
2008-03-05 07:23:45 +08:00
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
for (i = 0; i < keyout_nr; i++) {
|
|
|
|
n = keyin_nr * i;
|
|
|
|
|
|
|
|
/* drive one KEYOUT pin low, read KEYIN pins */
|
2010-02-11 15:03:22 +08:00
|
|
|
sh_keysc_write(priv, KYOUTDR, 0xffff ^ (3 << (i * 2)));
|
2008-03-05 07:23:45 +08:00
|
|
|
udelay(pdata->delay);
|
2010-02-11 14:13:21 +08:00
|
|
|
tmp = sh_keysc_read(priv, KYINDR);
|
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
/* set bit if key press has been detected */
|
|
|
|
for (k = 0; k < keyin_nr; k++) {
|
|
|
|
if (tmp & (1 << k))
|
|
|
|
__set_bit(n + k, keys);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* keep track of which KEYIN bits that have been set */
|
|
|
|
keyin_set |= tmp ^ ((1 << keyin_nr) - 1);
|
2008-03-05 07:23:45 +08:00
|
|
|
}
|
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
sh_keysc_level_mode(priv, keyin_set);
|
2009-09-15 08:21:34 +08:00
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
bitmap_complement(keys, keys, SH_KEYSC_MAXKEYS);
|
|
|
|
bitmap_and(keys1, keys1, keys, SH_KEYSC_MAXKEYS);
|
|
|
|
bitmap_or(keys0, keys0, keys, SH_KEYSC_MAXKEYS);
|
2008-03-05 07:23:45 +08:00
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
sh_keysc_map_dbg(&pdev->dev, keys, "keys");
|
2008-03-05 07:23:45 +08:00
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
} while (sh_keysc_read(priv, KYCR2) & 0x01);
|
2008-03-05 07:23:45 +08:00
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
sh_keysc_map_dbg(&pdev->dev, priv->last_keys, "last_keys");
|
|
|
|
sh_keysc_map_dbg(&pdev->dev, keys0, "keys0");
|
|
|
|
sh_keysc_map_dbg(&pdev->dev, keys1, "keys1");
|
2008-03-05 07:23:45 +08:00
|
|
|
|
|
|
|
for (i = 0; i < SH_KEYSC_MAXKEYS; i++) {
|
|
|
|
k = pdata->keycodes[i];
|
|
|
|
if (!k)
|
|
|
|
continue;
|
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
if (test_bit(i, keys0) == test_bit(i, priv->last_keys))
|
2008-03-05 07:23:45 +08:00
|
|
|
continue;
|
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
if (test_bit(i, keys1) || test_bit(i, keys0)) {
|
2008-03-05 07:23:45 +08:00
|
|
|
input_event(priv->input, EV_KEY, k, 1);
|
2010-02-11 14:13:21 +08:00
|
|
|
__set_bit(i, priv->last_keys);
|
2008-03-05 07:23:45 +08:00
|
|
|
}
|
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
if (!test_bit(i, keys1)) {
|
2008-03-05 07:23:45 +08:00
|
|
|
input_event(priv->input, EV_KEY, k, 0);
|
2010-02-11 14:13:21 +08:00
|
|
|
__clear_bit(i, priv->last_keys);
|
2008-03-05 07:23:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
input_sync(priv->input);
|
|
|
|
|
|
|
|
return IRQ_HANDLED;
|
|
|
|
}
|
|
|
|
|
2012-11-24 13:38:25 +08:00
|
|
|
static int sh_keysc_probe(struct platform_device *pdev)
|
2008-03-05 07:23:45 +08:00
|
|
|
{
|
|
|
|
struct sh_keysc_priv *priv;
|
|
|
|
struct sh_keysc_info *pdata;
|
|
|
|
struct resource *res;
|
|
|
|
struct input_dev *input;
|
2009-07-21 16:12:12 +08:00
|
|
|
int i;
|
2008-03-05 07:23:45 +08:00
|
|
|
int irq, error;
|
|
|
|
|
|
|
|
if (!pdev->dev.platform_data) {
|
|
|
|
dev_err(&pdev->dev, "no platform data defined\n");
|
|
|
|
error = -EINVAL;
|
|
|
|
goto err0;
|
|
|
|
}
|
|
|
|
|
|
|
|
error = -ENXIO;
|
|
|
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
|
|
if (res == NULL) {
|
|
|
|
dev_err(&pdev->dev, "failed to get I/O memory\n");
|
|
|
|
goto err0;
|
|
|
|
}
|
|
|
|
|
|
|
|
irq = platform_get_irq(pdev, 0);
|
|
|
|
if (irq < 0) {
|
|
|
|
dev_err(&pdev->dev, "failed to get irq\n");
|
|
|
|
goto err0;
|
|
|
|
}
|
|
|
|
|
|
|
|
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
|
|
|
if (priv == NULL) {
|
|
|
|
dev_err(&pdev->dev, "failed to allocate driver data\n");
|
|
|
|
error = -ENOMEM;
|
|
|
|
goto err0;
|
|
|
|
}
|
|
|
|
|
|
|
|
platform_set_drvdata(pdev, priv);
|
|
|
|
memcpy(&priv->pdata, pdev->dev.platform_data, sizeof(priv->pdata));
|
|
|
|
pdata = &priv->pdata;
|
|
|
|
|
2010-01-21 16:02:36 +08:00
|
|
|
priv->iomem_base = ioremap_nocache(res->start, resource_size(res));
|
2008-03-05 07:23:45 +08:00
|
|
|
if (priv->iomem_base == NULL) {
|
|
|
|
dev_err(&pdev->dev, "failed to remap I/O memory\n");
|
|
|
|
error = -ENXIO;
|
2008-07-19 06:46:53 +08:00
|
|
|
goto err1;
|
2008-03-05 07:23:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
priv->input = input_allocate_device();
|
|
|
|
if (!priv->input) {
|
|
|
|
dev_err(&pdev->dev, "failed to allocate input device\n");
|
|
|
|
error = -ENOMEM;
|
2011-04-29 00:32:44 +08:00
|
|
|
goto err2;
|
2008-03-05 07:23:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
input = priv->input;
|
|
|
|
input->evbit[0] = BIT_MASK(EV_KEY);
|
|
|
|
|
|
|
|
input->name = pdev->name;
|
|
|
|
input->phys = "sh-keysc-keys/input0";
|
|
|
|
input->dev.parent = &pdev->dev;
|
|
|
|
|
|
|
|
input->id.bustype = BUS_HOST;
|
|
|
|
input->id.vendor = 0x0001;
|
|
|
|
input->id.product = 0x0001;
|
|
|
|
input->id.version = 0x0100;
|
|
|
|
|
2009-07-21 16:12:12 +08:00
|
|
|
input->keycode = pdata->keycodes;
|
|
|
|
input->keycodesize = sizeof(pdata->keycodes[0]);
|
|
|
|
input->keycodemax = ARRAY_SIZE(pdata->keycodes);
|
|
|
|
|
2011-04-29 00:34:32 +08:00
|
|
|
error = request_threaded_irq(irq, NULL, sh_keysc_isr, IRQF_ONESHOT,
|
|
|
|
dev_name(&pdev->dev), pdev);
|
2008-03-05 07:23:45 +08:00
|
|
|
if (error) {
|
|
|
|
dev_err(&pdev->dev, "failed to request IRQ\n");
|
2011-04-29 00:32:44 +08:00
|
|
|
goto err3;
|
2008-03-05 07:23:45 +08:00
|
|
|
}
|
|
|
|
|
2009-07-21 16:12:12 +08:00
|
|
|
for (i = 0; i < SH_KEYSC_MAXKEYS; i++)
|
|
|
|
__set_bit(pdata->keycodes[i], input->keybit);
|
|
|
|
__clear_bit(KEY_RESERVED, input->keybit);
|
2008-03-05 07:23:45 +08:00
|
|
|
|
|
|
|
error = input_register_device(input);
|
|
|
|
if (error) {
|
|
|
|
dev_err(&pdev->dev, "failed to register input device\n");
|
2011-04-29 00:32:44 +08:00
|
|
|
goto err4;
|
2008-03-05 07:23:45 +08:00
|
|
|
}
|
|
|
|
|
2011-04-29 00:32:44 +08:00
|
|
|
pm_runtime_enable(&pdev->dev);
|
|
|
|
pm_runtime_get_sync(&pdev->dev);
|
2008-10-31 19:21:23 +08:00
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
sh_keysc_write(priv, KYCR1, (sh_keysc_mode[pdata->mode].kymd << 8) |
|
|
|
|
pdata->scan_timing);
|
|
|
|
sh_keysc_level_mode(priv, 0);
|
2009-03-10 14:24:21 +08:00
|
|
|
|
|
|
|
device_init_wakeup(&pdev->dev, 1);
|
2009-07-21 16:12:12 +08:00
|
|
|
|
2008-03-05 07:23:45 +08:00
|
|
|
return 0;
|
2009-07-21 16:12:12 +08:00
|
|
|
|
2008-10-31 19:21:23 +08:00
|
|
|
err4:
|
2011-04-29 00:32:44 +08:00
|
|
|
free_irq(irq, pdev);
|
2008-10-31 19:21:23 +08:00
|
|
|
err3:
|
2011-04-29 00:32:44 +08:00
|
|
|
input_free_device(input);
|
2008-03-05 07:23:45 +08:00
|
|
|
err2:
|
2008-07-19 06:46:53 +08:00
|
|
|
iounmap(priv->iomem_base);
|
2008-03-05 07:23:45 +08:00
|
|
|
err1:
|
|
|
|
kfree(priv);
|
|
|
|
err0:
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
2012-11-24 13:50:47 +08:00
|
|
|
static int sh_keysc_remove(struct platform_device *pdev)
|
2008-03-05 07:23:45 +08:00
|
|
|
{
|
|
|
|
struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
|
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
sh_keysc_write(priv, KYCR2, KYCR2_IRQ_DISABLED);
|
2008-03-05 07:23:45 +08:00
|
|
|
|
|
|
|
input_unregister_device(priv->input);
|
|
|
|
free_irq(platform_get_irq(pdev, 0), pdev);
|
|
|
|
iounmap(priv->iomem_base);
|
|
|
|
|
2011-04-29 00:32:44 +08:00
|
|
|
pm_runtime_put_sync(&pdev->dev);
|
|
|
|
pm_runtime_disable(&pdev->dev);
|
2008-10-31 19:21:23 +08:00
|
|
|
|
2008-03-05 07:23:45 +08:00
|
|
|
kfree(priv);
|
2009-07-21 16:12:12 +08:00
|
|
|
|
2008-03-05 07:23:45 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-07-04 21:34:48 +08:00
|
|
|
#ifdef CONFIG_PM_SLEEP
|
2009-03-10 14:24:21 +08:00
|
|
|
static int sh_keysc_suspend(struct device *dev)
|
|
|
|
{
|
2009-03-11 16:04:23 +08:00
|
|
|
struct platform_device *pdev = to_platform_device(dev);
|
|
|
|
struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
|
2009-04-01 22:39:20 +08:00
|
|
|
int irq = platform_get_irq(pdev, 0);
|
2009-03-10 14:24:21 +08:00
|
|
|
unsigned short value;
|
|
|
|
|
2010-02-11 14:13:21 +08:00
|
|
|
value = sh_keysc_read(priv, KYCR1);
|
2008-03-05 07:23:45 +08:00
|
|
|
|
2009-04-01 22:39:20 +08:00
|
|
|
if (device_may_wakeup(dev)) {
|
2011-04-29 00:32:44 +08:00
|
|
|
sh_keysc_write(priv, KYCR1, value | 0x80);
|
2009-04-01 22:39:20 +08:00
|
|
|
enable_irq_wake(irq);
|
2009-07-21 16:12:12 +08:00
|
|
|
} else {
|
2011-04-29 00:32:44 +08:00
|
|
|
sh_keysc_write(priv, KYCR1, value & ~0x80);
|
|
|
|
pm_runtime_put_sync(dev);
|
2009-07-21 16:12:12 +08:00
|
|
|
}
|
2009-03-10 14:24:21 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-04-01 22:39:20 +08:00
|
|
|
static int sh_keysc_resume(struct device *dev)
|
|
|
|
{
|
|
|
|
struct platform_device *pdev = to_platform_device(dev);
|
|
|
|
int irq = platform_get_irq(pdev, 0);
|
|
|
|
|
|
|
|
if (device_may_wakeup(dev))
|
|
|
|
disable_irq_wake(irq);
|
2011-04-29 00:32:44 +08:00
|
|
|
else
|
|
|
|
pm_runtime_get_sync(dev);
|
2009-04-01 22:39:20 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2011-05-05 11:54:27 +08:00
|
|
|
#endif
|
2009-04-01 22:39:20 +08:00
|
|
|
|
2011-05-05 11:54:27 +08:00
|
|
|
static SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops,
|
|
|
|
sh_keysc_suspend, sh_keysc_resume);
|
2008-03-05 07:23:45 +08:00
|
|
|
|
2011-05-03 14:09:19 +08:00
|
|
|
static struct platform_driver sh_keysc_device_driver = {
|
2008-03-05 07:23:45 +08:00
|
|
|
.probe = sh_keysc_probe,
|
2012-11-24 13:27:39 +08:00
|
|
|
.remove = sh_keysc_remove,
|
2008-03-05 07:23:45 +08:00
|
|
|
.driver = {
|
|
|
|
.name = "sh_keysc",
|
2009-03-10 14:24:21 +08:00
|
|
|
.pm = &sh_keysc_dev_pm_ops,
|
2008-03-05 07:23:45 +08:00
|
|
|
}
|
|
|
|
};
|
2011-11-30 03:08:39 +08:00
|
|
|
module_platform_driver(sh_keysc_device_driver);
|
2008-03-05 07:23:45 +08:00
|
|
|
|
|
|
|
MODULE_AUTHOR("Magnus Damm");
|
|
|
|
MODULE_DESCRIPTION("SuperH KEYSC Keypad Driver");
|
|
|
|
MODULE_LICENSE("GPL");
|