Commit 21fed4b4 authored by Eduardo Valentin's avatar Eduardo Valentin Committed by Tony Lindgren

Code clean-up for sound/arm/omap/omap-alsa-sx1.c

Removed lots of whitespaces and a few errors and
warnings reported by checkpatch.pl.
Signed-off-by: default avatarEduardo Valentin <eduardo.valentin@indt.org.br>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 6011a122
...@@ -14,19 +14,18 @@ ...@@ -14,19 +14,18 @@
#include <linux/soundcard.h> #include <linux/soundcard.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <asm/io.h> #include <linux/io.h>
#include <asm/arch/mcbsp.h> #include <linux/connector.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <asm/arch/dma.h> #include <asm/arch/dma.h>
#include <asm/arch/clock.h> #include <asm/arch/clock.h>
#include <asm/arch/gpio.h> #include <asm/arch/gpio.h>
#include <asm/arch/mcbsp.h>
#include <asm/arch/omap-alsa.h> #include <asm/arch/omap-alsa.h>
#include "omap-alsa-sx1.h"
#include <linux/connector.h> #include "omap-alsa-sx1.h"
/* Connector implementation */ /* Connector implementation */
static struct cb_id cn_sx1snd_id = { CN_IDX_SX1SND, CN_VAL_SX1SND }; static struct cb_id cn_sx1snd_id = { CN_IDX_SX1SND, CN_VAL_SX1SND };
...@@ -36,7 +35,8 @@ static void cn_sx1snd_callback(void *data) ...@@ -36,7 +35,8 @@ static void cn_sx1snd_callback(void *data)
{ {
struct cn_msg *msg = (struct cn_msg *)data; struct cn_msg *msg = (struct cn_msg *)data;
printk("%s: %lu: idx=%x, val=%x, seq=%u, ack=%u, len=%d: %s.\n", printk(KERN_INFO
"%s: %lu: idx=%x, val=%x, seq=%u, ack=%u, len=%d: %s.\n",
__func__, jiffies, msg->id.idx, msg->id.val, __func__, jiffies, msg->id.idx, msg->id.val,
msg->seq, msg->ack, msg->len, (char *)msg->data); msg->seq, msg->ack, msg->len, (char *)msg->data);
} }
...@@ -63,7 +63,7 @@ int cn_sx1snd_send(unsigned int cmd, unsigned int arg1, unsigned int arg2) ...@@ -63,7 +63,7 @@ int cn_sx1snd_send(unsigned int cmd, unsigned int arg1, unsigned int arg2)
memcpy(m + 1, data, m->len); memcpy(m + 1, data, m->len);
err = cn_netlink_send(m, CN_IDX_SX1SND, gfp_any()); err = cn_netlink_send(m, CN_IDX_SX1SND, gfp_any());
snd_printd("sent= %02X %02X %02X, err=%d\n", cmd,arg1,arg2,err); snd_printd("sent= %02X %02X %02X, err=%d\n", cmd, arg1, arg2, err);
kfree(m); kfree(m);
if (err == -ESRCH) if (err == -ESRCH)
...@@ -150,15 +150,42 @@ static void egold_set_samplerate(long sample_rate) ...@@ -150,15 +150,42 @@ static void egold_set_samplerate(long sample_rate)
clkgdv = CODEC_CLOCK / (sample_rate * (DEFAULT_BITPERSAMPLE * 2 - 1)); clkgdv = CODEC_CLOCK / (sample_rate * (DEFAULT_BITPERSAMPLE * 2 - 1));
#endif #endif
switch (sample_rate) { switch (sample_rate) {
case 8000: clkgdv = 71; egold_rate = FRQ_8000; break; case 8000:
case 11025: clkgdv = 51; egold_rate = FRQ_11025; break; clkgdv = 71;
case 12000: clkgdv = 47; egold_rate = FRQ_12000; break; egold_rate = FRQ_8000;
case 16000: clkgdv = 35; egold_rate = FRQ_16000; break; break;
case 22050: clkgdv = 25; egold_rate = FRQ_22050; break; case 11025:
case 24000: clkgdv = 23; egold_rate = FRQ_24000; break; clkgdv = 51;
case 32000: clkgdv = 17; egold_rate = FRQ_32000; break; egold_rate = FRQ_11025;
case 44100: clkgdv = 12; egold_rate = FRQ_44100; break; break;
case 48000: clkgdv = 11; egold_rate = FRQ_48000; break; case 12000:
clkgdv = 47;
egold_rate = FRQ_12000;
break;
case 16000:
clkgdv = 35;
egold_rate = FRQ_16000;
break;
case 22050:
clkgdv = 25;
egold_rate = FRQ_22050;
break;
case 24000:
clkgdv = 23;
egold_rate = FRQ_24000;
break;
case 32000:
clkgdv = 17;
egold_rate = FRQ_32000;
break;
case 44100:
clkgdv = 12;
egold_rate = FRQ_44100;
break;
case 48000:
clkgdv = 11;
egold_rate = FRQ_48000;
break;
} }
srgr1 = (FWID(DEFAULT_BITPERSAMPLE - 1) | CLKGDV(clkgdv)); srgr1 = (FWID(DEFAULT_BITPERSAMPLE - 1) | CLKGDV(clkgdv));
...@@ -234,7 +261,7 @@ static int __init snd_omap_alsa_egold_probe(struct platform_device *pdev) ...@@ -234,7 +261,7 @@ static int __init snd_omap_alsa_egold_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
codec_cfg->hw_constraints_rates = &egold_hw_constraints_rates; codec_cfg->hw_constraints_rates = &egold_hw_constraints_rates;
codec_cfg->snd_omap_alsa_playback= &egold_snd_omap_alsa_playback; codec_cfg->snd_omap_alsa_playback = &egold_snd_omap_alsa_playback;
codec_cfg->snd_omap_alsa_capture = &egold_snd_omap_alsa_capture; codec_cfg->snd_omap_alsa_capture = &egold_snd_omap_alsa_capture;
codec_cfg->codec_configure_dev = egold_configure; codec_cfg->codec_configure_dev = egold_configure;
codec_cfg->codec_set_samplerate = egold_set_samplerate; codec_cfg->codec_set_samplerate = egold_set_samplerate;
...@@ -262,7 +289,8 @@ static int __init omap_alsa_egold_init(void) ...@@ -262,7 +289,8 @@ static int __init omap_alsa_egold_init(void)
{ {
int retval; int retval;
retval = cn_add_callback(&cn_sx1snd_id, cn_sx1snd_name, cn_sx1snd_callback); retval = cn_add_callback(&cn_sx1snd_id, cn_sx1snd_name,
cn_sx1snd_callback);
if (retval) if (retval)
printk(KERN_WARNING "cn_sx1snd failed to register\n"); printk(KERN_WARNING "cn_sx1snd failed to register\n");
return platform_driver_register(&omap_alsa_driver); return platform_driver_register(&omap_alsa_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment