aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/i2c/rt5663/chip.h
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2017-08-07 17:43:26 -0700
committerDuncan Laurie <dlaurie@chromium.org>2017-08-09 22:05:46 +0000
commit6d5873d7f280b3eb96664e41f2c204fc39ab506a (patch)
treef9241318589701428c8aae3d88cebb9c64e19aae /src/drivers/i2c/rt5663/chip.h
parent46e293ddff163cea3446ee4413a3c6d071119e60 (diff)
drivers/i2c: Add driver for rt5663 codec
This commit adds a new driver for the RT5663 codec to use instead of the generic i2c driver. Since the kernel needs additional driver-specific device properties we need a BIOS driver that can provide those properties. The kernel driver devicetree properties for this codec are at: linux/Documentation/devicetree/bindings/sound/rt5663.txt This was tested by booting and verifying the generated SSDT contains the expected device properties in _DSD. Scope (\_SB.PCI0.I2C4) { Device (RT53) { Name (_HID, "10EC5663") Name (_UID, Zero) Name (_DDN, "Realtek RT5663 Codec") Method (_STA, 0, NotSerialized) { Return (0x0F) } Name (_CRS, ResourceTemplate () { I2cSerialBus (0x0013, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.PCI0.I2C4", 0x00, ResourceConsumer) GpioInt (Edge, ActiveBoth, Exclusive, PullDefault, 0x0000, "\\_SB.PCI0.GPIO", 0x00, ResourceConsumer) { 0x0051 } }) Name (_DSD, Package (0x02) { ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301") Package (0x05) { Package (0x02) { "irq-gpios", Package (0x04) { \_SB.PCI0.I2C4.RT53, Zero, Zero, Zero } }, Package (0x02) { "realtek,dc_offset_l_manual", 0x00FFD160 }, Package (0x02) { "realtek,dc_offset_r_manual", 0x00FFD1C0 }, Package (0x02) { "realtek,dc_offset_l_manual_mic", 0x00FF8A10 }, Package (0x02) { "realtek,dc_offset_r_manual_mic", 0x00FF8AB0 } } }) } } Change-Id: I3425fcbe13c9a5987fc91086d283a86db55c0819 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://review.coreboot.org/20904 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/drivers/i2c/rt5663/chip.h')
-rw-r--r--src/drivers/i2c/rt5663/chip.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/drivers/i2c/rt5663/chip.h b/src/drivers/i2c/rt5663/chip.h
new file mode 100644
index 0000000000..1b367c934f
--- /dev/null
+++ b/src/drivers/i2c/rt5663/chip.h
@@ -0,0 +1,34 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2017 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+/*
+ * Realtek RT5663 audio codec devicetree bindings
+ */
+struct drivers_i2c_rt5663_config {
+ /* I2C Bus Frequency in Hertz (default 400kHz) */
+ unsigned int bus_speed;
+ /* Identifier for multiple chips */
+ unsigned int uid;
+
+ /* Allow GPIO based interrupt or PIRQ */
+ struct acpi_gpio irq_gpio;
+ struct acpi_irq irq;
+
+ /* Manual offset value to compensate DC offset for L/R channels */
+ uint32_t dc_offset_l_manual;
+ uint32_t dc_offset_r_manual;
+ uint32_t dc_offset_l_manual_mic;
+ uint32_t dc_offset_r_manual_mic;
+};