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
f950aa96
Commit
f950aa96
authored
Sep 23, 2015
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/rt5645' into asoc-next
parents
ed14ee0e
de3f8fdf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
3 deletions
+40
-3
include/sound/rt5645.h
include/sound/rt5645.h
+2
-0
sound/soc/codecs/rt5645.c
sound/soc/codecs/rt5645.c
+34
-1
sound/soc/codecs/rt5645.h
sound/soc/codecs/rt5645.h
+4
-2
No files found.
include/sound/rt5645.h
View file @
f950aa96
...
@@ -21,6 +21,8 @@ struct rt5645_platform_data {
...
@@ -21,6 +21,8 @@ struct rt5645_platform_data {
/* 0 = IN2P; 1 = GPIO6; 2 = GPIO10; 3 = GPIO12 */
/* 0 = IN2P; 1 = GPIO6; 2 = GPIO10; 3 = GPIO12 */
unsigned
int
jd_mode
;
unsigned
int
jd_mode
;
/* Invert JD when jack insert */
bool
jd_invert
;
};
};
#endif
#endif
sound/soc/codecs/rt5645.c
View file @
f950aa96
...
@@ -2829,6 +2829,9 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert)
...
@@ -2829,6 +2829,9 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert)
snd_soc_dapm_sync
(
dapm
);
snd_soc_dapm_sync
(
dapm
);
rt5645
->
jack_type
=
SND_JACK_HEADPHONE
;
rt5645
->
jack_type
=
SND_JACK_HEADPHONE
;
}
}
if
(
rt5645
->
pdata
.
jd_invert
)
regmap_update_bits
(
rt5645
->
regmap
,
RT5645_IRQ_CTRL2
,
RT5645_JD_1_1_MASK
,
RT5645_JD_1_1_INV
);
}
else
{
/* jack out */
}
else
{
/* jack out */
rt5645
->
jack_type
=
0
;
rt5645
->
jack_type
=
0
;
...
@@ -2847,6 +2850,9 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert)
...
@@ -2847,6 +2850,9 @@ static int rt5645_jack_detect(struct snd_soc_codec *codec, int jack_insert)
snd_soc_dapm_disable_pin
(
dapm
,
"LDO2"
);
snd_soc_dapm_disable_pin
(
dapm
,
"LDO2"
);
snd_soc_dapm_disable_pin
(
dapm
,
"Mic Det Power"
);
snd_soc_dapm_disable_pin
(
dapm
,
"Mic Det Power"
);
snd_soc_dapm_sync
(
dapm
);
snd_soc_dapm_sync
(
dapm
);
if
(
rt5645
->
pdata
.
jd_invert
)
regmap_update_bits
(
rt5645
->
regmap
,
RT5645_IRQ_CTRL2
,
RT5645_JD_1_1_MASK
,
RT5645_JD_1_1_NOR
);
}
}
return
rt5645
->
jack_type
;
return
rt5645
->
jack_type
;
...
@@ -3212,6 +3218,32 @@ static const struct dmi_system_id dmi_platform_intel_braswell[] = {
...
@@ -3212,6 +3218,32 @@ static const struct dmi_system_id dmi_platform_intel_braswell[] = {
{
}
{
}
};
};
static
struct
rt5645_platform_data
buddy_platform_data
=
{
.
dmic1_data_pin
=
RT5645_DMIC_DATA_GPIO5
,
.
dmic2_data_pin
=
RT5645_DMIC_DATA_IN2P
,
.
jd_mode
=
3
,
.
jd_invert
=
true
,
};
static
int
buddy_quirk_cb
(
const
struct
dmi_system_id
*
id
)
{
rt5645_pdata
=
&
buddy_platform_data
;
return
1
;
}
static
struct
dmi_system_id
dmi_platform_intel_broadwell
[]
__initdata
=
{
{
.
ident
=
"Chrome Buddy"
,
.
callback
=
buddy_quirk_cb
,
.
matches
=
{
DMI_MATCH
(
DMI_PRODUCT_NAME
,
"Buddy"
),
},
},
{
}
};
static
int
rt5645_parse_dt
(
struct
rt5645_priv
*
rt5645
,
struct
device
*
dev
)
static
int
rt5645_parse_dt
(
struct
rt5645_priv
*
rt5645
,
struct
device
*
dev
)
{
{
rt5645
->
pdata
.
in2_diff
=
device_property_read_bool
(
dev
,
rt5645
->
pdata
.
in2_diff
=
device_property_read_bool
(
dev
,
...
@@ -3244,7 +3276,8 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
...
@@ -3244,7 +3276,8 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
if
(
pdata
)
if
(
pdata
)
rt5645
->
pdata
=
*
pdata
;
rt5645
->
pdata
=
*
pdata
;
else
if
(
dmi_check_system
(
dmi_platform_intel_braswell
))
else
if
(
dmi_check_system
(
dmi_platform_intel_braswell
)
||
dmi_check_system
(
dmi_platform_intel_broadwell
))
rt5645
->
pdata
=
*
rt5645_pdata
;
rt5645
->
pdata
=
*
rt5645_pdata
;
else
else
rt5645_parse_dt
(
rt5645
,
&
i2c
->
dev
);
rt5645_parse_dt
(
rt5645
,
&
i2c
->
dev
);
...
...
sound/soc/codecs/rt5645.h
View file @
f950aa96
...
@@ -777,8 +777,6 @@
...
@@ -777,8 +777,6 @@
#define RT5645_PWR_CLS_D_R_BIT 9
#define RT5645_PWR_CLS_D_R_BIT 9
#define RT5645_PWR_CLS_D_L (0x1 << 8)
#define RT5645_PWR_CLS_D_L (0x1 << 8)
#define RT5645_PWR_CLS_D_L_BIT 8
#define RT5645_PWR_CLS_D_L_BIT 8
#define RT5645_PWR_ADC_R (0x1 << 1)
#define RT5645_PWR_ADC_R_BIT 1
#define RT5645_PWR_DAC_L2 (0x1 << 7)
#define RT5645_PWR_DAC_L2 (0x1 << 7)
#define RT5645_PWR_DAC_L2_BIT 7
#define RT5645_PWR_DAC_L2_BIT 7
#define RT5645_PWR_DAC_R2 (0x1 << 6)
#define RT5645_PWR_DAC_R2 (0x1 << 6)
...
@@ -1626,6 +1624,10 @@
...
@@ -1626,6 +1624,10 @@
#define RT5645_OT_P_NOR (0x0 << 10)
#define RT5645_OT_P_NOR (0x0 << 10)
#define RT5645_OT_P_INV (0x1 << 10)
#define RT5645_OT_P_INV (0x1 << 10)
#define RT5645_IRQ_JD_1_1_EN (0x1 << 9)
#define RT5645_IRQ_JD_1_1_EN (0x1 << 9)
#define RT5645_JD_1_1_MASK (0x1 << 7)
#define RT5645_JD_1_1_SFT 7
#define RT5645_JD_1_1_NOR (0x0 << 7)
#define RT5645_JD_1_1_INV (0x1 << 7)
/* IRQ Control 2 (0xbe) */
/* IRQ Control 2 (0xbe) */
#define RT5645_IRQ_MB1_OC_MASK (0x1 << 15)
#define RT5645_IRQ_MB1_OC_MASK (0x1 << 15)
...
...
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