Loading sound/soc/sh/fsi.c +35 −67 Original line number Original line Diff line number Diff line Loading @@ -101,13 +101,10 @@ #define FSI_FMTS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE) #define FSI_FMTS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE) /************************************************************************ /* * struct */ struct ************************************************************************/ struct fsi_priv { struct fsi_priv { void __iomem *base; void __iomem *base; struct snd_pcm_substream *substream; struct snd_pcm_substream *substream; Loading Loading @@ -142,13 +139,10 @@ struct fsi_master { spinlock_t lock; spinlock_t lock; }; }; /************************************************************************ /* * basic read write function */ basic read write function ************************************************************************/ static void __fsi_reg_write(u32 reg, u32 data) static void __fsi_reg_write(u32 reg, u32 data) { { /* valid data area is 24bit */ /* valid data area is 24bit */ Loading Loading @@ -251,13 +245,10 @@ static void fsi_master_mask_set(struct fsi_master *master, spin_unlock_irqrestore(&master->lock, flags); spin_unlock_irqrestore(&master->lock, flags); } } /************************************************************************ /* * basic function */ basic function ************************************************************************/ static struct fsi_master *fsi_get_master(struct fsi_priv *fsi) static struct fsi_master *fsi_get_master(struct fsi_priv *fsi) { { return fsi->master; return fsi->master; Loading Loading @@ -362,13 +353,10 @@ static u8 *fsi_dma_get_area(struct fsi_priv *fsi) return fsi->substream->runtime->dma_area + fsi->byte_offset; return fsi->substream->runtime->dma_area + fsi->byte_offset; } } /************************************************************************ /* * irq function */ irq function ************************************************************************/ static void fsi_irq_enable(struct fsi_priv *fsi, int is_play) static void fsi_irq_enable(struct fsi_priv *fsi, int is_play) { { u32 data = fsi_port_ab_io_bit(fsi, is_play); u32 data = fsi_port_ab_io_bit(fsi, is_play); Loading Loading @@ -409,13 +397,11 @@ static void fsi_irq_clear_status(struct fsi_priv *fsi) fsi_master_mask_set(master, master->core->int_st, data, 0); fsi_master_mask_set(master, master->core->int_st, data, 0); } } /************************************************************************ /* * SPDIF master clock function * SPDIF master clock function * These functions are used later FSI2 */ These functions are used later FSI2 ************************************************************************/ static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable) static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable) { { struct fsi_master *master = fsi_get_master(fsi); struct fsi_master *master = fsi_get_master(fsi); Loading @@ -432,13 +418,10 @@ static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable) fsi_master_mask_set(master, fsi->mst_ctrl, val, 0); fsi_master_mask_set(master, fsi->mst_ctrl, val, 0); } } /************************************************************************ /* * ctrl function */ ctrl function ************************************************************************/ static void fsi_clk_ctrl(struct fsi_priv *fsi, int enable) static void fsi_clk_ctrl(struct fsi_priv *fsi, int enable) { { u32 val = fsi_is_port_a(fsi) ? (1 << 0) : (1 << 4); u32 val = fsi_is_port_a(fsi) ? (1 << 0) : (1 << 4); Loading Loading @@ -697,13 +680,10 @@ static irqreturn_t fsi_interrupt(int irq, void *data) return IRQ_HANDLED; return IRQ_HANDLED; } } /************************************************************************ /* * dai ops */ dai ops ************************************************************************/ static int fsi_dai_startup(struct snd_pcm_substream *substream, static int fsi_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) struct snd_soc_dai *dai) { { Loading Loading @@ -922,13 +902,10 @@ static struct snd_soc_dai_ops fsi_dai_ops = { .hw_params = fsi_dai_hw_params, .hw_params = fsi_dai_hw_params, }; }; /************************************************************************ /* * pcm ops */ pcm ops ************************************************************************/ static struct snd_pcm_hardware fsi_pcm_hardware = { static struct snd_pcm_hardware fsi_pcm_hardware = { .info = SNDRV_PCM_INFO_INTERLEAVED | .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP | Loading Loading @@ -994,13 +971,10 @@ static struct snd_pcm_ops fsi_pcm_ops = { .pointer = fsi_pointer, .pointer = fsi_pointer, }; }; /************************************************************************ /* * snd_soc_platform */ snd_soc_platform ************************************************************************/ #define PREALLOC_BUFFER (32 * 1024) #define PREALLOC_BUFFER (32 * 1024) #define PREALLOC_BUFFER_MAX (32 * 1024) #define PREALLOC_BUFFER_MAX (32 * 1024) Loading @@ -1024,13 +998,10 @@ static int fsi_pcm_new(struct snd_card *card, PREALLOC_BUFFER, PREALLOC_BUFFER_MAX); PREALLOC_BUFFER, PREALLOC_BUFFER_MAX); } } /************************************************************************ /* * alsa struct */ alsa struct ************************************************************************/ static struct snd_soc_dai_driver fsi_soc_dai[] = { static struct snd_soc_dai_driver fsi_soc_dai[] = { { { .name = "fsia-dai", .name = "fsia-dai", Loading Loading @@ -1072,13 +1043,10 @@ static struct snd_soc_platform_driver fsi_soc_platform = { .pcm_free = fsi_pcm_free, .pcm_free = fsi_pcm_free, }; }; /************************************************************************ /* * platform function */ platform function ************************************************************************/ static int fsi_probe(struct platform_device *pdev) static int fsi_probe(struct platform_device *pdev) { { struct fsi_master *master; struct fsi_master *master; Loading Loading
sound/soc/sh/fsi.c +35 −67 Original line number Original line Diff line number Diff line Loading @@ -101,13 +101,10 @@ #define FSI_FMTS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE) #define FSI_FMTS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE) /************************************************************************ /* * struct */ struct ************************************************************************/ struct fsi_priv { struct fsi_priv { void __iomem *base; void __iomem *base; struct snd_pcm_substream *substream; struct snd_pcm_substream *substream; Loading Loading @@ -142,13 +139,10 @@ struct fsi_master { spinlock_t lock; spinlock_t lock; }; }; /************************************************************************ /* * basic read write function */ basic read write function ************************************************************************/ static void __fsi_reg_write(u32 reg, u32 data) static void __fsi_reg_write(u32 reg, u32 data) { { /* valid data area is 24bit */ /* valid data area is 24bit */ Loading Loading @@ -251,13 +245,10 @@ static void fsi_master_mask_set(struct fsi_master *master, spin_unlock_irqrestore(&master->lock, flags); spin_unlock_irqrestore(&master->lock, flags); } } /************************************************************************ /* * basic function */ basic function ************************************************************************/ static struct fsi_master *fsi_get_master(struct fsi_priv *fsi) static struct fsi_master *fsi_get_master(struct fsi_priv *fsi) { { return fsi->master; return fsi->master; Loading Loading @@ -362,13 +353,10 @@ static u8 *fsi_dma_get_area(struct fsi_priv *fsi) return fsi->substream->runtime->dma_area + fsi->byte_offset; return fsi->substream->runtime->dma_area + fsi->byte_offset; } } /************************************************************************ /* * irq function */ irq function ************************************************************************/ static void fsi_irq_enable(struct fsi_priv *fsi, int is_play) static void fsi_irq_enable(struct fsi_priv *fsi, int is_play) { { u32 data = fsi_port_ab_io_bit(fsi, is_play); u32 data = fsi_port_ab_io_bit(fsi, is_play); Loading Loading @@ -409,13 +397,11 @@ static void fsi_irq_clear_status(struct fsi_priv *fsi) fsi_master_mask_set(master, master->core->int_st, data, 0); fsi_master_mask_set(master, master->core->int_st, data, 0); } } /************************************************************************ /* * SPDIF master clock function * SPDIF master clock function * These functions are used later FSI2 */ These functions are used later FSI2 ************************************************************************/ static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable) static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable) { { struct fsi_master *master = fsi_get_master(fsi); struct fsi_master *master = fsi_get_master(fsi); Loading @@ -432,13 +418,10 @@ static void fsi_spdif_clk_ctrl(struct fsi_priv *fsi, int enable) fsi_master_mask_set(master, fsi->mst_ctrl, val, 0); fsi_master_mask_set(master, fsi->mst_ctrl, val, 0); } } /************************************************************************ /* * ctrl function */ ctrl function ************************************************************************/ static void fsi_clk_ctrl(struct fsi_priv *fsi, int enable) static void fsi_clk_ctrl(struct fsi_priv *fsi, int enable) { { u32 val = fsi_is_port_a(fsi) ? (1 << 0) : (1 << 4); u32 val = fsi_is_port_a(fsi) ? (1 << 0) : (1 << 4); Loading Loading @@ -697,13 +680,10 @@ static irqreturn_t fsi_interrupt(int irq, void *data) return IRQ_HANDLED; return IRQ_HANDLED; } } /************************************************************************ /* * dai ops */ dai ops ************************************************************************/ static int fsi_dai_startup(struct snd_pcm_substream *substream, static int fsi_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) struct snd_soc_dai *dai) { { Loading Loading @@ -922,13 +902,10 @@ static struct snd_soc_dai_ops fsi_dai_ops = { .hw_params = fsi_dai_hw_params, .hw_params = fsi_dai_hw_params, }; }; /************************************************************************ /* * pcm ops */ pcm ops ************************************************************************/ static struct snd_pcm_hardware fsi_pcm_hardware = { static struct snd_pcm_hardware fsi_pcm_hardware = { .info = SNDRV_PCM_INFO_INTERLEAVED | .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP | Loading Loading @@ -994,13 +971,10 @@ static struct snd_pcm_ops fsi_pcm_ops = { .pointer = fsi_pointer, .pointer = fsi_pointer, }; }; /************************************************************************ /* * snd_soc_platform */ snd_soc_platform ************************************************************************/ #define PREALLOC_BUFFER (32 * 1024) #define PREALLOC_BUFFER (32 * 1024) #define PREALLOC_BUFFER_MAX (32 * 1024) #define PREALLOC_BUFFER_MAX (32 * 1024) Loading @@ -1024,13 +998,10 @@ static int fsi_pcm_new(struct snd_card *card, PREALLOC_BUFFER, PREALLOC_BUFFER_MAX); PREALLOC_BUFFER, PREALLOC_BUFFER_MAX); } } /************************************************************************ /* * alsa struct */ alsa struct ************************************************************************/ static struct snd_soc_dai_driver fsi_soc_dai[] = { static struct snd_soc_dai_driver fsi_soc_dai[] = { { { .name = "fsia-dai", .name = "fsia-dai", Loading Loading @@ -1072,13 +1043,10 @@ static struct snd_soc_platform_driver fsi_soc_platform = { .pcm_free = fsi_pcm_free, .pcm_free = fsi_pcm_free, }; }; /************************************************************************ /* * platform function */ platform function ************************************************************************/ static int fsi_probe(struct platform_device *pdev) static int fsi_probe(struct platform_device *pdev) { { struct fsi_master *master; struct fsi_master *master; Loading