Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
8c7df021
Commit
8c7df021
authored
Apr 12, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/max98090' into asoc-next
parents
406554fe
959b6250
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
29 deletions
+16
-29
sound/soc/codecs/max98090.c
sound/soc/codecs/max98090.c
+16
-29
No files found.
sound/soc/codecs/max98090.c
View file @
8c7df021
...
@@ -23,8 +23,6 @@
...
@@ -23,8 +23,6 @@
#include <sound/max98090.h>
#include <sound/max98090.h>
#include "max98090.h"
#include "max98090.h"
#include <linux/version.h>
#define DEBUG
#define DEBUG
#define EXTMIC_METHOD
#define EXTMIC_METHOD
#define EXTMIC_METHOD_TEST
#define EXTMIC_METHOD_TEST
...
@@ -509,16 +507,16 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol,
...
@@ -509,16 +507,16 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol,
return
0
;
return
0
;
}
}
static
const
char
*
max98090_perf_pwr_text
[]
=
static
const
char
*
max98090_perf_pwr_text
[]
=
{
"High Performance"
,
"Low Power"
};
{
"High Performance"
,
"Low Power"
};
static
const
char
*
max98090_pwr_perf_text
[]
=
static
const
char
*
max98090_pwr_perf_text
[]
=
{
"Low Power"
,
"High Performance"
};
{
"Low Power"
,
"High Performance"
};
static
const
struct
soc_enum
max98090_vcmbandgap_enum
=
static
const
struct
soc_enum
max98090_vcmbandgap_enum
=
SOC_ENUM_SINGLE
(
M98090_REG_BIAS_CONTROL
,
M98090_VCM_MODE_SHIFT
,
SOC_ENUM_SINGLE
(
M98090_REG_BIAS_CONTROL
,
M98090_VCM_MODE_SHIFT
,
ARRAY_SIZE
(
max98090_pwr_perf_text
),
max98090_pwr_perf_text
);
ARRAY_SIZE
(
max98090_pwr_perf_text
),
max98090_pwr_perf_text
);
static
const
char
*
max98090_osr128_text
[]
=
{
"64*fs"
,
"128*fs"
};
static
const
char
*
max98090_osr128_text
[]
=
{
"64*fs"
,
"128*fs"
};
static
const
struct
soc_enum
max98090_osr128_enum
=
static
const
struct
soc_enum
max98090_osr128_enum
=
SOC_ENUM_SINGLE
(
M98090_REG_ADC_CONTROL
,
M98090_OSR128_SHIFT
,
SOC_ENUM_SINGLE
(
M98090_REG_ADC_CONTROL
,
M98090_OSR128_SHIFT
,
...
@@ -535,28 +533,28 @@ static const struct soc_enum max98090_filter_dmic34mode_enum =
...
@@ -535,28 +533,28 @@ static const struct soc_enum max98090_filter_dmic34mode_enum =
M98090_FLT_DMIC34MODE_SHIFT
,
M98090_FLT_DMIC34MODE_SHIFT
,
ARRAY_SIZE
(
max98090_mode_text
),
max98090_mode_text
);
ARRAY_SIZE
(
max98090_mode_text
),
max98090_mode_text
);
static
const
char
*
max98090_drcatk_text
[]
=
static
const
char
*
max98090_drcatk_text
[]
=
{
"0.5ms"
,
"1ms"
,
"5ms"
,
"10ms"
,
"25ms"
,
"50ms"
,
"100ms"
,
"200ms"
};
{
"0.5ms"
,
"1ms"
,
"5ms"
,
"10ms"
,
"25ms"
,
"50ms"
,
"100ms"
,
"200ms"
};
static
const
struct
soc_enum
max98090_drcatk_enum
=
static
const
struct
soc_enum
max98090_drcatk_enum
=
SOC_ENUM_SINGLE
(
M98090_REG_DRC_TIMING
,
M98090_DRCATK_SHIFT
,
SOC_ENUM_SINGLE
(
M98090_REG_DRC_TIMING
,
M98090_DRCATK_SHIFT
,
ARRAY_SIZE
(
max98090_drcatk_text
),
max98090_drcatk_text
);
ARRAY_SIZE
(
max98090_drcatk_text
),
max98090_drcatk_text
);
static
const
char
*
max98090_drcrls_text
[]
=
static
const
char
*
max98090_drcrls_text
[]
=
{
"8s"
,
"4s"
,
"2s"
,
"1s"
,
"0.5s"
,
"0.25s"
,
"0.125s"
,
"0.0625s"
};
{
"8s"
,
"4s"
,
"2s"
,
"1s"
,
"0.5s"
,
"0.25s"
,
"0.125s"
,
"0.0625s"
};
static
const
struct
soc_enum
max98090_drcrls_enum
=
static
const
struct
soc_enum
max98090_drcrls_enum
=
SOC_ENUM_SINGLE
(
M98090_REG_DRC_TIMING
,
M98090_DRCRLS_SHIFT
,
SOC_ENUM_SINGLE
(
M98090_REG_DRC_TIMING
,
M98090_DRCRLS_SHIFT
,
ARRAY_SIZE
(
max98090_drcrls_text
),
max98090_drcrls_text
);
ARRAY_SIZE
(
max98090_drcrls_text
),
max98090_drcrls_text
);
static
const
char
*
max98090_alccmp_text
[]
=
static
const
char
*
max98090_alccmp_text
[]
=
{
"1:1"
,
"1:1.5"
,
"1:2"
,
"1:4"
,
"1:INF"
};
{
"1:1"
,
"1:1.5"
,
"1:2"
,
"1:4"
,
"1:INF"
};
static
const
struct
soc_enum
max98090_alccmp_enum
=
static
const
struct
soc_enum
max98090_alccmp_enum
=
SOC_ENUM_SINGLE
(
M98090_REG_DRC_COMPRESSOR
,
M98090_DRCCMP_SHIFT
,
SOC_ENUM_SINGLE
(
M98090_REG_DRC_COMPRESSOR
,
M98090_DRCCMP_SHIFT
,
ARRAY_SIZE
(
max98090_alccmp_text
),
max98090_alccmp_text
);
ARRAY_SIZE
(
max98090_alccmp_text
),
max98090_alccmp_text
);
static
const
char
*
max98090_drcexp_text
[]
=
{
"1:1"
,
"2:1"
,
"3:1"
};
static
const
char
*
max98090_drcexp_text
[]
=
{
"1:1"
,
"2:1"
,
"3:1"
};
static
const
struct
soc_enum
max98090_drcexp_enum
=
static
const
struct
soc_enum
max98090_drcexp_enum
=
SOC_ENUM_SINGLE
(
M98090_REG_DRC_EXPANDER
,
M98090_DRCEXP_SHIFT
,
SOC_ENUM_SINGLE
(
M98090_REG_DRC_EXPANDER
,
M98090_DRCEXP_SHIFT
,
...
@@ -859,7 +857,7 @@ static const struct soc_enum mic2_mux_enum =
...
@@ -859,7 +857,7 @@ static const struct soc_enum mic2_mux_enum =
static
const
struct
snd_kcontrol_new
max98090_mic2_mux
=
static
const
struct
snd_kcontrol_new
max98090_mic2_mux
=
SOC_DAPM_ENUM
(
"MIC2 Mux"
,
mic2_mux_enum
);
SOC_DAPM_ENUM
(
"MIC2 Mux"
,
mic2_mux_enum
);
static
const
char
*
max98090_micpre_text
[]
=
{
"Off"
,
"On"
};
static
const
char
*
max98090_micpre_text
[]
=
{
"Off"
,
"On"
};
static
const
struct
soc_enum
max98090_pa1en_enum
=
static
const
struct
soc_enum
max98090_pa1en_enum
=
SOC_ENUM_SINGLE
(
M98090_REG_MIC1_INPUT_LEVEL
,
M98090_MIC_PA1EN_SHIFT
,
SOC_ENUM_SINGLE
(
M98090_REG_MIC1_INPUT_LEVEL
,
M98090_MIC_PA1EN_SHIFT
,
...
@@ -1703,9 +1701,8 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai,
...
@@ -1703,9 +1701,8 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai,
* seen for the case of TDM mode. The remaining cases have
* seen for the case of TDM mode. The remaining cases have
* normal logic.
* normal logic.
*/
*/
if
(
max98090
->
tdm_slots
>
1
)
{
if
(
max98090
->
tdm_slots
>
1
)
regval
^=
M98090_BCI_MASK
;
regval
^=
M98090_BCI_MASK
;
}
snd_soc_write
(
codec
,
snd_soc_write
(
codec
,
M98090_REG_INTERFACE_FORMAT
,
regval
);
M98090_REG_INTERFACE_FORMAT
,
regval
);
...
@@ -2059,17 +2056,14 @@ static irqreturn_t max98090_interrupt(int irq, void *data)
...
@@ -2059,17 +2056,14 @@ static irqreturn_t max98090_interrupt(int irq, void *data)
if
(
!
active
)
if
(
!
active
)
return
IRQ_NONE
;
return
IRQ_NONE
;
if
(
active
&
M98090_CLD_MASK
)
{
if
(
active
&
M98090_CLD_MASK
)
dev_err
(
codec
->
dev
,
"M98090_CLD_MASK
\n
"
);
dev_err
(
codec
->
dev
,
"M98090_CLD_MASK
\n
"
);
}
if
(
active
&
M98090_SLD_MASK
)
{
if
(
active
&
M98090_SLD_MASK
)
dev_dbg
(
codec
->
dev
,
"M98090_SLD_MASK
\n
"
);
dev_dbg
(
codec
->
dev
,
"M98090_SLD_MASK
\n
"
);
}
if
(
active
&
M98090_ULK_MASK
)
{
if
(
active
&
M98090_ULK_MASK
)
dev_err
(
codec
->
dev
,
"M98090_ULK_MASK
\n
"
);
dev_err
(
codec
->
dev
,
"M98090_ULK_MASK
\n
"
);
}
if
(
active
&
M98090_JDET_MASK
)
{
if
(
active
&
M98090_JDET_MASK
)
{
dev_dbg
(
codec
->
dev
,
"M98090_JDET_MASK
\n
"
);
dev_dbg
(
codec
->
dev
,
"M98090_JDET_MASK
\n
"
);
...
@@ -2080,13 +2074,11 @@ static irqreturn_t max98090_interrupt(int irq, void *data)
...
@@ -2080,13 +2074,11 @@ static irqreturn_t max98090_interrupt(int irq, void *data)
msecs_to_jiffies
(
100
));
msecs_to_jiffies
(
100
));
}
}
if
(
active
&
M98090_DRCACT_MASK
)
{
if
(
active
&
M98090_DRCACT_MASK
)
dev_dbg
(
codec
->
dev
,
"M98090_DRCACT_MASK
\n
"
);
dev_dbg
(
codec
->
dev
,
"M98090_DRCACT_MASK
\n
"
);
}
if
(
active
&
M98090_DRCCLP_MASK
)
{
if
(
active
&
M98090_DRCCLP_MASK
)
dev_err
(
codec
->
dev
,
"M98090_DRCCLP_MASK
\n
"
);
dev_err
(
codec
->
dev
,
"M98090_DRCCLP_MASK
\n
"
);
}
return
IRQ_HANDLED
;
return
IRQ_HANDLED
;
}
}
...
@@ -2324,7 +2316,7 @@ static int max98090_i2c_probe(struct i2c_client *i2c,
...
@@ -2324,7 +2316,7 @@ static int max98090_i2c_probe(struct i2c_client *i2c,
max98090
->
pdata
=
i2c
->
dev
.
platform_data
;
max98090
->
pdata
=
i2c
->
dev
.
platform_data
;
max98090
->
irq
=
i2c
->
irq
;
max98090
->
irq
=
i2c
->
irq
;
max98090
->
regmap
=
regmap_init_i2c
(
i2c
,
&
max98090_regmap
);
max98090
->
regmap
=
devm_
regmap_init_i2c
(
i2c
,
&
max98090_regmap
);
if
(
IS_ERR
(
max98090
->
regmap
))
{
if
(
IS_ERR
(
max98090
->
regmap
))
{
ret
=
PTR_ERR
(
max98090
->
regmap
);
ret
=
PTR_ERR
(
max98090
->
regmap
);
dev_err
(
&
i2c
->
dev
,
"Failed to allocate regmap: %d
\n
"
,
ret
);
dev_err
(
&
i2c
->
dev
,
"Failed to allocate regmap: %d
\n
"
,
ret
);
...
@@ -2334,18 +2326,13 @@ static int max98090_i2c_probe(struct i2c_client *i2c,
...
@@ -2334,18 +2326,13 @@ static int max98090_i2c_probe(struct i2c_client *i2c,
ret
=
snd_soc_register_codec
(
&
i2c
->
dev
,
ret
=
snd_soc_register_codec
(
&
i2c
->
dev
,
&
soc_codec_dev_max98090
,
max98090_dai
,
&
soc_codec_dev_max98090
,
max98090_dai
,
ARRAY_SIZE
(
max98090_dai
));
ARRAY_SIZE
(
max98090_dai
));
if
(
ret
<
0
)
regmap_exit
(
max98090
->
regmap
);
err_enable:
err_enable:
return
ret
;
return
ret
;
}
}
static
int
max98090_i2c_remove
(
struct
i2c_client
*
client
)
static
int
max98090_i2c_remove
(
struct
i2c_client
*
client
)
{
{
struct
max98090_priv
*
max98090
=
dev_get_drvdata
(
&
client
->
dev
);
snd_soc_unregister_codec
(
&
client
->
dev
);
snd_soc_unregister_codec
(
&
client
->
dev
);
regmap_exit
(
max98090
->
regmap
);
return
0
;
return
0
;
}
}
...
@@ -2369,7 +2356,7 @@ static int max98090_runtime_suspend(struct device *dev)
...
@@ -2369,7 +2356,7 @@ static int max98090_runtime_suspend(struct device *dev)
return
0
;
return
0
;
}
}
static
struct
dev_pm_ops
max98090_pm
=
{
static
const
struct
dev_pm_ops
max98090_pm
=
{
SET_RUNTIME_PM_OPS
(
max98090_runtime_suspend
,
SET_RUNTIME_PM_OPS
(
max98090_runtime_suspend
,
max98090_runtime_resume
,
NULL
)
max98090_runtime_resume
,
NULL
)
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment