Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
22d8a73a
Commit
22d8a73a
authored
Aug 20, 2007
by
Russell King
Committed by
Russell King
Oct 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] pxa: update pxa27x keypad driver to use clk support
Signed-off-by:
Russell King
<
rmk+kernel@arm.linux.org.uk
>
parent
c3cef3f3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
drivers/input/keyboard/pxa27x_keyboard.c
drivers/input/keyboard/pxa27x_keyboard.c
+20
-5
No files found.
drivers/input/keyboard/pxa27x_keyboard.c
View file @
22d8a73a
...
...
@@ -23,6 +23,8 @@
#include <linux/input.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
...
...
@@ -40,6 +42,8 @@
col/2 == 2 ? KPASMKP2 : KPASMKP3)
#define KPASMKPx_MKC(row, col) (1 << (row + 16 * (col % 2)))
static
struct
clk
*
pxakbd_clk
;
static
irqreturn_t
pxakbd_irq_handler
(
int
irq
,
void
*
dev_id
)
{
struct
platform_device
*
pdev
=
dev_id
;
...
...
@@ -104,7 +108,7 @@ static int pxakbd_open(struct input_dev *dev)
KPREC
=
0x7F
;
/* Enable unit clock */
pxa_set_cken
(
CKEN_KEYPAD
,
1
);
clk_enable
(
pxakbd_clk
);
return
0
;
}
...
...
@@ -112,7 +116,7 @@ static int pxakbd_open(struct input_dev *dev)
static
void
pxakbd_close
(
struct
input_dev
*
dev
)
{
/* Disable clock unit */
pxa_set_cken
(
CKEN_KEYPAD
,
0
);
clk_disable
(
pxakbd_clk
);
}
#ifdef CONFIG_PM
...
...
@@ -140,7 +144,8 @@ static int pxakbd_resume(struct platform_device *pdev)
KPREC
=
pdata
->
reg_kprec
;
/* Enable unit clock */
pxa_set_cken
(
CKEN_KEYPAD
,
1
);
clk_disable
(
pxakbd_clk
);
clk_enable
(
pxakbd_clk
);
}
mutex_unlock
(
&
input_dev
->
mutex
);
...
...
@@ -158,11 +163,18 @@ static int __devinit pxakbd_probe(struct platform_device *pdev)
struct
input_dev
*
input_dev
;
int
i
,
row
,
col
,
error
;
pxakbd_clk
=
clk_get
(
&
pdev
->
dev
,
"KBDCLK"
);
if
(
IS_ERR
(
pxakbd_clk
))
{
error
=
PTR_ERR
(
pxakbd_clk
);
goto
err_clk
;
}
/* Create and register the input driver. */
input_dev
=
input_allocate_device
();
if
(
!
input_dev
)
{
printk
(
KERN_ERR
"Cannot request keypad device
\n
"
);
return
-
ENOMEM
;
error
=
-
ENOMEM
;
goto
err_alloc
;
}
input_dev
->
name
=
DRIVER_NAME
;
...
...
@@ -185,7 +197,6 @@ static int __devinit pxakbd_probe(struct platform_device *pdev)
DRIVER_NAME
,
pdev
);
if
(
error
)
{
printk
(
KERN_ERR
"Cannot request keypad IRQ
\n
"
);
pxa_set_cken
(
CKEN_KEYPAD
,
0
);
goto
err_free_dev
;
}
...
...
@@ -217,6 +228,9 @@ static int __devinit pxakbd_probe(struct platform_device *pdev)
free_irq
(
IRQ_KEYPAD
,
pdev
);
err_free_dev:
input_free_device
(
input_dev
);
err_alloc:
clk_put
(
pxakbd_clk
);
err_clk:
return
error
;
}
...
...
@@ -226,6 +240,7 @@ static int __devexit pxakbd_remove(struct platform_device *pdev)
input_unregister_device
(
input_dev
);
free_irq
(
IRQ_KEYPAD
,
pdev
);
clk_put
(
pxakbd_clk
);
platform_set_drvdata
(
pdev
,
NULL
);
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment