diff mbox

[1/2] ARM: pxa: spitz: register spitz-audio device

Message ID 1413881664-24870-1-git-send-email-dbaryshkov@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dmitry Baryshkov Oct. 21, 2014, 8:54 a.m. UTC
Register spitz-audio device to be used by ASoC driver.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 arch/arm/mach-pxa/spitz.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Robert Jarzmik Oct. 21, 2014, 5:12 p.m. UTC | #1
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:

Hi Dmitry,

> Register spitz-audio device to be used by ASoC driver.
>
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
>  arch/arm/mach-pxa/spitz.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
> index 840c3a4..a9f971f 100644
> --- a/arch/arm/mach-pxa/spitz.c
> +++ b/arch/arm/mach-pxa/spitz.c
> @@ -924,6 +924,23 @@ static inline void spitz_i2c_init(void) {}
>  #endif
>  
>  /******************************************************************************
> + * Audio devices
> + ******************************************************************************/
> +#if defined(CONFIG_SND_PXA2XX_SOC_SPITZ) || defined(SND_PXA2XX_SOC_SPITZ_MODULE)
> +static struct platform_device spitz_audio_device = {
> +	.name	= "spitz-audio",
> +	.id	= -1,
> +};
> +
> +static inline void spitz_audio_init(void)
> +{
> +	platform_device_register(&spitz_audio_device);
> +}
> +#else
> +static inline void spitz_audio_init(void) {}
> +#endif

Couldn't you eliminate the "#if defined" line , and "#else ... #endif" ?

I mean that spitz_audio_init() would always register the spitz_audio_device,
regardless of the config. The config would build or not build the sound soc
platform driver. Would that be alright for all your usecases ?

Cheers.
Dmitry Baryshkov Oct. 21, 2014, 7:35 p.m. UTC | #2
Hello,

2014-10-21 21:12 GMT+04:00 Robert Jarzmik <robert.jarzmik@free.fr>:
> Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> writes:
>
> Hi Dmitry,
>
>> Register spitz-audio device to be used by ASoC driver.
>>
>> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
>> ---
>>  arch/arm/mach-pxa/spitz.c | 18 ++++++++++++++++++
>>  1 file changed, 18 insertions(+)
>>
>> diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
>> index 840c3a4..a9f971f 100644
>> --- a/arch/arm/mach-pxa/spitz.c
>> +++ b/arch/arm/mach-pxa/spitz.c
>> @@ -924,6 +924,23 @@ static inline void spitz_i2c_init(void) {}
>>  #endif
>>
>>  /******************************************************************************
>> + * Audio devices
>> + ******************************************************************************/
>> +#if defined(CONFIG_SND_PXA2XX_SOC_SPITZ) || defined(SND_PXA2XX_SOC_SPITZ_MODULE)
>> +static struct platform_device spitz_audio_device = {
>> +     .name   = "spitz-audio",
>> +     .id     = -1,
>> +};
>> +
>> +static inline void spitz_audio_init(void)
>> +{
>> +     platform_device_register(&spitz_audio_device);
>> +}
>> +#else
>> +static inline void spitz_audio_init(void) {}
>> +#endif
>
> Couldn't you eliminate the "#if defined" line , and "#else ... #endif" ?
>
> I mean that spitz_audio_init() would always register the spitz_audio_device,
> regardless of the config. The config would build or not build the sound soc
> platform driver. Would that be alright for all your usecases ?

Yes, of course. I just tried to mimic the style of the rest of the file.

I will resubmit the patch shortly.
diff mbox

Patch

diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 840c3a4..a9f971f 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -924,6 +924,23 @@  static inline void spitz_i2c_init(void) {}
 #endif
 
 /******************************************************************************
+ * Audio devices
+ ******************************************************************************/
+#if defined(CONFIG_SND_PXA2XX_SOC_SPITZ) || defined(SND_PXA2XX_SOC_SPITZ_MODULE)
+static struct platform_device spitz_audio_device = {
+	.name	= "spitz-audio",
+	.id	= -1,
+};
+
+static inline void spitz_audio_init(void)
+{
+	platform_device_register(&spitz_audio_device);
+}
+#else
+static inline void spitz_audio_init(void) {}
+#endif
+
+/******************************************************************************
  * Machine init
  ******************************************************************************/
 static void spitz_poweroff(void)
@@ -970,6 +987,7 @@  static void __init spitz_init(void)
 	spitz_nor_init();
 	spitz_nand_init();
 	spitz_i2c_init();
+	spitz_audio_init();
 }
 
 static void __init spitz_fixup(struct tag *tags, char **cmdline)