Linux Audio

Check our new training course

Loading...
v6.2
  1// SPDX-License-Identifier: GPL-2.0-only
  2/*
  3 * SuperH KEYSC Keypad Driver
  4 *
  5 * Copyright (C) 2008 Magnus Damm
  6 *
  7 * Based on gpio_keys.c, Copyright 2005 Phil Blundell
 
 
 
 
  8 */
  9
 10#include <linux/kernel.h>
 11#include <linux/module.h>
 
 12#include <linux/interrupt.h>
 13#include <linux/irq.h>
 14#include <linux/delay.h>
 15#include <linux/platform_device.h>
 16#include <linux/input.h>
 17#include <linux/input/sh_keysc.h>
 18#include <linux/bitmap.h>
 19#include <linux/pm_runtime.h>
 20#include <linux/io.h>
 21#include <linux/slab.h>
 22
 23static const struct {
 24	unsigned char kymd, keyout, keyin;
 25} sh_keysc_mode[] = {
 26	[SH_KEYSC_MODE_1] = { 0, 6, 5 },
 27	[SH_KEYSC_MODE_2] = { 1, 5, 6 },
 28	[SH_KEYSC_MODE_3] = { 2, 4, 7 },
 29	[SH_KEYSC_MODE_4] = { 3, 6, 6 },
 30	[SH_KEYSC_MODE_5] = { 4, 6, 7 },
 31	[SH_KEYSC_MODE_6] = { 5, 8, 8 },
 32};
 33
 34struct sh_keysc_priv {
 35	void __iomem *iomem_base;
 36	DECLARE_BITMAP(last_keys, SH_KEYSC_MAXKEYS);
 37	struct input_dev *input;
 38	struct sh_keysc_info pdata;
 39};
 40
 41#define KYCR1 0
 42#define KYCR2 1
 43#define KYINDR 2
 44#define KYOUTDR 3
 45
 46#define KYCR2_IRQ_LEVEL    0x10
 47#define KYCR2_IRQ_DISABLED 0x00
 48
 49static unsigned long sh_keysc_read(struct sh_keysc_priv *p, int reg_nr)
 50{
 51	return ioread16(p->iomem_base + (reg_nr << 2));
 52}
 53
 54static void sh_keysc_write(struct sh_keysc_priv *p, int reg_nr,
 55			   unsigned long value)
 56{
 57	iowrite16(value, p->iomem_base + (reg_nr << 2));
 58}
 59
 60static void sh_keysc_level_mode(struct sh_keysc_priv *p,
 61				unsigned long keys_set)
 62{
 63	struct sh_keysc_info *pdata = &p->pdata;
 64
 65	sh_keysc_write(p, KYOUTDR, 0);
 66	sh_keysc_write(p, KYCR2, KYCR2_IRQ_LEVEL | (keys_set << 8));
 67
 68	if (pdata->kycr2_delay)
 69		udelay(pdata->kycr2_delay);
 70}
 71
 72static void sh_keysc_map_dbg(struct device *dev, unsigned long *map,
 73			     const char *str)
 74{
 75	int k;
 76
 77	for (k = 0; k < BITS_TO_LONGS(SH_KEYSC_MAXKEYS); k++)
 78		dev_dbg(dev, "%s[%d] 0x%lx\n", str, k, map[k]);
 79}
 80
 81static irqreturn_t sh_keysc_isr(int irq, void *dev_id)
 82{
 83	struct platform_device *pdev = dev_id;
 84	struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
 85	struct sh_keysc_info *pdata = &priv->pdata;
 86	int keyout_nr = sh_keysc_mode[pdata->mode].keyout;
 87	int keyin_nr = sh_keysc_mode[pdata->mode].keyin;
 88	DECLARE_BITMAP(keys, SH_KEYSC_MAXKEYS);
 89	DECLARE_BITMAP(keys0, SH_KEYSC_MAXKEYS);
 90	DECLARE_BITMAP(keys1, SH_KEYSC_MAXKEYS);
 91	unsigned char keyin_set, tmp;
 92	int i, k, n;
 93
 94	dev_dbg(&pdev->dev, "isr!\n");
 95
 96	bitmap_fill(keys1, SH_KEYSC_MAXKEYS);
 97	bitmap_zero(keys0, SH_KEYSC_MAXKEYS);
 98
 99	do {
100		bitmap_zero(keys, SH_KEYSC_MAXKEYS);
101		keyin_set = 0;
102
103		sh_keysc_write(priv, KYCR2, KYCR2_IRQ_DISABLED);
104
105		for (i = 0; i < keyout_nr; i++) {
106			n = keyin_nr * i;
107
108			/* drive one KEYOUT pin low, read KEYIN pins */
109			sh_keysc_write(priv, KYOUTDR, 0xffff ^ (3 << (i * 2)));
110			udelay(pdata->delay);
111			tmp = sh_keysc_read(priv, KYINDR);
112
113			/* set bit if key press has been detected */
114			for (k = 0; k < keyin_nr; k++) {
115				if (tmp & (1 << k))
116					__set_bit(n + k, keys);
117			}
118
119			/* keep track of which KEYIN bits that have been set */
120			keyin_set |= tmp ^ ((1 << keyin_nr) - 1);
121		}
122
123		sh_keysc_level_mode(priv, keyin_set);
124
125		bitmap_complement(keys, keys, SH_KEYSC_MAXKEYS);
126		bitmap_and(keys1, keys1, keys, SH_KEYSC_MAXKEYS);
127		bitmap_or(keys0, keys0, keys, SH_KEYSC_MAXKEYS);
128
129		sh_keysc_map_dbg(&pdev->dev, keys, "keys");
130
131	} while (sh_keysc_read(priv, KYCR2) & 0x01);
132
133	sh_keysc_map_dbg(&pdev->dev, priv->last_keys, "last_keys");
134	sh_keysc_map_dbg(&pdev->dev, keys0, "keys0");
135	sh_keysc_map_dbg(&pdev->dev, keys1, "keys1");
136
137	for (i = 0; i < SH_KEYSC_MAXKEYS; i++) {
138		k = pdata->keycodes[i];
139		if (!k)
140			continue;
141
142		if (test_bit(i, keys0) == test_bit(i, priv->last_keys))
143			continue;
144
145		if (test_bit(i, keys1) || test_bit(i, keys0)) {
146			input_event(priv->input, EV_KEY, k, 1);
147			__set_bit(i, priv->last_keys);
148		}
149
150		if (!test_bit(i, keys1)) {
151			input_event(priv->input, EV_KEY, k, 0);
152			__clear_bit(i, priv->last_keys);
153		}
154
155	}
156	input_sync(priv->input);
157
158	return IRQ_HANDLED;
159}
160
161static int sh_keysc_probe(struct platform_device *pdev)
162{
163	struct sh_keysc_priv *priv;
164	struct sh_keysc_info *pdata;
165	struct resource *res;
166	struct input_dev *input;
167	int i;
168	int irq, error;
169
170	if (!dev_get_platdata(&pdev->dev)) {
171		dev_err(&pdev->dev, "no platform data defined\n");
172		error = -EINVAL;
173		goto err0;
174	}
175
176	error = -ENXIO;
177	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
178	if (res == NULL) {
179		dev_err(&pdev->dev, "failed to get I/O memory\n");
180		goto err0;
181	}
182
183	irq = platform_get_irq(pdev, 0);
184	if (irq < 0)
 
185		goto err0;
 
186
187	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
188	if (priv == NULL) {
189		dev_err(&pdev->dev, "failed to allocate driver data\n");
190		error = -ENOMEM;
191		goto err0;
192	}
193
194	platform_set_drvdata(pdev, priv);
195	memcpy(&priv->pdata, dev_get_platdata(&pdev->dev), sizeof(priv->pdata));
196	pdata = &priv->pdata;
197
198	priv->iomem_base = ioremap(res->start, resource_size(res));
199	if (priv->iomem_base == NULL) {
200		dev_err(&pdev->dev, "failed to remap I/O memory\n");
201		error = -ENXIO;
202		goto err1;
203	}
204
205	priv->input = input_allocate_device();
206	if (!priv->input) {
207		dev_err(&pdev->dev, "failed to allocate input device\n");
208		error = -ENOMEM;
209		goto err2;
210	}
211
212	input = priv->input;
213	input->evbit[0] = BIT_MASK(EV_KEY);
214
215	input->name = pdev->name;
216	input->phys = "sh-keysc-keys/input0";
217	input->dev.parent = &pdev->dev;
218
219	input->id.bustype = BUS_HOST;
220	input->id.vendor = 0x0001;
221	input->id.product = 0x0001;
222	input->id.version = 0x0100;
223
224	input->keycode = pdata->keycodes;
225	input->keycodesize = sizeof(pdata->keycodes[0]);
226	input->keycodemax = ARRAY_SIZE(pdata->keycodes);
227
228	error = request_threaded_irq(irq, NULL, sh_keysc_isr, IRQF_ONESHOT,
229				     dev_name(&pdev->dev), pdev);
230	if (error) {
231		dev_err(&pdev->dev, "failed to request IRQ\n");
232		goto err3;
233	}
234
235	for (i = 0; i < SH_KEYSC_MAXKEYS; i++)
236		__set_bit(pdata->keycodes[i], input->keybit);
237	__clear_bit(KEY_RESERVED, input->keybit);
238
239	error = input_register_device(input);
240	if (error) {
241		dev_err(&pdev->dev, "failed to register input device\n");
242		goto err4;
243	}
244
245	pm_runtime_enable(&pdev->dev);
246	pm_runtime_get_sync(&pdev->dev);
247
248	sh_keysc_write(priv, KYCR1, (sh_keysc_mode[pdata->mode].kymd << 8) |
249		       pdata->scan_timing);
250	sh_keysc_level_mode(priv, 0);
251
252	device_init_wakeup(&pdev->dev, 1);
253
254	return 0;
255
256 err4:
257	free_irq(irq, pdev);
258 err3:
259	input_free_device(input);
260 err2:
261	iounmap(priv->iomem_base);
262 err1:
 
263	kfree(priv);
264 err0:
265	return error;
266}
267
268static int sh_keysc_remove(struct platform_device *pdev)
269{
270	struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
271
272	sh_keysc_write(priv, KYCR2, KYCR2_IRQ_DISABLED);
273
274	input_unregister_device(priv->input);
275	free_irq(platform_get_irq(pdev, 0), pdev);
276	iounmap(priv->iomem_base);
277
278	pm_runtime_put_sync(&pdev->dev);
279	pm_runtime_disable(&pdev->dev);
280
 
281	kfree(priv);
282
283	return 0;
284}
285
 
