Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
linux-seco-rk4.4
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
Rockchip
linux-seco-rk4.4
Commits
5578b8c2
Commit
5578b8c2
authored
3 years ago
by
Davide Cardillo
Committed by
Giuseppe Pagano
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[D23] Use amp gpdio shutdown to mute audio
parent
935905cb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
arch/arm64/boot/dts/seco/seco-px30-d23-revc.dtsi
+1
-0
1 addition, 0 deletions
arch/arm64/boot/dts/seco/seco-px30-d23-revc.dtsi
sound/soc/rockchip/rockchip_i2s.c
+27
-0
27 additions, 0 deletions
sound/soc/rockchip/rockchip_i2s.c
with
28 additions
and
0 deletions
arch/arm64/boot/dts/seco/seco-px30-d23-revc.dtsi
+
1
−
0
View file @
5578b8c2
...
...
@@ -843,6 +843,7 @@
&i2s1_2ch {
status = "okay";
#sound-dai-cells = <0>;
gpio-amp-sd = <&gpio_expanderB_u33 14 GPIO_ACTIVE_HIGH>;
};
&uart0 {
...
...
This diff is collapsed.
Click to expand it.
sound/soc/rockchip/rockchip_i2s.c
+
27
−
0
View file @
5578b8c2
...
...
@@ -46,6 +46,8 @@ struct rk_i2s_dev {
struct
reset_control
*
reset_m
;
struct
reset_control
*
reset_h
;
struct
gpio_desc
*
amp_shutdown_gpio
;
/*
* Used to indicate the tx/rx status.
* I2S controller hopes to start the tx and rx together,
...
...
@@ -161,6 +163,14 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)
}
}
spin_unlock
(
&
lock
);
if
(
on
)
{
gpiod_set_value_cansleep
(
i2s
->
amp_shutdown_gpio
,
1
);
printk
(
"--> i2s->tx_start = true;
\n
"
);
}
else
{
gpiod_set_value_cansleep
(
i2s
->
amp_shutdown_gpio
,
0
);
printk
(
"--> i2s->tx_start = false;
\n
"
);
}
}
static
void
rockchip_snd_rxctrl
(
struct
rk_i2s_dev
*
i2s
,
int
on
)
...
...
@@ -618,6 +628,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
struct
snd_soc_dai_driver
*
soc_dai
;
struct
resource
*
res
;
void
__iomem
*
regs
;
int
amp_shutdown
;
int
ret
;
int
val
;
...
...
@@ -725,6 +736,22 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
}
}
amp_shutdown
=
of_get_named_gpio
(
node
,
"gpio-amp-sd"
,
0
);
if
(
!
gpio_is_valid
(
amp_shutdown
))
{
printk
(
"Warn! not using aplifier gpio shutdown
\n
"
);
}
else
{
i2s
->
amp_shutdown_gpio
=
gpio_to_desc
(
amp_shutdown
);
ret
=
devm_gpio_request_one
(
&
pdev
->
dev
,
amp_shutdown
,
GPIOF_OUT_INIT_LOW
,
"amp_shutdown"
);
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"cannot get amp_shutdown gpio
\n
"
);
return
ret
;
}
gpiod_direction_output
(
i2s
->
amp_shutdown_gpio
,
0
);
printk
(
"Using aplifier gpio shutdown GPIO = %d
\n
"
,
amp_shutdown
);
}
regmap_update_bits
(
i2s
->
regmap
,
I2S_CKR
,
I2S_CKR_TRCM_MASK
,
i2s
->
clk_trcm
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment