summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/arizona/pdata.h9
-rw-r--r--include/linux/regmap.h28
-rw-r--r--include/sound/cs4271.h15
-rwxr-xr-xinclude/sound/max98090.h29
-rw-r--r--include/sound/saif.h16
-rw-r--r--include/sound/sh_fsi.h70
-rw-r--r--include/sound/simple_card.h12
-rw-r--r--include/sound/soc-dai.h8
-rw-r--r--include/sound/soc.h6
-rw-r--r--include/sound/tlv320aic3x.h10
-rw-r--r--include/sound/wm2000.h3
-rw-r--r--include/sound/wm2200.h22
12 files changed, 131 insertions, 97 deletions
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index 8b1d1daaae16..ec3e2a2a6d77 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -62,6 +62,8 @@
#define ARIZONA_MAX_OUTPUT 6
+#define ARIZONA_MAX_AIF 3
+
#define ARIZONA_HAP_ACT_ERM 0
#define ARIZONA_HAP_ACT_LRA 2
@@ -96,6 +98,13 @@ struct arizona_pdata {
/** Pin state for GPIO pins */
int gpio_defaults[ARIZONA_MAX_GPIO];
+ /**
+ * Maximum number of channels clocks will be generated for,
+ * useful for systems where and I2S bus with multiple data
+ * lines is mastered.
+ */
+ int max_channels_clocked[ARIZONA_MAX_AIF];
+
/** GPIO for mic detection polarity */
int micd_pol_gpio;
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index b7e95bf942c9..f9b7fbe35ab1 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -235,14 +235,21 @@ struct regmap_range_cfg {
unsigned int window_len;
};
+struct regmap_async;
+
typedef int (*regmap_hw_write)(void *context, const void *data,
size_t count);
typedef int (*regmap_hw_gather_write)(void *context,
const void *reg, size_t reg_len,
const void *val, size_t val_len);
+typedef int (*regmap_hw_async_write)(void *context,
+ const void *reg, size_t reg_len,
+ const void *val, size_t val_len,
+ struct regmap_async *async);
typedef int (*regmap_hw_read)(void *context,
const void *reg_buf, size_t reg_size,
void *val_buf, size_t val_size);
+typedef struct regmap_async *(*regmap_hw_async_alloc)(void);
typedef void (*regmap_hw_free_context)(void *context);
/**
@@ -255,8 +262,11 @@ typedef void (*regmap_hw_free_context)(void *context);
* @write: Write operation.
* @gather_write: Write operation with split register/value, return -ENOTSUPP
* if not implemented on a given device.
+ * @async_write: Write operation which completes asynchronously, optional and
+ * must serialise with respect to non-async I/O.
* @read: Read operation. Data is returned in the buffer used to transmit
* data.
+ * @async_alloc: Allocate a regmap_async() structure.
* @read_flag_mask: Mask to be set in the top byte of the register when doing
* a read.
* @reg_format_endian_default: Default endianness for formatted register
@@ -265,13 +275,16 @@ typedef void (*regmap_hw_free_context)(void *context);
* @val_format_endian_default: Default endianness for formatted register
* values. Used when the regmap_config specifies DEFAULT. If this is
* DEFAULT, BIG is assumed.
+ * @async_size: Size of struct used for async work.
*/
struct regmap_bus {
bool fast_io;
regmap_hw_write write;
regmap_hw_gather_write gather_write;
+ regmap_hw_async_write async_write;
regmap_hw_read read;
regmap_hw_free_context free_context;
+ regmap_hw_async_alloc async_alloc;
u8 read_flag_mask;
enum regmap_endian reg_format_endian_default;
enum regmap_endian val_format_endian_default;
@@ -310,6 +323,8 @@ int regmap_raw_write(struct regmap *map, unsigned int reg,
const void *val, size_t val_len);
int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val,
size_t val_count);
+int regmap_raw_write_async(struct regmap *map, unsigned int reg,
+ const void *val, size_t val_len);
int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val);
int regmap_raw_read(struct regmap *map, unsigned int reg,
void *val, size_t val_len);
@@ -321,6 +336,7 @@ int regmap_update_bits_check(struct regmap *map, unsigned int reg,
unsigned int mask, unsigned int val,
bool *change);
int regmap_get_val_bytes(struct regmap *map);
+int regmap_async_complete(struct regmap *map);
int regcache_sync(struct regmap *map);
int regcache_sync_region(struct regmap *map, unsigned int min,
@@ -422,6 +438,13 @@ static inline int regmap_raw_write(struct regmap *map, unsigned int reg,
return -EINVAL;
}
+static inline int regmap_raw_write_async(struct regmap *map, unsigned int reg,
+ const void *val, size_t val_len)
+{
+ WARN_ONCE(1, "regmap API is disabled");
+ return -EINVAL;
+}
+
static inline int regmap_bulk_write(struct regmap *map, unsigned int reg,
const void *val, size_t val_count)
{
@@ -500,6 +523,11 @@ static inline void regcache_mark_dirty(struct regmap *map)
WARN_ONCE(1, "regmap API is disabled");
}
+static inline void regmap_async_complete(struct regmap *map)
+{
+ WARN_ONCE(1, "regmap API is disabled");
+}
+
static inline int regmap_register_patch(struct regmap *map,
const struct reg_default *regs,
int num_regs)
diff --git a/include/sound/cs4271.h b/include/sound/cs4271.h
index dd8c48d14ed9..70f45355acaa 100644
--- a/include/sound/cs4271.h
+++ b/include/sound/cs4271.h
@@ -20,6 +20,21 @@
struct cs4271_platform_data {
int gpio_nreset; /* GPIO driving Reset pin, if any */
bool amutec_eq_bmutec; /* flag to enable AMUTEC=BMUTEC */
+
+ /*
+ * The CS4271 requires its LRCLK and MCLK to be stable before its RESET
+ * line is de-asserted. That also means that clocks cannot be changed
+ * without putting the chip back into hardware reset, which also requires
+ * a complete re-initialization of all registers.
+ *
+ * One (undocumented) workaround is to assert and de-assert the PDN bit
+ * in the MODE2 register. This workaround can be enabled with the
+ * following flag.
+ *
+ * Note that this is not needed in case the clocks are stable
+ * throughout the entire runtime of the codec.
+ */
+ bool enable_soft_reset;
};
#endif /* __CS4271_H */
diff --git a/include/sound/max98090.h b/include/sound/max98090.h
new file mode 100755
index 000000000000..95efb13f8478
--- /dev/null
+++ b/include/sound/max98090.h
@@ -0,0 +1,29 @@
+/*
+ * Platform data for MAX98090
+ *
+ * Copyright 2011-2012 Maxim Integrated Products
+ *
+ * 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.
+ *
+ */
+
+#ifndef __SOUND_MAX98090_PDATA_H__
+#define __SOUND_MAX98090_PDATA_H__
+
+/* codec platform data */
+struct max98090_pdata {
+
+ /* Analog/digital microphone configuration:
+ * 0 = analog microphone input (normal setting)
+ * 1 = digital microphone input
+ */
+ unsigned int digmic_left_mode:1;
+ unsigned int digmic_right_mode:1;
+ unsigned int digmic_3_mode:1;
+ unsigned int digmic_4_mode:1;
+};
+
+#endif
diff --git a/include/sound/saif.h b/include/sound/saif.h
deleted file mode 100644
index f22f3e16edf4..000000000000
--- a/include/sound/saif.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * 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 __SOUND_SAIF_H__
-#define __SOUND_SAIF_H__
-
-struct mxs_saif_platform_data {
- bool master_mode; /* if true use master mode */
- int master_id; /* id of the master if in slave mode */
-};
-#endif
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h
index cc1c919c6436..7a9710b4b799 100644
--- a/include/sound/sh_fsi.h
+++ b/include/sound/sh_fsi.h
@@ -11,82 +11,20 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
-
-#define FSI_PORT_A 0
-#define FSI_PORT_B 1
-
#include <linux/clk.h>
#include <sound/soc.h>
/*
- * flags format
- *
- * 0x00000CBA
- *
- * A: inversion
- * B: format mode
- * C: chip specific
- * D: clock selecter if master mode
+ * flags
*/
-
-/* A: clock inversion */
-#define SH_FSI_INVERSION_MASK 0x0000000F
-#define SH_FSI_LRM_INV (1 << 0)
-#define SH_FSI_BRM_INV (1 << 1)
-#define SH_FSI_LRS_INV (1 << 2)
-#define SH_FSI_BRS_INV (1 << 3)
-
-/* B: format mode */
-#define SH_FSI_FMT_MASK 0x000000F0
-#define SH_FSI_FMT_DAI (0 << 4)
-#define SH_FSI_FMT_SPDIF (1 << 4)
-
-/* C: chip specific */
-#define SH_FSI_OPTION_MASK 0x00000F00
-#define SH_FSI_ENABLE_STREAM_MODE (1 << 8) /* for 16bit data */
-
-/* D: clock selecter if master mode */
-#define SH_FSI_CLK_MASK 0x0000F000
-#define SH_FSI_CLK_EXTERNAL (0 << 12)
-#define SH_FSI_CLK_CPG (1 << 12) /* FSIxCK + FSI-DIV */
-
-/*
- * set_rate return value
- *
- * see ACKMD/BPFMD on
- * ACK_MD (FSI2)
- * CKG1 (FSI)
- *
- * err : return value < 0
- * no change : return value == 0
- * change xMD : return value > 0
- *
- * 0x-00000AB
- *
- * A: ACKMD value
- * B: BPFMD value
- */
-
-#define SH_FSI_ACKMD_MASK (0xF << 0)
-#define SH_FSI_ACKMD_512 (1 << 0)
-#define SH_FSI_ACKMD_256 (2 << 0)
-#define SH_FSI_ACKMD_128 (3 << 0)
-#define SH_FSI_ACKMD_64 (4 << 0)
-#define SH_FSI_ACKMD_32 (5 << 0)
-
-#define SH_FSI_BPFMD_MASK (0xF << 4)
-#define SH_FSI_BPFMD_512 (1 << 4)
-#define SH_FSI_BPFMD_256 (2 << 4)
-#define SH_FSI_BPFMD_128 (3 << 4)
-#define SH_FSI_BPFMD_64 (4 << 4)
-#define SH_FSI_BPFMD_32 (5 << 4)
-#define SH_FSI_BPFMD_16 (6 << 4)
+#define SH_FSI_FMT_SPDIF (1 << 0) /* spdif for HDMI */
+#define SH_FSI_ENABLE_STREAM_MODE (1 << 1) /* for 16bit data */
+#define SH_FSI_CLK_CPG (1 << 2) /* FSIxCK + FSI-DIV */
struct sh_fsi_port_info {
unsigned long flags;
int tx_id;
int rx_id;
- int (*set_rate)(struct device *dev, int rate, int enable);
};
struct sh_fsi_platform_info {
diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h
index 4b62b8dc6a4f..6c74527d4926 100644
--- a/include/sound/simple_card.h
+++ b/include/sound/simple_card.h
@@ -14,21 +14,21 @@
#include <sound/soc.h>
-struct asoc_simple_dai_init_info {
+struct asoc_simple_dai {
+ const char *name;
unsigned int fmt;
- unsigned int cpu_daifmt;
- unsigned int codec_daifmt;
unsigned int sysclk;
};
struct asoc_simple_card_info {
const char *name;
const char *card;
- const char *cpu_dai;
const char *codec;
const char *platform;
- const char *codec_dai;
- struct asoc_simple_dai_init_info *init; /* for snd_link.init */
+
+ unsigned int daifmt;
+ struct asoc_simple_dai cpu_dai;
+ struct asoc_simple_dai codec_dai;
/* used in simple-card.c */
struct snd_soc_dai_link snd_link;
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 3953cea0ecfb..3d84808952b9 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -45,7 +45,7 @@ struct snd_compr_stream;
* sending or receiving PCM data in a frame. This can be used to save power.
*/
#define SND_SOC_DAIFMT_CONT (1 << 4) /* continuous clock */
-#define SND_SOC_DAIFMT_GATED (2 << 4) /* clock is gated */
+#define SND_SOC_DAIFMT_GATED (0 << 4) /* clock is gated */
/*
* DAI hardware signal inversions.
@@ -53,7 +53,7 @@ struct snd_compr_stream;
* Specifies whether the DAI can also support inverted clocks for the specified
* format.
*/
-#define SND_SOC_DAIFMT_NB_NF (1 << 8) /* normal bit clock + frame */
+#define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */
#define SND_SOC_DAIFMT_NB_IF (2 << 8) /* normal BCLK + inv FRM */
#define SND_SOC_DAIFMT_IB_NF (3 << 8) /* invert BCLK + nor FRM */
#define SND_SOC_DAIFMT_IB_IF (4 << 8) /* invert BCLK + FRM */
@@ -126,7 +126,8 @@ int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai,
int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);
/* Digital Audio Interface mute */
-int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute);
+int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute,
+ int direction);
struct snd_soc_dai_ops {
/*
@@ -157,6 +158,7 @@ struct snd_soc_dai_ops {
* Called by soc-core to minimise any pops.
*/
int (*digital_mute)(struct snd_soc_dai *dai, int mute);
+ int (*mute_stream)(struct snd_soc_dai *dai, int mute, int stream);
/*
* ALSA PCM audio operations - all optional.
diff --git a/include/sound/soc.h b/include/sound/soc.h
index bc56738cb109..a6a059ca3874 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -906,8 +906,8 @@ struct snd_soc_dai_link {
struct snd_pcm_hw_params *params);
/* machine stream operations */
- struct snd_soc_ops *ops;
- struct snd_soc_compr_ops *compr_ops;
+ const struct snd_soc_ops *ops;
+ const struct snd_soc_compr_ops *compr_ops;
};
struct snd_soc_codec_conf {
@@ -1171,6 +1171,8 @@ int snd_soc_of_parse_card_name(struct snd_soc_card *card,
const char *propname);
int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
const char *propname);
+unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
+ const char *prefix);
#include <sound/soc-dai.h>
diff --git a/include/sound/tlv320aic3x.h b/include/sound/tlv320aic3x.h
index ffd9bc793105..9407fd00363b 100644
--- a/include/sound/tlv320aic3x.h
+++ b/include/sound/tlv320aic3x.h
@@ -46,6 +46,13 @@ enum {
AIC3X_GPIO2_FUNC_BUTTON_PRESS_IRQ = 15
};
+enum aic3x_micbias_voltage {
+ AIC3X_MICBIAS_OFF = 0,
+ AIC3X_MICBIAS_2_0V = 1,
+ AIC3X_MICBIAS_2_5V = 2,
+ AIC3X_MICBIAS_AVDDV = 3,
+};
+
struct aic3x_setup_data {
unsigned int gpio_func[2];
};
@@ -53,6 +60,9 @@ struct aic3x_setup_data {
struct aic3x_pdata {
int gpio_reset; /* < 0 if not used */
struct aic3x_setup_data *setup;
+
+ /* Selects the micbias voltage */
+ enum aic3x_micbias_voltage micbias_vg;
};
#endif
diff --git a/include/sound/wm2000.h b/include/sound/wm2000.h
index aa388ca9ec64..4de81f41c90f 100644
--- a/include/sound/wm2000.h
+++ b/include/sound/wm2000.h
@@ -15,9 +15,6 @@ struct wm2000_platform_data {
/** Filename for system-specific image to download to device. */
const char *download_file;
- /** Divide MCLK by 2 for system clock? */
- unsigned int mclkdiv2:1;
-
/** Disable speech clarity enhancement, for use when an
* external algorithm is used. */
unsigned int speech_enh_disable:1;
diff --git a/include/sound/wm2200.h b/include/sound/wm2200.h
index 79bf55be7ffa..bc7ab1a4b480 100644
--- a/include/sound/wm2200.h
+++ b/include/sound/wm2200.h
@@ -12,6 +12,7 @@
#define __LINUX_SND_WM2200_H
#define WM2200_GPIO_SET 0x10000
+#define WM2200_MAX_MICBIAS 2
enum wm2200_in_mode {
WM2200_IN_SE = 0,
@@ -25,6 +26,24 @@ enum wm2200_dmic_sup {
WM2200_DMIC_SUP_MICBIAS2 = 2,
};
+enum wm2200_mbias_lvl {
+ WM2200_MBIAS_LVL_1V5 = 1,
+ WM2200_MBIAS_LVL_1V8 = 2,
+ WM2200_MBIAS_LVL_1V9 = 3,
+ WM2200_MBIAS_LVL_2V0 = 4,
+ WM2200_MBIAS_LVL_2V2 = 5,
+ WM2200_MBIAS_LVL_2V4 = 6,
+ WM2200_MBIAS_LVL_2V5 = 7,
+ WM2200_MBIAS_LVL_2V6 = 8,
+};
+
+struct wm2200_micbias {
+ enum wm2200_mbias_lvl mb_lvl; /** Regulated voltage */
+ unsigned int discharge:1; /** Actively discharge */
+ unsigned int fast_start:1; /** Enable aggressive startup ramp rate */
+ unsigned int bypass:1; /** Use bypass mode */
+};
+
struct wm2200_pdata {
int reset; /** GPIO controlling /RESET, if any */
int ldo_ena; /** GPIO controlling LODENA, if any */
@@ -35,7 +54,8 @@ struct wm2200_pdata {
enum wm2200_in_mode in_mode[3];
enum wm2200_dmic_sup dmic_sup[3];
- int micbias_cfg[2]; /** Register value to configure MICBIAS */
+ /** MICBIAS configurations */
+ struct wm2200_micbias micbias[WM2200_MAX_MICBIAS];
};
#endif