286static int sh_keysc_suspend(struct device *dev)
287{
288	struct platform_device *pdev = to_platform_device(dev);
289	struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
290	int irq = platform_get_irq(pdev, 0);
291	unsigned short value;
292
293	value = sh_keysc_read(priv, KYCR1);
294
295	if (device_may_wakeup(dev)) {
296		sh_keysc_write(priv, KYCR1, value | 0x80);
297		enable_irq_wake(irq);
298	} else {
299		sh_keysc_write(priv, KYCR1, value & ~0x80);
300		pm_runtime_put_sync(dev);
301	}
302
303	return 0;
304}
305
306static int sh_keysc_resume(struct device *dev)
307{
308	struct platform_device *pdev = to_platform_device(dev);
309	int irq = platform_get_irq(pdev, 0);
310
311	if (device_may_wakeup(dev))
312		disable_irq_wake(irq);
313	else
314		pm_runtime_get_sync(dev);
315
316	return 0;
317}
 
318
319static DEFINE_SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops,
320				sh_keysc_suspend, sh_keysc_resume);
321
322static struct platform_driver sh_keysc_device_driver = {
323	.probe		= sh_keysc_probe,
324	.remove		= sh_keysc_remove,
325	.driver		= {
326		.name	= "sh_keysc",
327		.pm	= pm_sleep_ptr(&sh_keysc_dev_pm_ops),
328	}
329};
330module_platform_driver(sh_keysc_device_driver);
 
 
 
 
 
 
 
 
 
 
 
 
331
332MODULE_AUTHOR("Magnus Damm");
333MODULE_DESCRIPTION("SuperH KEYSC Keypad Driver");
334MODULE_LICENSE("GPL");
v3.1
 
  1/*
  2 * SuperH KEYSC Keypad Driver
  3 *
  4 * Copyright (C) 2008 Magnus Damm
  5 *
  6 * Based on gpio_keys.c, Copyright 2005 Phil Blundell
  7 *
  8 * This program is free software; you can redistribute it and/or modify
  9 * it under the terms of the GNU General Public License version 2 as
 10 * published by the Free Software Foundation.
 11 */
 12
 13#include <linux/kernel.h>
 14#include <linux/module.h>
 15#include <linux/init.h>
 16#include <linux/interrupt.h>
 17#include <linux/irq.h>
 18#include <linux/delay.h>
 19#include <linux/platform_device.h>
 20#include <linux/input.h>
 21#include <linux/input/sh_keysc.h>
 22#include <linux/bitmap.h>
 23#include <linux/pm_runtime.h>
 24#include <linux/io.h>
 25#include <linux/slab.h>
 26
 27static const struct {
 28	unsigned char kymd, keyout, keyin;
 29} sh_keysc_mode[] = {
 30	[SH_KEYSC_MODE_1] = { 0, 6, 5 },
 31	[SH_KEYSC_MODE_2] = { 1, 5, 6 },
 32	[SH_KEYSC_MODE_3] = { 2, 4, 7 },
 33	[SH_KEYSC_MODE_4] = { 3, 6, 6 },
 34	[SH_KEYSC_MODE_5] = { 4, 6, 7 },
 35	[SH_KEYSC_MODE_6] = { 5, 8, 8 },
 36};
 37
 38struct sh_keysc_priv {
 39	void __iomem *iomem_base;
 40	DECLARE_BITMAP(last_keys, SH_KEYSC_MAXKEYS);
 41	struct input_dev *input;
 42	struct sh_keysc_info pdata;
 43};
 44
 45#define KYCR1 0
 46#define KYCR2 1
 47#define KYINDR 2
 48#define KYOUTDR 3
 49
 50#define KYCR2_IRQ_LEVEL    0x10
 51#define KYCR2_IRQ_DISABLED 0x00
 52
 53static unsigned long sh_keysc_read(struct sh_keysc_priv *p, int reg_nr)
 54{
 55	return ioread16(p->iomem_base + (reg_nr << 2));
 56}
 57
 58static void sh_keysc_write(struct sh_keysc_priv *p, int reg_nr,
 59			   unsigned long value)
 60{
 61	iowrite16(value, p->iomem_base + (reg_nr << 2));
 62}
 63
 64static void sh_keysc_level_mode(struct sh_keysc_priv *p,
 65				unsigned long keys_set)
 66{
 67	struct sh_keysc_info *pdata = &p->pdata;
 68
 69	sh_keysc_write(p, KYOUTDR, 0);
 70	sh_keysc_write(p, KYCR2, KYCR2_IRQ_LEVEL | (keys_set << 8));
 71
 72	if (pdata->kycr2_delay)
 73		udelay(pdata->kycr2_delay);
 74}
 75
 76static void sh_keysc_map_dbg(struct device *dev, unsigned long *map,
 77			     const char *str)
 78{
 79	int k;
 80
 81	for (k = 0; k < BITS_TO_LONGS(SH_KEYSC_MAXKEYS); k++)
 82		dev_dbg(dev, "%s[%d] 0x%lx\n", str, k, map[k]);
 83}
 84
 85static irqreturn_t sh_keysc_isr(int irq, void *dev_id)
 86{
 87	struct platform_device *pdev = dev_id;
 88	struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
 89	struct sh_keysc_info *pdata = &priv->pdata;
 90	int keyout_nr = sh_keysc_mode[pdata->mode].keyout;
 91	int keyin_nr = sh_keysc_mode[pdata->mode].keyin;
 92	DECLARE_BITMAP(keys, SH_KEYSC_MAXKEYS);
 93	DECLARE_BITMAP(keys0, SH_KEYSC_MAXKEYS);
 94	DECLARE_BITMAP(keys1, SH_KEYSC_MAXKEYS);
 95	unsigned char keyin_set, tmp;
 96	int i, k, n;
 97
 98	dev_dbg(&pdev->dev, "isr!\n");
 99
100	bitmap_fill(keys1, SH_KEYSC_MAXKEYS);
101	bitmap_zero(keys0, SH_KEYSC_MAXKEYS);
102
103	do {
104		bitmap_zero(keys, SH_KEYSC_MAXKEYS);
105		keyin_set = 0;
106
107		sh_keysc_write(priv, KYCR2, KYCR2_IRQ_DISABLED);
108
109		for (i = 0; i < keyout_nr; i++) {
110			n = keyin_nr * i;
111
112			/* drive one KEYOUT pin low, read KEYIN pins */
113			sh_keysc_write(priv, KYOUTDR, 0xffff ^ (3 << (i * 2)));
114			udelay(pdata->delay);
115			tmp = sh_keysc_read(priv, KYINDR);
116
117			/* set bit if key press has been detected */
118			for (k = 0; k < keyin_nr; k++) {
119				if (tmp & (1 << k))
120					__set_bit(n + k, keys);
121			}
122
123			/* keep track of which KEYIN bits that have been set */
124			keyin_set |= tmp ^ ((1 << keyin_nr) - 1);
125		}
126
127		sh_keysc_level_mode(priv, keyin_set);
128
129		bitmap_complement(keys, keys, SH_KEYSC_MAXKEYS);
130		bitmap_and(keys1, keys1, keys, SH_KEYSC_MAXKEYS);
131		bitmap_or(keys0, keys0, keys, SH_KEYSC_MAXKEYS);
132
133		sh_keysc_map_dbg(&pdev->dev, keys, "keys");
134
135	} while (sh_keysc_read(priv, KYCR2) & 0x01);
136
137	sh_keysc_map_dbg(&pdev->dev, priv->last_keys, "last_keys");
138	sh_keysc_map_dbg(&pdev->dev, keys0, "keys0");
139	sh_keysc_map_dbg(&pdev->dev, keys1, "keys1");
140
141	for (i = 0; i < SH_KEYSC_MAXKEYS; i++) {
142		k = pdata->keycodes[i];
143		if (!k)
144			continue;
145
146		if (test_bit(i, keys0) == test_bit(i, priv->last_keys))
147			continue;
148
149		if (test_bit(i, keys1) || test_bit(i, keys0)) {
150			input_event(priv->input, EV_KEY, k, 1);
151			__set_bit(i, priv->last_keys);
152		}
153
154		if (!test_bit(i, keys1)) {
155			input_event(priv->input, EV_KEY, k, 0);
156			__clear_bit(i, priv->last_keys);
157		}
158
159	}
160	input_sync(priv->input);
161
162	return IRQ_HANDLED;
163}
164
165static int __devinit sh_keysc_probe(struct platform_device *pdev)
166{
167	struct sh_keysc_priv *priv;
168	struct sh_keysc_info *pdata;
169	struct resource *res;
170	struct input_dev *input;
171	int i;
172	int irq, error;
173
174	if (!pdev->dev.platform_data) {
175		dev_err(&pdev->dev, "no platform data defined\n");
176		error = -EINVAL;
177		goto err0;
178	}
179
180	error = -ENXIO;
181	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
182	if (res == NULL) {
183		dev_err(&pdev->dev, "failed to get I/O memory\n");
184		goto err0;
185	}
186
187	irq = platform_get_irq(pdev, 0);
188	if (irq < 0) {
189		dev_err(&pdev->dev, "failed to get irq\n");
190		goto err0;
191	}
192
193	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
194	if (priv == NULL) {
195		dev_err(&pdev->dev, "failed to allocate driver data\n");
196		error = -ENOMEM;
197		goto err0;
198	}
199
200	platform_set_drvdata(pdev, priv);
201	memcpy(&priv->pdata, pdev->dev.platform_data, sizeof(priv->pdata));
202	pdata = &priv->pdata;
203
204	priv->iomem_base = ioremap_nocache(res->start, resource_size(res));
205	if (priv->iomem_base == NULL) {
206		dev_err(&pdev->dev, "failed to remap I/O memory\n");
207		error = -ENXIO;
208		goto err1;
209	}
210
211	priv->input = input_allocate_device();
212	if (!priv->input) {
213		dev_err(&pdev->dev, "failed to allocate input device\n");
214		error = -ENOMEM;
215		goto err2;
216	}
217
218	input = priv->input;
219	input->evbit[0] = BIT_MASK(EV_KEY);
220
221	input->name = pdev->name;
222	input->phys = "sh-keysc-keys/input0";
223	input->dev.parent = &pdev->dev;
224
225	input->id.bustype = BUS_HOST;
226	input->id.vendor = 0x0001;
227	input->id.product = 0x0001;
228	input->id.version = 0x0100;
229
230	input->keycode = pdata->keycodes;
231	input->keycodesize = sizeof(pdata->keycodes[0]);
232	input->keycodemax = ARRAY_SIZE(pdata->keycodes);
233
234	error = request_threaded_irq(irq, NULL, sh_keysc_isr, IRQF_ONESHOT,
235				     dev_name(&pdev->dev), pdev);
236	if (error) {
237		dev_err(&pdev->dev, "failed to request IRQ\n");
238		goto err3;
239	}
240
241	for (i = 0; i < SH_KEYSC_MAXKEYS; i++)
242		__set_bit(pdata->keycodes[i], input->keybit);
243	__clear_bit(KEY_RESERVED, input->keybit);
244
245	error = input_register_device(input);
246	if (error) {
247		dev_err(&pdev->dev, "failed to register input device\n");
248		goto err4;
249	}
250
251	pm_runtime_enable(&pdev->dev);
252	pm_runtime_get_sync(&pdev->dev);
253
254	sh_keysc_write(priv, KYCR1, (sh_keysc_mode[pdata->mode].kymd << 8) |
255		       pdata->scan_timing);
256	sh_keysc_level_mode(priv, 0);
257
258	device_init_wakeup(&pdev->dev, 1);
259
260	return 0;
261
262 err4:
263	free_irq(irq, pdev);
264 err3:
265	input_free_device(input);
266 err2:
267	iounmap(priv->iomem_base);
268 err1:
269	platform_set_drvdata(pdev, NULL);
270	kfree(priv);
271 err0:
272	return error;
273}
274
275static int __devexit sh_keysc_remove(struct platform_device *pdev)
276{
277	struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
278
279	sh_keysc_write(priv, KYCR2, KYCR2_IRQ_DISABLED);
280
281	input_unregister_device(priv->input);
282	free_irq(platform_get_irq(pdev, 0), pdev);
283	iounmap(priv->iomem_base);
284
285	pm_runtime_put_sync(&pdev->dev);
286	pm_runtime_disable(&pdev->dev);
287
288	platform_set_drvdata(pdev, NULL);
289	kfree(priv);
290
291	return 0;
292}
293
294#ifdef CONFIG_PM_SLEEP
295static int sh_keysc_suspend(struct device *dev)
296{
297	struct platform_device *pdev = to_platform_device(dev);
298	struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
299	int irq = platform_get_irq(pdev, 0);
300	unsigned short value;
301
302	value = sh_keysc_read(priv, KYCR1);
303
304	if (device_may_wakeup(dev)) {
305		sh_keysc_write(priv, KYCR1, value | 0x80);
306		enable_irq_wake(irq);
307	} else {
308		sh_keysc_write(priv, KYCR1, value & ~0x80);
309		pm_runtime_put_sync(dev);
310	}
311
312	return 0;
313}
314
315static int sh_keysc_resume(struct device *dev)
316{
317	struct platform_device *pdev = to_platform_device(dev);
318	int irq = platform_get_irq(pdev, 0);
319
320	if (device_may_wakeup(dev))
321		disable_irq_wake(irq);
322	else
323		pm_runtime_get_sync(dev);
324
325	return 0;
326}
327#endif
328
329static SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops,
330			 sh_keysc_suspend, sh_keysc_resume);
331
332static struct platform_driver sh_keysc_device_driver = {
333	.probe		= sh_keysc_probe,
334	.remove		= __devexit_p(sh_keysc_remove),
335	.driver		= {
336		.name	= "sh_keysc",
337		.pm	= &sh_keysc_dev_pm_ops,
338	}
339};
340
341static int __init sh_keysc_init(void)
342{
343	return platform_driver_register(&sh_keysc_device_driver);
344}
345
346static void __exit sh_keysc_exit(void)
347{
348	platform_driver_unregister(&sh_keysc_device_driver);
349}
350
351module_init(sh_keysc_init);
352module_exit(sh_keysc_exit);
353
354MODULE_AUTHOR("Magnus Damm");
355MODULE_DESCRIPTION("SuperH KEYSC Keypad Driver");
356MODULE_LICENSE("GPL");