linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] DaVinci: DM365: Add the device_enable for the DaVinci Keyscan
@ 2009-11-13 17:19 miguel.aguilar
  2009-11-13 17:52 ` Nori, Sekhar
  0 siblings, 1 reply; 3+ messages in thread
From: miguel.aguilar @ 2009-11-13 17:19 UTC (permalink / raw)
  To: davinci-linux-open-source, nsnehaprabha, linux-input
  Cc: todd.fischer, diego.dompe, clark.becker, santiago.nunez,
	Miguel Aguilar

From: Miguel Aguilar <miguel.aguilar@ridgerun.com>

Adds the device_enable function to the DaVinci Keyscan platform data
to setup the PINMUX configuration.

It also removes #ifdef from the DM365 EVM board in order to load it
properly as a module.

Signed-off-by: Miguel Aguilar <miguel.aguilar@ridgerun.com>
---
 arch/arm/mach-davinci/board-dm365-evm.c |   11 ++++++-----
 arch/arm/mach-davinci/dm365.c           |    1 -
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 8d23972..5abf89d 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -195,7 +195,11 @@ static struct davinci_i2c_platform_data i2c_pdata = {
 	.bus_delay	= 0	/* usec */,
 };
 
-#ifdef CONFIG_KEYBOARD_DAVINCI
+void dm365evm_keyscan_enable(struct device *dev)
+{
+	davinci_cfg_reg(DM365_KEYSCAN);
+}
+
 static unsigned short dm365evm_keymap[] = {
 	KEY_KP2,
 	KEY_LEFT,
@@ -217,6 +221,7 @@ static unsigned short dm365evm_keymap[] = {
 };
 
 static struct davinci_ks_platform_data dm365evm_ks_data = {
+	.device_enable	= dm365evm_keyscan_enable,
 	.keymap		= dm365evm_keymap,
 	.keymapsize	= ARRAY_SIZE(dm365evm_keymap),
 	.rep		= 1,
@@ -225,7 +230,6 @@ static struct davinci_ks_platform_data dm365evm_ks_data = {
 	.interval	= 0x2,
 	.matrix_type	= DAVINCI_KEYSCAN_MATRIX_4X4,
 };
-#endif
 
 static int cpld_mmc_get_cd(int module)
 {
@@ -514,10 +518,7 @@ static __init void dm365_evm_init(void)
 
 	dm365_init_asp(&dm365_evm_snd_data);
 	dm365_init_rtc();
-
-#ifdef CONFIG_KEYBOARD_DAVINCI
 	dm365_init_ks(&dm365evm_ks_data);
-#endif
 }
 
 static __init void dm365_evm_irq_init(void)
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 2ec619e..f53735c 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -993,7 +993,6 @@ void __init dm365_init_asp(struct snd_platform_data *pdata)
 
 void __init dm365_init_ks(struct davinci_ks_platform_data *pdata)
 {
-	davinci_cfg_reg(DM365_KEYSCAN);
 	dm365_ks_device.dev.platform_data = pdata;
 	platform_device_register(&dm365_ks_device);
 }
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH 2/2] DaVinci: DM365: Add the device_enable for the DaVinci Keyscan
  2009-11-13 17:19 [PATCH 2/2] DaVinci: DM365: Add the device_enable for the DaVinci Keyscan miguel.aguilar
@ 2009-11-13 17:52 ` Nori, Sekhar
  2009-11-13 18:35   ` Miguel Aguilar
  0 siblings, 1 reply; 3+ messages in thread
From: Nori, Sekhar @ 2009-11-13 17:52 UTC (permalink / raw)
  To: miguel.aguilar@ridgerun.com,
	davinci-linux-open-source@linux.davincidsp.com, Narnakaje,
	Snehaprabh
  Cc: santiago.nunez@ridgerun.com, todd.fischer@ridgerun.com,
	clark.becker@ridgerun.com

On Fri, Nov 13, 2009 at 22:49:46, miguel.aguilar@ridgerun.com wrote:
> From: Miguel Aguilar <miguel.aguilar@ridgerun.com>
>
> Adds the device_enable function to the DaVinci Keyscan platform data
> to setup the PINMUX configuration.
>
> It also removes #ifdef from the DM365 EVM board in order to load it
> properly as a module.
>
> Signed-off-by: Miguel Aguilar <miguel.aguilar@ridgerun.com>
> ---
>  arch/arm/mach-davinci/board-dm365-evm.c |   11 ++++++-----
>  arch/arm/mach-davinci/dm365.c           |    1 -
>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
> index 8d23972..5abf89d 100644
> --- a/arch/arm/mach-davinci/board-dm365-evm.c
> +++ b/arch/arm/mach-davinci/board-dm365-evm.c
> @@ -195,7 +195,11 @@ static struct davinci_i2c_platform_data i2c_pdata = {
>       .bus_delay      = 0     /* usec */,
>  };
>
> -#ifdef CONFIG_KEYBOARD_DAVINCI
> +void dm365evm_keyscan_enable(struct device *dev)
> +{
> +     davinci_cfg_reg(DM365_KEYSCAN);

This could probably return a useful error (later)
so, its better to make a provision to propagate
the error.

> +}
> +
>  static unsigned short dm365evm_keymap[] = {
>       KEY_KP2,
>       KEY_LEFT,
> @@ -217,6 +221,7 @@ static unsigned short dm365evm_keymap[] = {
>  };
>
>  static struct davinci_ks_platform_data dm365evm_ks_data = {
> +     .device_enable  = dm365evm_keyscan_enable,

Maybe it's a personal choice, but simply calling it
'init' instead of 'device_enable' should be sufficient.

Thanks,
Sekhar


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] DaVinci: DM365: Add the device_enable for the DaVinci Keyscan
  2009-11-13 17:52 ` Nori, Sekhar
