Commit graph

18 commits

Author SHA1 Message Date
Hans-Christian Egtvedt
fd76804f3f ALSA: fix invalid hardware.h include in ac97c for AVR32 architecture
This patch fixes the non-compiling AC97C driver for AVR32 architecture by
include mach/hardware.h only for AT91 architecture. The AVR32 architecture does
not supply the hardware.h include file.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
CC: stable@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-25 18:07:10 +01:00
Takashi Iwai
1beded5d9c ALSA: atmel - Fix the return value in error path
In the commit c0763e687d
    ALSA: snd-atmel-abdac: test wrong variable
the return value via PTR_ERR() had to be fixed as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-11-22 10:57:17 +01:00
Vasiliy Kulikov
c0763e687d ALSA: snd-atmel-abdac: test wrong variable
After clk_get() pclk is checked second time instead of sample_clk check.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-11-22 10:56:53 +01:00
Yegor Yefremov
f534116308 ALSA: atmel: set "channel A event" output to debug
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-08 16:42:02 +02:00
Sedji Gaouaou
ec2755a93d ALSA: AC97: add full duplex support for atmel AT91 and AVR.
This patch add full duplex support on AT91 and AVR.
It was a bug: we needed to check first if there are some chips opened so we
could enable both reception and sending of the data.

Signed-off-by: Sedji Gaouaou <sedji.gaouaou@atmel.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-25 20:22:36 +01:00
Sedji Gaouaou
7177395fdd ALSA: AC97: add AC97 support for AT91.
This patch add AC97 support for ATMEL AT91, using the AVR32 code.
While AVR is using a DMA, the AT91 chips are using a Peripheral Data
Controller.

Signed-off-by: Sedji Gaouaou <sedji.gaouaou@atmel.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-25 20:22:15 +01:00
Hans-Christian Egtvedt
fa075ed2dc ALSA: snd-atmel-abdac: increase periods_min to 6 instead of 4
This patch increases periods_min to 6 from 4, this will remove any
hickups where the buffer is not filled fast enough from user space.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-06 03:56:28 +02:00
Hans-Christian Egtvedt
60a56cce7a ALSA: snd-atmel-abdac: replace bus_id with dev_name()
This patch replaces the references to bus_id to the new dev_name() API.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-06 03:56:11 +02:00
Hans-Christian Egtvedt
23572856e0 ALSA: snd-atmel-ac97c: replace bus_id with dev_name()
This patch replaces the references to bus_id to the new dev_name() API.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-06 03:55:59 +02:00
Hans-Christian Egtvedt
bd74a1843e ALSA: snd-atmel-ac97c: cleanup registers when removing driver
This patch will set the channel A and control channel mode register to
zero before disabling the AC97C peripheral.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-06 03:55:50 +02:00
Hans-Christian Egtvedt
81baf3a7f6 ALSA: snd-atmel-ac97c: do a proper reset of the external codec
This patch will enable the AC97C before resetting the external codec,
leaving the AC97C disabled will result in floating I/O lines that can
affect the reset procedure.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-06 03:55:42 +02:00
Hans-Christian Egtvedt
df163587ea ALSA: snd-atmel-ac97c: enable interrupts to catch events for error reporting
This patch will enable interrupts from AC97C and report about error
conditions that occurs.

On channel A both overrun and underrun will be enabled depending if
playback and/or capture are enabled. On the control channel the overrun
interrupt is enabled.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-06 03:55:33 +02:00
Hans-Christian Egtvedt
c42eec0f19 ALSA: snd-atmel-ac97c: set correct size for buffer hardware parameter
This patch will set a proper maximum bytes for the buffer, which is:
channels * bytes per sample * maximum periods * maximum bytes per period.

It also sets the minimum periods to 6, a value chosen from testing, with
a minimum of 6 periods the system has good time to fill in new audio
data without skipping.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-06 03:55:15 +02:00
Hans-Christian Egtvedt
128ed6a926 ALSA: snd-atmel-ac97c: do not overwrite OCA and ICA when assigning channels
This patch will take care not to overwrite OCA and ICA registers when
assigning input and output channels. It will also make sure the
registers are at a known state when enabling a channel and clean up
properly in case of an error.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-06 03:55:08 +02:00
Hans-Christian Egtvedt
d54bb9f0c5 ALSA: snd-atmel-ac97c: remove dead break statements after return in switch case
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-06 03:54:56 +02:00
Hans-Christian Egtvedt
8321fc0113 ALSA: snd-atmel-ac97c: cleanup register definitions
This patch will remove traces of channel B registers, since they are not
used by the AC97C driver. Channel B might be used for other purposes.

The driver also adds channel status bits TXEMPTY and OVRUN and a
AC97C_CH_MASK macro to ease clearing a channel settings.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-06 03:54:48 +02:00
Hans-Christian Egtvedt
4ede028f87 ALSA: Add ALSA driver for Atmel AC97 controller
This patch adds ALSA support for the AC97 controller found on Atmel
AVR32 devices.

Tested on ATSTK1006 + ATSTK1000 with a development board with a AC97
codec.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-05 15:08:51 +01:00
Hans-Christian Egtvedt
e4967d6016 ALSA: Add ALSA driver for Atmel Audio Bitstream DAC
This patch adds ALSA support for the Audio Bistream DAC found on Atmel
AVR32 devices. The ABDAC is an Atmel IP which might show up on AT91
devices in the future, hence making a generic driver which can be
utilized by AT91 arch if needed.

Datasheet describing the ABDAC peripheral is available in the AT32AP7000
datasheet, http://www.atmel.com/dyn/products/datasheets.asp?family_id=682

Tested on ATSTK1006 + ATSTK1000 with a class D amplifier stage.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-05 15:08:48 +01:00