aboutsummaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorDeepak Karda <deepak.karda@stericsson.com>2010-06-18 17:23:15 +0530
committerJohn Rigby <john.rigby@linaro.org>2010-09-02 22:45:44 -0600
commit8013c3291c6e79f2cc179ede8c2fb2401c5cb06c (patch)
treedaa81d56c407fcfe5ce176882574255948c536c0 /arch/arm
parent58204b24e1f5ff93cb5aa0249a12ded723a71f5a (diff)
downloadlinux-2.6.34-ux500-8013c3291c6e79f2cc179ede8c2fb2401c5cb06c.tar.gz
Audio: FM and BT support, cleanup, power up/down noise removal
Add new transducer for FM to configure audio codec registers. Add new transducer for BT to configure gpio and enable msp0 clk. Fix noise issue at begining and end of playback/voice call. Add platform device and platform driver to suport voltage regulator framework. Remove allmost all of printk and use dev_err, dev_info family macros. Correct file copyright notice. Remove use of typedefs. Add vibrator functionality which uses PWM source. Add function to configure audio codec IF1 required for FM. ST-Ericsson ID: ER 260924 Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Change-Id: Id614b86f464c0c450926a2474d47071a6ac5f905 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/2544 Reviewed-by: Deepak KARDA <deepak.karda@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Diffstat (limited to 'arch/arm')
-rwxr-xr-xarch/arm/mach-ux500/include/mach/ste_audio_io_ioctl.h190
-rwxr-xr-xarch/arm/mach-ux500/include/mach/ste_audio_io_vibrator.h31
-rw-r--r--arch/arm/mach-ux500/include/ste_audio_io_ioctl.h192
3 files changed, 221 insertions, 192 deletions
diff --git a/arch/arm/mach-ux500/include/mach/ste_audio_io_ioctl.h b/arch/arm/mach-ux500/include/mach/ste_audio_io_ioctl.h
new file mode 100755
index 00000000000..fab511975e3
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/ste_audio_io_ioctl.h
@@ -0,0 +1,190 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2010
+ * Author: Deepak KARDA/ deepak.karda@stericsson.com for ST-Ericsson
+ * License terms: GNU General Public License (GPL) version 2.
+ */
+
+#ifndef _AUDIOIO_IOCTL_H_
+#define _AUDIOIO_IOCTL_H_
+
+
+#define AUDIOIO_IOC_MAGIC 'N'
+#define AUDIOIO_READ_REGISTER _IOWR(AUDIOIO_IOC_MAGIC, 1,\
+ struct audioio_data_t)
+#define AUDIOIO_WRITE_REGISTER _IOW(AUDIOIO_IOC_MAGIC, 2,\
+ struct audioio_data_t)
+#define AUDIOIO_PWR_CTRL_TRNSDR _IOW(AUDIOIO_IOC_MAGIC, 3,\
+ struct audioio_pwr_ctrl_t)
+#define AUDIOIO_PWR_STS_TRNSDR _IOR(AUDIOIO_IOC_MAGIC, 4,\
+ struct audioio_pwr_ctrl_t)
+#define AUDIOIO_LOOP_CTRL _IOW(AUDIOIO_IOC_MAGIC, 5,\
+ struct audioio_loop_ctrl_t)
+#define AUDIOIO_LOOP_STS _IOR(AUDIOIO_IOC_MAGIC, 6,\
+ struct audioio_loop_ctrl_t)
+#define AUDIOIO_GET_TRNSDR_GAIN_CAPABILITY _IOR(AUDIOIO_IOC_MAGIC, 7,\
+ struct audioio_get_gain_t)
+#define AUDIOIO_GAIN_CAP_LOOP _IOR(AUDIOIO_IOC_MAGIC, 8,\
+ struct audioio_gain_loop_t)
+#define AUDIOIO_SUPPORT_LOOP _IOR(AUDIOIO_IOC_MAGIC, 9,\
+ struct audioio_support_loop_t)
+#define AUDIOIO_GAIN_DESC_TRNSDR _IOR(AUDIOIO_IOC_MAGIC, 10,\
+ struct audioio_gain_desc_trnsdr_t)
+#define AUDIOIO_GAIN_CTRL_TRNSDR _IOW(AUDIOIO_IOC_MAGIC, 11,\
+ struct audioio_gain_ctrl_trnsdr_t)
+#define AUDIOIO_GAIN_QUERY_TRNSDR _IOR(AUDIOIO_IOC_MAGIC, 12,\
+ struct audioio_gain_ctrl_trnsdr_t)
+#define AUDIOIO_MUTE_CTRL_TRNSDR _IOW(AUDIOIO_IOC_MAGIC, 13,\
+ struct audioio_mute_trnsdr_t)
+#define AUDIOIO_MUTE_STS_TRNSDR _IOR(AUDIOIO_IOC_MAGIC, 14,\
+ struct audioio_mute_trnsdr_t)
+#define AUDIOIO_FADE_CTRL _IOW(AUDIOIO_IOC_MAGIC, 15,\
+ struct audioio_fade_ctrl_t)
+#define AUDIOIO_BURST_CTRL _IOW(AUDIOIO_IOC_MAGIC, 16,\
+ struct audioio_burst_ctrl_t)
+#define AUDIOIO_READ_ALL_ACODEC_REGS_CTRL _IOW(AUDIOIO_IOC_MAGIC, 17,\
+ struct audioio_read_all_acodec_reg_ctrl_t)
+#define AUDIOIO_FSBITCLK_CTRL _IOW(AUDIOIO_IOC_MAGIC, 18,\
+ struct audioio_fsbitclk_ctrl_t)
+#define AUDIOIO_PSEUDOBURST_CTRL _IOW(AUDIOIO_IOC_MAGIC, 19,\
+ struct audioio_pseudoburst_ctrl_t)
+#define AUDIOIO_AUDIOCODEC_PWR_CTRL _IOW(AUDIOIO_IOC_MAGIC, 20, \
+ struct audioio_acodec_pwr_ctrl_t)
+/* audio codec channel ids */
+#define EAR_CH 0
+#define HS_CH 1
+#define IHF_CH 2
+#define VIBL_CH 3
+#define VIBR_CH 4
+#define MIC1A_CH 5
+#define MIC1B_CH 6
+#define MIC2_CH 7
+#define LIN_CH 8
+#define DMIC12_CH 9
+#define DMIC34_CH 10
+#define DMIC56_CH 11
+#define MULTI_MIC_CH 12
+#define FMRX_CH 13
+#define FMTX_CH 14
+#define BLUETOOTH_CH 15
+
+#define MAX_NO_TRANSDUCERS 16
+
+#define AUDIOIO_TRUE 1
+#define AUDIOIO_FALSE 0
+
+enum AUDIOIO_COMMON_SWITCH {
+ AUDIOIO_COMMON_OFF = 0,
+ AUDIOIO_COMMON_ON,
+ AUDIOIO_COMMON_ALLCHANNEL_UNSUPPORTED = 0xFFFF
+};
+
+enum AUDIOIO_HAL_HW_LOOPS {
+ AUDIOIO_NOLOOP = 0,
+ AUDIOIO_SIDETONE_LOOP = 0xFFFF
+};
+
+
+enum AUDIOIO_FADE_PERIOD {
+ e_FADE_00,
+ e_FADE_01,
+ e_FADE_10,
+ e_FADE_11
+};
+
+enum AUDIOIO_CH_INDEX {
+ e_CHANNEL_1 = 0x01,
+ e_CHANNEL_2 = 0x02,
+ e_CHANNEL_3 = 0x04,
+ e_CHANNEL_4 = 0x08,
+ e_CHANNEL_ALL = 0x0f
+};
+
+struct audioio_data_t {
+ unsigned char block;
+ unsigned char addr;
+ unsigned char data;
+};
+
+struct audioio_pwr_ctrl_t {
+ enum AUDIOIO_COMMON_SWITCH ctrl_switch;
+ int channel_type;
+ enum AUDIOIO_CH_INDEX channel_index;
+};
+
+struct audioio_acodec_pwr_ctrl_t {
+ enum AUDIOIO_COMMON_SWITCH ctrl_switch;
+};
+
+struct audioio_loop_ctrl_t {
+ enum AUDIOIO_HAL_HW_LOOPS hw_loop;
+ enum AUDIOIO_COMMON_SWITCH ctrl_switch;
+ int channel_type;
+ enum AUDIOIO_CH_INDEX channel_index;
+};
+
+struct audioio_get_gain_t {
+ unsigned int num_channels;
+ unsigned short max_num_gain;
+};
+
+struct audioio_gain_loop_t {
+ unsigned short num_loop;
+ unsigned short max_gains;
+};
+
+struct audioio_support_loop_t {
+ unsigned short spprtd_loop_index;
+};
+
+struct audioio_gain_desc_trnsdr_t {
+ enum AUDIOIO_CH_INDEX channel_index;
+ int channel_type;
+ unsigned short gain_index;
+ int min_gain;
+ int max_gain;
+ unsigned int gain_step;
+};
+
+struct audioio_gain_ctrl_trnsdr_t {
+ enum AUDIOIO_CH_INDEX channel_index;
+ int channel_type;
+ unsigned short gain_index;
+ int gain_value;
+ unsigned int linear;
+};
+
+struct audioio_mute_trnsdr_t {
+ int channel_type;
+ enum AUDIOIO_CH_INDEX channel_index;
+ enum AUDIOIO_COMMON_SWITCH ctrl_switch;
+};
+
+struct audioio_fade_ctrl_t {
+ enum AUDIOIO_COMMON_SWITCH ctrl_switch;
+ enum AUDIOIO_FADE_PERIOD fade_period;
+ int channel_type;
+ enum AUDIOIO_CH_INDEX channel_index;
+};
+
+struct audioio_burst_ctrl_t {
+ enum AUDIOIO_COMMON_SWITCH ctrl_switch;
+ int channel_type;
+ int burst_fifo_interrupt_sample_count;
+ int burst_fifo_length;/* BFIFOTx */
+ int burst_fifo_switch_frame;
+ int burst_fifo_sample_number;
+};
+
+struct audioio_read_all_acodec_reg_ctrl_t {
+ unsigned char data[200];
+};
+
+struct audioio_fsbitclk_ctrl_t {
+ enum AUDIOIO_COMMON_SWITCH ctrl_switch;
+};
+
+struct audioio_pseudoburst_ctrl_t {
+ enum AUDIOIO_COMMON_SWITCH ctrl_switch;
+};
+
+#endif
diff --git a/arch/arm/mach-ux500/include/mach/ste_audio_io_vibrator.h b/arch/arm/mach-ux500/include/mach/ste_audio_io_vibrator.h
new file mode 100755
index 00000000000..7af7e5fa8e9
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/ste_audio_io_vibrator.h
@@ -0,0 +1,31 @@
+/*
+* Overview:
+* Header File defining vibrator kernel space interface
+*
+* Copyright (C) 2010 ST Ericsson
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2 as
+* published by the Free Software Foundation.
+*/
+
+#ifndef _STE_AUDIO_IO_VIBRATOR_H_
+#define _STE_AUDIO_IO_VIBRATOR_H_
+
+/* Client definitions which can use vibrator, defined as bitmask */
+#define STE_AUDIOIO_CLIENT_AUDIO_L 1
+#define STE_AUDIOIO_CLIENT_AUDIO_R 2
+#define STE_AUDIOIO_CLIENT_FF_VIBRA 4
+#define STE_AUDIOIO_CLIENT_TIMED_VIBRA 8
+
+/*
+ * Define vibrator's maximum speed allowed
+ * Duty cycle supported by vibrator's PWM is 0-100
+ */
+#define STE_AUDIOIO_VIBRATOR_MAX_SPEED 100
+
+/* Vibrator control function - uses PWM source */
+int ste_audioio_vibrator_pwm_control(int client,
+ unsigned char left_speed, unsigned char right_speed);
+
+#endif
diff --git a/arch/arm/mach-ux500/include/ste_audio_io_ioctl.h b/arch/arm/mach-ux500/include/ste_audio_io_ioctl.h
deleted file mode 100644
index 3a1773f6f84..00000000000
--- a/arch/arm/mach-ux500/include/ste_audio_io_ioctl.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
-* Overview:
-* Header File defining IOCTLs for Audio IO interface
-*
-* Copyright (C) 2009 ST Ericsson
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License version 2 as
-* published by the Free Software Foundation.
-*/
-
-
-#ifndef _AUDIOIO_IOCTL_H_
-#define _AUDIOIO_IOCTL_H_
-
-
-#define AUDIOIO_IOC_MAGIC 'N'
-#define AUDIOIO_READ_REGISTER _IOWR(AUDIOIO_IOC_MAGIC, 1,\
- audioio_data_t)
-#define AUDIOIO_WRITE_REGISTER _IOW(AUDIOIO_IOC_MAGIC, 2,\
- audioio_data_t)
-#define AUDIOIO_PWR_CTRL_TRNSDR _IOW(AUDIOIO_IOC_MAGIC, 3,\
- audioio_pwr_ctrl_t)
-#define AUDIOIO_PWR_STS_TRNSDR _IOR(AUDIOIO_IOC_MAGIC, 4,\
- audioio_pwr_ctrl_t)
-#define AUDIOIO_LOOP_CTRL _IOW(AUDIOIO_IOC_MAGIC, 5,\
- audioio_loop_ctrl_t)
-#define AUDIOIO_LOOP_STS _IOR(AUDIOIO_IOC_MAGIC, 6,\
- audioio_loop_ctrl_t)
-#define AUDIOIO_GET_TRNSDR_GAIN_CAPABILITY _IOR(AUDIOIO_IOC_MAGIC, 7,\
- audioio_get_gain_t)
-#define AUDIOIO_GAIN_CAP_LOOP _IOR(AUDIOIO_IOC_MAGIC, 8,\
- audioio_gain_loop_t)
-#define AUDIOIO_SUPPORT_LOOP _IOR(AUDIOIO_IOC_MAGIC, 9,\
- audioio_support_loop_t)
-#define AUDIOIO_GAIN_DESC_TRNSDR _IOR(AUDIOIO_IOC_MAGIC, 10,\
- audioio_gain_desc_trnsdr_t)
-#define AUDIOIO_GAIN_CTRL_TRNSDR _IOW(AUDIOIO_IOC_MAGIC, 11,\
- audioio_gain_ctrl_trnsdr_t)
-#define AUDIOIO_GAIN_QUERY_TRNSDR _IOR(AUDIOIO_IOC_MAGIC, 12,\
- audioio_gain_ctrl_trnsdr_t)
-#define AUDIOIO_MUTE_CTRL_TRNSDR _IOW(AUDIOIO_IOC_MAGIC, 13,\
- audioio_mute_trnsdr_t)
-#define AUDIOIO_MUTE_STS_TRNSDR _IOR(AUDIOIO_IOC_MAGIC, 14,\
- audioio_mute_trnsdr_t)
-#define AUDIOIO_FADE_CTRL _IOW(AUDIOIO_IOC_MAGIC, 15,\
- audioio_fade_ctrl_t)
-#define AUDIOIO_BURST_CTRL _IOW(AUDIOIO_IOC_MAGIC, 16,\
- audioio_burst_ctrl_t)
-#define AUDIOIO_READ_ALL_ACODEC_REGS_CTRL _IOW(AUDIOIO_IOC_MAGIC, 17,\
- audioio_read_all_acodec_reg_ctrl_t)
-
-/* audio codec channel ids */
-#define EAR_CH 0
-#define HS_CH 1
-#define IHF_CH 2
-#define VIBL_CH 3
-#define VIBR_CH 4
-#define MIC1A_CH 5
-#define MIC1B_CH 6
-#define MIC2_CH 7
-#define LIN_CH 8
-#define DMIC12_CH 9
-#define DMIC34_CH 10
-#define DMIC56_CH 11
-#define MULTI_MIC_CH 12
-
-#define MAX_NO_TRANSDUCERS 13
-
-#define AUDIOIO_TRUE 1
-#define AUDIOIO_FALSE 0
-
-/** 16 bit unsigned quantity that is 16 bit word aligned */
-typedef unsigned short uint16;
-
-/** 16 bit signed quantity that is 16 bit word aligned */
-typedef signed short int16;
-
-/** 32 bit unsigned quantity that is 32 bit word aligned */
-typedef unsigned long uint32;
-
-/** signed quantity that is 32 bit word aligned */
-typedef signed long int32;
-
-
-
-typedef enum AUDIOIO_COMMON_SWITCH {
- AUDIOIO_COMMON_OFF = 0,
- AUDIOIO_COMMON_ON,
- AUDIOIO_COMMON_ALLCHANNEL_UNSUPPORTED = 0xFFFF
-} AUDIOIO_COMMON_SWITCH;
-
-
-typedef enum AUDIOIO_HAL_HW_LOOPS {
- AUDIOIO_NOLOOP = 0,
- AUDIOIO_SIDETONE_LOOP = 0xFFFF
-} AUDIOIO_HAL_HW_LOOPS;
-
-
-typedef enum AUDIOIO_FADE_PERIOD {
- e_FADE_00,
- e_FADE_01,
- e_FADE_10,
- e_FADE_11
-}AUDIOIO_FADE_PERIOD;
-
-typedef enum AUDIOIO_CH_INDEX {
- e_CHANNEL_1 = 0x01,
- e_CHANNEL_2 = 0x02,
- e_CHANNEL_3 = 0x04,
- e_CHANNEL_4 = 0x08,
- e_CHANNEL_ALL = 0x0f
-}AUDIOIO_CH_INDEX;
-
-typedef struct __audioio_data {
- unsigned char block;
- unsigned char addr;
- unsigned char data;
-}audioio_data_t;
-
-typedef struct __audioio_pwr_ctrl {
- AUDIOIO_COMMON_SWITCH ctrl_switch;
- int channel_type;
- AUDIOIO_CH_INDEX channel_index;
-}audioio_pwr_ctrl_t;
-
-typedef struct __audioio_loop_ctrl {
- AUDIOIO_HAL_HW_LOOPS hw_loop;
- AUDIOIO_COMMON_SWITCH ctrl_switch;
- int channel_type;
- AUDIOIO_CH_INDEX channel_index;
-}audioio_loop_ctrl_t;
-
-typedef struct __audioio_get_gain {
- uint32 num_channels;
- uint16 max_num_gain;
-}audioio_get_gain_t;
-
-typedef struct __audioio_gain_loop {
- uint16 num_loop;
- uint16 max_gains;
-}audioio_gain_loop_t;
-
-typedef struct __audioio_support_loop {
- uint16 spprtd_loop_index;
-}audioio_support_loop_t;
-
-typedef struct __audioio_gain_desc_trnsdr {
- AUDIOIO_CH_INDEX channel_index;
- int channel_type;
- uint16 gain_index;
- int32 min_gain;
- int32 max_gain;
- uint32 gain_step;
-}audioio_gain_desc_trnsdr_t;
-
-typedef struct __audioio_gain_ctrl_trnsdr {
- AUDIOIO_CH_INDEX channel_index;
- int channel_type;
- uint16 gain_index;
- int32 gain_value;
- uint32 linear;
-}audioio_gain_ctrl_trnsdr_t;
-
-typedef struct __audioio_mute_trnsdr {
- int channel_type;
- AUDIOIO_CH_INDEX channel_index;
- AUDIOIO_COMMON_SWITCH ctrl_switch;
-}audioio_mute_trnsdr_t;
-
-typedef struct __audioio_fade_ctrl {
- AUDIOIO_COMMON_SWITCH ctrl_switch;
- AUDIOIO_FADE_PERIOD fade_period;
- int channel_type;
- AUDIOIO_CH_INDEX channel_index;
-}audioio_fade_ctrl_t;
-
-typedef struct __audioio_burst_ctrl {
- AUDIOIO_COMMON_SWITCH ctrl_switch;
- int channel_type;
- int32 burst_fifo_interrupt_sample_count;
- int32 burst_fifo_length;/*BFIFOTx*/
- int32 burst_fifo_switch_frame;
- int32 burst_fifo_sample_number;
-}audioio_burst_ctrl_t;
-
-typedef struct __audioio_read_all_acodec_reg_ctrl_t {
- unsigned char data[200];
-}audioio_read_all_acodec_reg_ctrl_t;
-
-
-#endif