mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
ASoC: Add support for BCM2708
This driver adds support for digital audio (I2S) for the BCM2708 SoC that is used by the Raspberry Pi. External audio codecs can be connected to the Raspberry Pi via P5 header. It relies on cyclic DMA engine support for BCM2708. Signed-off-by: Florian Meier <florian.meier@koalo.de> ASoC: BCM2708: Add 24 bit support This adds 24 bit support to the I2S driver of the BCM2708. Besides enabling the 24 bit flags, it includes two bug fixes: MMAP is not supported. Claiming this leads to strange issues when the format of driver and file do not match. The datasheet states that the width extension bit should be set for widths greater than 24, but greater or equal would be correct. This follows from the definition of the width field. Signed-off-by: Florian Meier <florian.meier@koalo.de> bcm2708-i2s: Update bclk_ratio to more correct values Move GPIO setup to hw_params. This is used to stop the I2S driver from breaking the GPIO setup for other uses of the PCM interface Configure GPIOs for I2S based on revision/card settings With RPi model B+, assignment of the I2S GPIO pins has changed. This patch uses the board revision to auto-detect the GPIOs used for I2S. It also allows sound card drivers to set the GPIOs that should be used. This is especially important with the Compute Module. bcm2708-i2s: Avoid leak from iomap when accessing gpio bcm2708: Eliminate i2s debugfs directory error Qualify the two regmap ranges uses by bcm2708-i2s ('-i2s' and '-clk') to avoid the name clash when registering debugfs entries.
This commit is contained in:
committed by
popcornmix
parent
853fe067ae
commit
02f4298dea
@@ -7,3 +7,14 @@ config SND_BCM2835_SOC_I2S
|
||||
Say Y or M if you want to add support for codecs attached to
|
||||
the BCM2835 I2S interface. You will also need
|
||||
to select the audio interfaces to support below.
|
||||
|
||||
config SND_BCM2708_SOC_I2S
|
||||
tristate "SoC Audio support for the Broadcom BCM2708 I2S module"
|
||||
depends on MACH_BCM2708 || MACH_BCM2709
|
||||
select REGMAP_MMIO
|
||||
select SND_SOC_DMAENGINE_PCM
|
||||
select SND_SOC_GENERIC_DMAENGINE_PCM
|
||||
help
|
||||
Say Y or M if you want to add support for codecs attached to
|
||||
the BCM2708 I2S interface. You will also need
|
||||
to select the audio interfaces to support below.
|
||||
|
||||
@@ -3,3 +3,7 @@ snd-soc-bcm2835-i2s-objs := bcm2835-i2s.o
|
||||
|
||||
obj-$(CONFIG_SND_BCM2835_SOC_I2S) += snd-soc-bcm2835-i2s.o
|
||||
|
||||
# BCM2708 Platform Support
|
||||
snd-soc-bcm2708-i2s-objs := bcm2708-i2s.o
|
||||
|
||||
obj-$(CONFIG_SND_BCM2708_SOC_I2S) += snd-soc-bcm2708-i2s.o
|
||||
|
||||
1009
sound/soc/bcm/bcm2708-i2s.c
Normal file
1009
sound/soc/bcm/bcm2708-i2s.c
Normal file
File diff suppressed because it is too large
Load Diff
35
sound/soc/bcm/bcm2708-i2s.h
Normal file
35
sound/soc/bcm/bcm2708-i2s.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* I2S configuration for sound cards.
|
||||
*
|
||||
* Copyright (c) 2014 Daniel Matuschek <daniel@hifiberry.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef BCM2708_I2S_H
|
||||
#define BCM2708_I2S_H
|
||||
|
||||
/* I2S pin assignment */
|
||||
#define BCM2708_I2S_GPIO_AUTO 0
|
||||
#define BCM2708_I2S_GPIO_PIN18 1
|
||||
#define BCM2708_I2S_GPIO_PIN28 2
|
||||
|
||||
/* Alt mode to enable I2S */
|
||||
#define BCM2708_I2S_GPIO_PIN18_ALT 0
|
||||
#define BCM2708_I2S_GPIO_PIN28_ALT 2
|
||||
|
||||
extern void bcm2708_i2s_set_gpio(int gpio);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user