From: Yauhen Kharuzhy <jekhor@gmail.com>
To: alsa-devel@alsa-project.org, Hans de Goede <hdegoede@redhat.com>
Subject: [alsa-devel] Right place for defining ACPI GPIO mapping for codec
Date: Mon, 6 Jan 2020 13:21:16 +0300 [thread overview]
Message-ID: <20200106102116.GA96770@jeknote.loshitsa1.net> (raw)
Hello,
I am working now to get sound working at Lenovo Yoga Book tablet. It is
Intel CherryTrail-based device and has RT5677 sound codec.
The RT5677 codec driver uses two GPIOs to reset and enable the codec,
with names 'realtek,reset' and 'realtek,pow-ldo2'. The ACPI definition lacks a
_DSD section with GPIO name->CRS ID definition, so I need to manually
define this mapping somewhere using existing
devm_acpi_dev_add_driver_gpios() method (various devices has various _CRS
definitions order and content, so this is cannot be placed into
rt5677.c codec driver).
The most obvious place for this is ASoC machine driver for my device, but the
codec driver is binded to the ACPI device and initializes before machine
driver.
Can somebody advice how to define such GPIOs mapping for codec in my
case?
The ACPI definition of sound device is below. Second I2C address
definition is for TS3A277E jack detector. The first GPIO in the _CRS is
codec reset, the second is pow-ldo2.
Device (RTEK)
{
Name (_ADR, Zero) // _ADR: Address
Name (_HID, "10EC5677") // _HID: Hardware ID
Name (_CID, "10EC5677") // _CID: Compatible ID
Name (_DDN, "Realtek IIS Audio Codec") // _DDN: DOS Device Name
Name (_SUB, "17AA7005") // _SUB: Subsystem ID
Name (_UID, One) // _UID: Unique ID
Name (_PR0, Package (0x01) // _PR0: Power Resources for D0
{
CLK3
})
Name (CHAN, Package (0x02)
{
One,
0x0124F800
})
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Name (SBUF, ResourceTemplate ()
{
I2cSerialBusV2 (0x002C, ControllerInitiated, 0x000186A0,
AddressingMode7Bit, "\\_SB.PCI0.I2C1",
0x00, ResourceConsumer, , Exclusive,
)
I2cSerialBusV2 (0x003B, ControllerInitiated, 0x000186A0,
AddressingMode7Bit, "\\_SB.PCI0.I2C1",
0x00, ResourceConsumer, , Exclusive,
)
GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
"\\_SB.GPO3", 0x00, ResourceConsumer, ,
)
{ // Pin list
0x0019
}
GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
"\\_SB.GPO3", 0x00, ResourceConsumer, ,
)
{ // Pin list
0x0012
}
GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
"\\_SB.GPO3", 0x00, ResourceConsumer, ,
)
{ // Pin list
0x0030
}
GpioInt (Edge, ActiveLow, Exclusive, PullNone, 0x0000,
"\\_SB.GPO0", 0x00, ResourceConsumer, ,
)
{ // Pin list
0x005B
}
GpioInt (Edge, ActiveLow, Exclusive, PullNone, 0x0000,
"\\_SB.GPO0", 0x00, ResourceConsumer, ,
)
{ // Pin list
0x004D
}
SpiSerialBusV2 (0x0001, PolarityLow, FourWireMode, 0x08,
ControllerInitiated, 0x003D0900, ClockPolarityHigh,
ClockPhaseSecond, "\\_SB.PCI0.SPI1",
0x00, ResourceConsumer, , Exclusive,
)
})
Return (SBUF) /* \_SB_.PCI0.I2C1.RTEK._CRS.SBUF */
}
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (0x0F)
}
Method (_DIS, 0, NotSerialized) // _DIS: Disable Device
{
}
}
--
Yauhen Kharuzhy
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next reply other threads:[~2020-01-07 10:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-06 10:21 Yauhen Kharuzhy [this message]
2020-01-06 11:09 ` [alsa-devel] Right place for defining ACPI GPIO mapping for codec Hans de Goede
2020-01-06 22:52 ` Yauhen Kharuzhy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200106102116.GA96770@jeknote.loshitsa1.net \
--to=jekhor@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=hdegoede@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).