Skip to content

Commit e6fa29e

Browse files
committed
[BACKPORT]: backport ckkim's Max98090 drivers from 3.8 to 3.4
1 parent 34c51bb commit e6fa29e

File tree

8 files changed

+3828
-1278
lines changed

8 files changed

+3828
-1278
lines changed

arch/arm/mach-exynos/board-odroidxu-audio.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,20 @@
1818

1919
#include "board-odroidxu.h"
2020

21+
#include <sound/max98090.h>
22+
static struct max98090_pdata max98090 = {
23+
.digmic_left_mode = 0,
24+
.digmic_right_mode = 0,
25+
.digmic_3_mode = 0,
26+
.digmic_4_mode = 0,
27+
};
28+
29+
2130
static struct i2c_board_info i2c_devs1[] __initdata = {
2231
{
2332
I2C_BOARD_INFO("max98090", (0x20>>1)),
33+
.platform_data = &max98090,
34+
.irq = IRQ_EINT(0),
2435
},
2536
};
2637

include/sound/max98090.h

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* Platform data for MAX98095
2+
* Platform data for MAX98090
33
*
4-
* Copyright 2011 Maxim Integrated Products
4+
* Copyright 2011-2012 Maxim Integrated Products
55
*
66
* This program is free software; you can redistribute it and/or modify it
77
* under the terms of the GNU General Public License as published by the
@@ -10,45 +10,20 @@
1010
*
1111
*/
1212

13-
#ifndef __SOUND_MAX98095_PDATA_H__
14-
#define __SOUND_MAX98095_PDATA_H__
15-
16-
/* Equalizer filter response configuration */
17-
struct max98095_eq_cfg {
18-
const char *name;
19-
unsigned int rate;
20-
u16 band1[5];
21-
u16 band2[5];
22-
u16 band3[5];
23-
u16 band4[5];
24-
u16 band5[5];
25-
};
26-
27-
/* Biquad filter response configuration */
28-
struct max98095_biquad_cfg {
29-
const char *name;
30-
unsigned int rate;
31-
u16 band1[5];
32-
u16 band2[5];
33-
};
13+
#ifndef __SOUND_MAX98090_PDATA_H__
14+
#define __SOUND_MAX98090_PDATA_H__
3415

3516
/* codec platform data */
36-
struct max98095_pdata {
37-
38-
/* Equalizers for DAI1 and DAI2 */
39-
struct max98095_eq_cfg *eq_cfg;
40-
unsigned int eq_cfgcnt;
41-
42-
/* Biquad filter for DAI1 and DAI2 */
43-
struct max98095_biquad_cfg *bq_cfg;
44-
unsigned int bq_cfgcnt;
17+
struct max98090_pdata {
4518

4619
/* Analog/digital microphone configuration:
4720
* 0 = analog microphone input (normal setting)
4821
* 1 = digital microphone input
4922
*/
5023
unsigned int digmic_left_mode:1;
5124
unsigned int digmic_right_mode:1;
25+
unsigned int digmic_3_mode:1;
26+
unsigned int digmic_4_mode:1;
5227
};
5328

5429
#endif

include/sound/soc.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,36 @@
2727

2828
/*
2929
* Convenience kcontrol builders
30+
*
3031
*/
32+
#define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \
33+
((unsigned long)&(struct soc_mixer_control) \
34+
{.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \
35+
.min = xmin, .max = xmax, .platform_max = xmax, .invert = xinvert})
36+
37+
#define SOC_DOUBLE_R_RANGE_TLV(xname, reg_left, reg_right, xshift, xmin, \
38+
xmax, xinvert, tlv_array) \
39+
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
40+
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
41+
SNDRV_CTL_ELEM_ACCESS_READWRITE,\
42+
.tlv.p = (tlv_array), \
43+
.info = snd_soc_info_volsw_range, \
44+
.get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \
45+
.private_value = SOC_DOUBLE_R_RANGE_VALUE(reg_left, reg_right, \
46+
xshift, xmin, xmax, xinvert) }
47+
48+
#define SOC_SINGLE_RANGE_TLV(xname, xreg, xshift, xmin, xmax, xinvert, tlv_array) \
49+
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
50+
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
51+
SNDRV_CTL_ELEM_ACCESS_READWRITE,\
52+
.tlv.p = (tlv_array), \
53+
.info = snd_soc_info_volsw_range, \
54+
.get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \
55+
.private_value = (unsigned long)&(struct soc_mixer_control) \
56+
{.reg = xreg, .rreg = xreg, .shift = xshift, \
57+
.rshift = xshift, .min = xmin, .max = xmax, \
58+
.platform_max = xmax, .invert = xinvert} }
59+
3160
#define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert) \
3261
((unsigned long)&(struct soc_mixer_control) \
3362
{.reg = xreg, .rreg = xreg, .shift = shift_left, \
@@ -439,6 +468,14 @@ int snd_soc_bytes_get(struct snd_kcontrol *kcontrol,
439468
int snd_soc_bytes_put(struct snd_kcontrol *kcontrol,
440469
struct snd_ctl_elem_value *ucontrol);
441470

471+
int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol,
472+
struct snd_ctl_elem_info *uinfo);
473+
int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol,
474+
struct snd_ctl_elem_value *ucontrol);
475+
int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
476+
struct snd_ctl_elem_value *ucontrol);
477+
478+
442479

443480
/**
444481
* struct snd_soc_reg_access - Describes whether a given register is

sound/soc/codecs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ snd-soc-l3-objs := l3.o
2727
snd-soc-lm4857-objs := lm4857.o
2828
snd-soc-max9768-objs := max9768.o
2929
snd-soc-max98088-objs := max98088.o
30-
snd-soc-max98090-objs := max98090.o max98090_mixer.o
30+
snd-soc-max98090-objs := max98090.o
3131
snd-soc-max98095-objs := max98095.o
3232
snd-soc-max9850-objs := max9850.o
3333
snd-soc-pcm3008-objs := pcm3008.o

0 commit comments

Comments
 (0)