@ 2009-11-13 18:35   ` Miguel Aguilar
  0 siblings, 0 replies; 3+ messages in thread
From: Miguel Aguilar @ 2009-11-13 18:35 UTC (permalink / raw)
  To: Nori, Sekhar
  Cc: davinci-linux-open-source@linux.davincidsp.com,
	Narnakaje, Snehaprabha, linux-input@vger.kernel.org,
	santiago.nunez@ridgerun.com, todd.fischer@ridgerun.com,
	clark.becker@ridgerun.com

Nori, Sekhar wrote:
> On Fri, Nov 13, 2009 at 22:49:46, miguel.aguilar@ridgerun.com wrote:
>> From: Miguel Aguilar <miguel.aguilar@ridgerun.com>
>>
>> Adds the device_enable function to the DaVinci Keyscan platform data
>> to setup the PINMUX configuration.
>>
>> It also removes #ifdef from the DM365 EVM board in order to load it
>> properly as a module.
>>
>> Signed-off-by: Miguel Aguilar <miguel.aguilar@ridgerun.com>
>> ---
>>  arch/arm/mach-davinci/board-dm365-evm.c |   11 ++++++-----
>>  arch/arm/mach-davinci/dm365.c           |    1 -
>>  2 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
>> index 8d23972..5abf89d 100644
>> --- a/arch/arm/mach-davinci/board-dm365-evm.c
>> +++ b/arch/arm/mach-davinci/board-dm365-evm.c
>> @@ -195,7 +195,11 @@ static struct davinci_i2c_platform_data i2c_pdata = {
>>       .bus_delay      = 0     /* usec */,
>>  };
>>
>> -#ifdef CONFIG_KEYBOARD_DAVINCI
>> +void dm365evm_keyscan_enable(struct device *dev)
>> +{
>> +     davinci_cfg_reg(DM365_KEYSCAN);
> 
> This could probably return a useful error (later)
> so, its better to make a provision to propagate
> the error.
Yes, that would be a good idea.
> 
>> +}
>> +
>>  static unsigned short dm365evm_keymap[] = {
>>       KEY_KP2,
>>       KEY_LEFT,
>> @@ -217,6 +221,7 @@ static unsigned short dm365evm_keymap[] = {
>>  };
>>
>>  static struct davinci_ks_platform_data dm365evm_ks_data = {
>> +     .device_enable  = dm365evm_keyscan_enable,
> 
> Maybe it's a personal choice, but simply calling it
> 'init' instead of 'device_enable' should be sufficient.
The idea is to avoid confusion with other init functions, due to the specific 
intention of this function, which is perform board specific actions only when 
the device is enabled, mainly when the driver is built as a module.
> 
> Thanks,
> Sekhar
> 

Thanks,

Miguel Aguilar



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-13 18:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-13 17:19 [PATCH 2/2] DaVinci: DM365: Add the device_enable for the DaVinci Keyscan miguel.aguilar
2009-11-13 17:52 ` Nori, Sekhar
2009-11-13 18:35   ` Miguel Aguilar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).