Jeremy Soller has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43614 )
Change subject: drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier ......................................................................
drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier
This adds a driver for the TI TAS5825M, documentation can be found here: https://www.ti.com/product/TAS5825M
This driver expects the mainboard using it to define tas5825m_setup, which uses the tas5825m_* functions to set configuration data. Each mainboard may have very different configuration data, depending on its audio hardware.
Tested on system76/addw2 and system76/oryp6, which will be added in a future patch.
Signed-off-by: Jeremy Soller jeremy@system76.com Change-Id: I896e8f272f18e64bfc90f406e7d4163010800aaf --- A src/drivers/i2c/tas5825m/Kconfig A src/drivers/i2c/tas5825m/Makefile.inc A src/drivers/i2c/tas5825m/tas5825m.c A src/drivers/i2c/tas5825m/tas5825m.h 4 files changed, 81 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/43614/1
diff --git a/src/drivers/i2c/tas5825m/Kconfig b/src/drivers/i2c/tas5825m/Kconfig new file mode 100644 index 0000000..0deca17 --- /dev/null +++ b/src/drivers/i2c/tas5825m/Kconfig @@ -0,0 +1,5 @@ +config DRIVERS_I2C_TAS5825M + bool + default n + help + Enable support for TI TAS5825M Amplifier. diff --git a/src/drivers/i2c/tas5825m/Makefile.inc b/src/drivers/i2c/tas5825m/Makefile.inc new file mode 100644 index 0000000..909ffdb --- /dev/null +++ b/src/drivers/i2c/tas5825m/Makefile.inc @@ -0,0 +1 @@ +ramstage-$(CONFIG_DRIVERS_I2C_TAS5825M) += tas5825m.c diff --git a/src/drivers/i2c/tas5825m/tas5825m.c b/src/drivers/i2c/tas5825m/tas5825m.c new file mode 100644 index 0000000..2970a8ee --- /dev/null +++ b/src/drivers/i2c/tas5825m/tas5825m.c @@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <console/console.h> +#include <device/smbus.h> +#include <device/pci.h> +#include "tas5825m.h" + +int tas5825m_write_at(struct device *dev, uint8_t addr, uint8_t value) { + return smbus_write_byte(dev, addr, value); +} + +//TODO: use I2C block write for better performance +int tas5825m_write_block_at(struct device *dev, uint8_t addr, const uint8_t * values, uint8_t length) { + int res = 0; + for (uint8_t i = 0; i < length; i++) { + res = smbus_write_byte(dev, addr + i, values[i]); + if (res < 0) return res; + } + return (int)length; +} + +int tas5825m_set_page(struct device *dev, uint8_t page) { + return tas5825m_write_at(dev, 0x00, page); +} + +int tas5825m_set_book(struct device *dev, uint8_t book) { + int res = tas5825m_set_page(dev, 0x00); + if (res < 0) return res; + return tas5825m_write_at(dev, 0x7F, book); +} + +__weak int tas5825m_setup(struct device *dev) { + printk(BIOS_ERR, "tas5825m: setup not implemented\n"); + return -1; +} + +static void tas5825m_init(struct device *dev) { + if (dev->enabled && dev->path.type == DEVICE_PATH_I2C && + ops_smbus_bus(get_pbus_smbus(dev))) { + printk(BIOS_DEBUG, "tas5825m at %s\n", dev_path(dev)); + int res = tas5825m_setup(dev); + if (res) { + printk(BIOS_ERR, "tas5825m init failed: %d\n", res); + } else { + printk(BIOS_DEBUG, "tas5825m init successful\n"); + } + } +} + +static struct device_operations tas5825m_operations = { + .read_resources = noop_read_resources, + .set_resources = noop_set_resources, + .init = tas5825m_init, +}; + +static void tas5825m_enable_dev(struct device *dev) { + dev->ops = &tas5825m_operations; +} + +struct chip_operations drivers_i2c_tas5825m_ops = { + CHIP_NAME("TI TAS5825M Amplifier") + .enable_dev = tas5825m_enable_dev, +}; diff --git a/src/drivers/i2c/tas5825m/tas5825m.h b/src/drivers/i2c/tas5825m/tas5825m.h new file mode 100644 index 0000000..c58f86a --- /dev/null +++ b/src/drivers/i2c/tas5825m/tas5825m.h @@ -0,0 +1,12 @@ +#ifndef TAS5825M_H +#define TAS5825M_H + +#include <device/device.h> + +int tas5825m_write_at(struct device *dev, uint8_t addr, uint8_t value); +int tas5825m_write_block_at(struct device *dev, uint8_t addr, const uint8_t * values, uint8_t length); +int tas5825m_set_page(struct device *dev, uint8_t page); +int tas5825m_set_book(struct device *dev, uint8_t book); +int tas5825m_setup(struct device *dev); + +#endif // TAS5825M_H
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43614 )
Change subject: drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/43614/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/43614/1//COMMIT_MSG@17 PS1, Line 17: Tested on system76/addw2 and system76/oryp6, which will be added in : a future patch. Would be nice to add at least one of these mainboards first, then add the driver and select it where applicable. Otherwise, this code hasn't been build-tested.
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43614 )
Change subject: drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier ......................................................................
Patch Set 1:
(14 comments)
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... File src/drivers/i2c/tas5825m/tas5825m.h:
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... PS1, Line 7: int tas5825m_write_block_at(struct device *dev, uint8_t addr, const uint8_t * values, uint8_t length); line over 96 characters
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... PS1, Line 7: int tas5825m_write_block_at(struct device *dev, uint8_t addr, const uint8_t * values, uint8_t length); "foo * bar" should be "foo *bar"
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... File src/drivers/i2c/tas5825m/tas5825m.c:
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... PS1, Line 8: int tas5825m_write_at(struct device *dev, uint8_t addr, uint8_t value) { open brace '{' following function definitions go on the next line
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... PS1, Line 13: int tas5825m_write_block_at(struct device *dev, uint8_t addr, const uint8_t * values, uint8_t length) { line over 96 characters
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... PS1, Line 13: int tas5825m_write_block_at(struct device *dev, uint8_t addr, const uint8_t * values, uint8_t length) { "foo * bar" should be "foo *bar"
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... PS1, Line 13: int tas5825m_write_block_at(struct device *dev, uint8_t addr, const uint8_t * values, uint8_t length) { open brace '{' following function definitions go on the next line
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... PS1, Line 17: if (res < 0) return res; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... PS1, Line 22: int tas5825m_set_page(struct device *dev, uint8_t page) { open brace '{' following function definitions go on the next line
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... PS1, Line 26: int tas5825m_set_book(struct device *dev, uint8_t book) { open brace '{' following function definitions go on the next line
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... PS1, Line 28: if (res < 0) return res; trailing statements should be on next line
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... PS1, Line 32: __weak int tas5825m_setup(struct device *dev) { open brace '{' following function definitions go on the next line
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... PS1, Line 37: static void tas5825m_init(struct device *dev) { open brace '{' following function definitions go on the next line
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... PS1, Line 42: if (res) { braces {} are not necessary for any arm of this statement
https://review.coreboot.org/c/coreboot/+/43614/1/src/drivers/i2c/tas5825m/ta... PS1, Line 56: static void tas5825m_enable_dev(struct device *dev) { open brace '{' following function definitions go on the next line
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/43614
to look at the new patch set (#2).
Change subject: drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier ......................................................................
drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier
This adds a driver for the TI TAS5825M, documentation can be found here: https://www.ti.com/product/TAS5825M
This driver expects the mainboard using it to define tas5825m_setup, which uses the tas5825m_* functions to set configuration data. Each mainboard may have very different configuration data, depending on its audio hardware.
Tested on system76/addw2 and system76/oryp6, which will be added in a future patch.
Signed-off-by: Jeremy Soller jeremy@system76.com Change-Id: I896e8f272f18e64bfc90f406e7d4163010800aaf --- A src/drivers/i2c/tas5825m/Kconfig A src/drivers/i2c/tas5825m/Makefile.inc A src/drivers/i2c/tas5825m/tas5825m.c A src/drivers/i2c/tas5825m/tas5825m.h 4 files changed, 91 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/43614/2
Hello build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/43614
to look at the new patch set (#3).
Change subject: drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier ......................................................................
drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier
This adds a driver for the TI TAS5825M, documentation can be found here: https://www.ti.com/product/TAS5825M
This driver expects the mainboard using it to define tas5825m_setup, which uses the tas5825m_* functions to set configuration data. Each mainboard may have very different configuration data, depending on its audio hardware.
Tested on system76/addw2 and system76/oryp6, which will be added in a future patch.
Signed-off-by: Jeremy Soller jeremy@system76.com Change-Id: I896e8f272f18e64bfc90f406e7d4163010800aaf --- A src/drivers/i2c/tas5825m/Kconfig A src/drivers/i2c/tas5825m/Makefile.inc A src/drivers/i2c/tas5825m/tas5825m.c A src/drivers/i2c/tas5825m/tas5825m.h 4 files changed, 93 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/43614/3
Tim Crawford has uploaded a new patch set (#4) to the change originally created by Jeremy Soller. ( https://review.coreboot.org/c/coreboot/+/43614 )
Change subject: drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier ......................................................................
drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier
This adds a driver for the TI TAS5825M, documentation can be found here: https://www.ti.com/product/TAS5825M
This driver expects the mainboard using it to define tas5825m_setup, which uses the tas5825m_* functions to set configuration data. Each mainboard may have very different configuration data, depending on its audio hardware.
Tested on system76/addw2, system76/bonw14, system76/oryp5, and system76/oryp6, which will be added in future patches.
Signed-off-by: Jeremy Soller jeremy@system76.com Signed-off-by: Tim Crawford tcrawford@system76.com Change-Id: I896e8f272f18e64bfc90f406e7d4163010800aaf --- A src/drivers/i2c/tas5825m/Kconfig A src/drivers/i2c/tas5825m/Makefile.inc A src/drivers/i2c/tas5825m/chip.h A src/drivers/i2c/tas5825m/tas5825m.c A src/drivers/i2c/tas5825m/tas5825m.h 5 files changed, 108 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/43614/4
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43614 )
Change subject: drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier ......................................................................
Patch Set 4:
(2 comments)
https://review.coreboot.org/c/coreboot/+/43614/4/src/drivers/i2c/tas5825m/ch... File src/drivers/i2c/tas5825m/chip.h:
https://review.coreboot.org/c/coreboot/+/43614/4/src/drivers/i2c/tas5825m/ch... PS4, Line 5: int id; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/43614/4/src/drivers/i2c/tas5825m/ta... File src/drivers/i2c/tas5825m/tas5825m.c:
https://review.coreboot.org/c/coreboot/+/43614/4/src/drivers/i2c/tas5825m/ta... PS4, Line 56: if (res) { braces {} are not necessary for any arm of this statement
Tim Crawford has uploaded a new patch set (#5) to the change originally created by Jeremy Soller. ( https://review.coreboot.org/c/coreboot/+/43614 )
Change subject: drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier ......................................................................
drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier
This adds a driver for the TI TAS5825M, documentation can be found here: https://www.ti.com/product/TAS5825M
This driver expects the mainboard using it to define tas5825m_setup, which uses the tas5825m_* functions to set configuration data. Each mainboard may have very different configuration data, depending on its audio hardware.
Tested on system76/addw2, system76/bonw14, system76/oryp5, and system76/oryp6, which will be added in future patches.
Signed-off-by: Jeremy Soller jeremy@system76.com Signed-off-by: Tim Crawford tcrawford@system76.com Change-Id: I896e8f272f18e64bfc90f406e7d4163010800aaf --- A src/drivers/i2c/tas5825m/Kconfig A src/drivers/i2c/tas5825m/Makefile.inc A src/drivers/i2c/tas5825m/chip.h A src/drivers/i2c/tas5825m/tas5825m.c A src/drivers/i2c/tas5825m/tas5825m.h 5 files changed, 107 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/43614/5
Tim Crawford has uploaded a new patch set (#8) to the change originally created by Jeremy Soller. ( https://review.coreboot.org/c/coreboot/+/43614 )
Change subject: drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier ......................................................................
drivers/i2c/tas5825m: Add driver for TI TAS5825M amplifier
This adds a driver for the TI TAS5825M, documentation can be found here: https://www.ti.com/product/TAS5825M
This driver expects the mainboard using it to define tas5825m_setup, which uses the tas5825m_* functions to set configuration data. Each mainboard may have very different configuration data, depending on its audio hardware.
Tested on system76/addw2, system76/bonw14, system76/oryp5, and system76/oryp6.
Signed-off-by: Jeremy Soller jeremy@system76.com Signed-off-by: Tim Crawford tcrawford@system76.com Change-Id: I896e8f272f18e64bfc90f406e7d4163010800aaf --- A src/drivers/i2c/tas5825m/Kconfig A src/drivers/i2c/tas5825m/Makefile.inc A src/drivers/i2c/tas5825m/chip.h A src/drivers/i2c/tas5825m/tas5825m.c A src/drivers/i2c/tas5825m/tas5825m.h 5 files changed, 107 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/43614/8
Attention is currently required from: Tim Crawford. Tim Crawford has uploaded a new patch set (#9) to the change originally created by Jeremy Soller. ( https://review.coreboot.org/c/coreboot/+/43614 )
Change subject: drivers/i2c/tas5825m: Add driver for TI TAS5825M ......................................................................
drivers/i2c/tas5825m: Add driver for TI TAS5825M
This adds a driver for the TI TAS5825M smart amplifier [1].
The driver expects the mainboard using it to define tas5825m_setup(), which uses the tas5825m_* functions to set configuration data. Each mainboard may have very different configuration data, depending on its audio hardware.
Tested on System76 addw1, bonw14, oryp5, and oryp6.
[1]: https://www.ti.com/product/TAS5825M
Signed-off-by: Jeremy Soller jeremy@system76.com Signed-off-by: Tim Crawford tcrawford@system76.com Change-Id: I896e8f272f18e64bfc90f406e7d4163010800aaf --- A src/drivers/i2c/tas5825m/Kconfig A src/drivers/i2c/tas5825m/Makefile.inc A src/drivers/i2c/tas5825m/chip.h A src/drivers/i2c/tas5825m/tas5825m.c A src/drivers/i2c/tas5825m/tas5825m.h 5 files changed, 107 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/43614/9
Attention is currently required from: Jeremy Soller, Angel Pons. Tim Crawford has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43614 )
Change subject: drivers/i2c/tas5825m: Add driver for TI TAS5825M ......................................................................
Patch Set 9:
(1 comment)
Commit Message:
https://review.coreboot.org/c/coreboot/+/43614/comment/71526805_a09a643e PS1, Line 17: Tested on system76/addw2 and system76/oryp6, which will be added in : a future patch.
Would be nice to add at least one of these mainboards first, then add the driver and select it where […]
Ack
Attention is currently required from: Tim Crawford, Angel Pons. Jeremy Soller has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43614 )
Change subject: drivers/i2c/tas5825m: Add driver for TI TAS5825M ......................................................................
Patch Set 11: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/43614 )
Change subject: drivers/i2c/tas5825m: Add driver for TI TAS5825M ......................................................................
drivers/i2c/tas5825m: Add driver for TI TAS5825M
This adds a driver for the TI TAS5825M smart amplifier [1].
The driver expects the mainboard using it to define tas5825m_setup(), which uses the tas5825m_* functions to set configuration data. Each mainboard may have very different configuration data, depending on its audio hardware.
Tested on System76 addw1, bonw14, oryp5, and oryp6.
[1]: https://www.ti.com/product/TAS5825M
Signed-off-by: Jeremy Soller jeremy@system76.com Signed-off-by: Tim Crawford tcrawford@system76.com Change-Id: I896e8f272f18e64bfc90f406e7d4163010800aaf Reviewed-on: https://review.coreboot.org/c/coreboot/+/43614 Tested-by: build bot (Jenkins) no-reply@coreboot.org --- A src/drivers/i2c/tas5825m/Kconfig A src/drivers/i2c/tas5825m/Makefile.inc A src/drivers/i2c/tas5825m/chip.h A src/drivers/i2c/tas5825m/tas5825m.c A src/drivers/i2c/tas5825m/tas5825m.h 5 files changed, 107 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Jeremy Soller: Looks good to me, approved
diff --git a/src/drivers/i2c/tas5825m/Kconfig b/src/drivers/i2c/tas5825m/Kconfig new file mode 100644 index 0000000..0deca17 --- /dev/null +++ b/src/drivers/i2c/tas5825m/Kconfig @@ -0,0 +1,5 @@ +config DRIVERS_I2C_TAS5825M + bool + default n + help + Enable support for TI TAS5825M Amplifier. diff --git a/src/drivers/i2c/tas5825m/Makefile.inc b/src/drivers/i2c/tas5825m/Makefile.inc new file mode 100644 index 0000000..909ffdb --- /dev/null +++ b/src/drivers/i2c/tas5825m/Makefile.inc @@ -0,0 +1 @@ +ramstage-$(CONFIG_DRIVERS_I2C_TAS5825M) += tas5825m.c diff --git a/src/drivers/i2c/tas5825m/chip.h b/src/drivers/i2c/tas5825m/chip.h new file mode 100644 index 0000000..23af491 --- /dev/null +++ b/src/drivers/i2c/tas5825m/chip.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +struct drivers_i2c_tas5825m_config { + // Used to uniquely identify the AMP + int id; +}; diff --git a/src/drivers/i2c/tas5825m/tas5825m.c b/src/drivers/i2c/tas5825m/tas5825m.c new file mode 100644 index 0000000..39e5575 --- /dev/null +++ b/src/drivers/i2c/tas5825m/tas5825m.c @@ -0,0 +1,80 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <console/console.h> +#include <device/smbus.h> +#include <device/pci.h> +#include "chip.h" +#include "tas5825m.h" + +int tas5825m_write_at(struct device *dev, uint8_t addr, uint8_t value) +{ + return smbus_write_byte(dev, addr, value); +} + +//TODO: use I2C block write for better performance +int tas5825m_write_block_at(struct device *dev, uint8_t addr, + const uint8_t *values, uint8_t length) +{ + int res = 0; + for (uint8_t i = 0; i < length; i++) { + res = smbus_write_byte(dev, addr + i, values[i]); + if (res < 0) + return res; + } + return (int)length; +} + +int tas5825m_set_page(struct device *dev, uint8_t page) +{ + return tas5825m_write_at(dev, 0x00, page); +} + +int tas5825m_set_book(struct device *dev, uint8_t book) +{ + int res = tas5825m_set_page(dev, 0x00); + if (res < 0) + return res; + return tas5825m_write_at(dev, 0x7F, book); +} + +__weak int tas5825m_setup(struct device *dev, int id) +{ + printk(BIOS_ERR, "tas5825m: setup not implemented\n"); + return -1; +} + +static void tas5825m_init(struct device *dev) +{ + if (dev->enabled && dev->path.type == DEVICE_PATH_I2C && + ops_smbus_bus(get_pbus_smbus(dev))) { + printk(BIOS_DEBUG, "tas5825m at %s\n", dev_path(dev)); + + struct drivers_i2c_tas5825m_config *config = dev->chip_info; + if (config) { + printk(BIOS_DEBUG, "tas5825m id %d\n", config->id); + int res = tas5825m_setup(dev, config->id); + if (res) + printk(BIOS_ERR, "tas5825m init failed: %d\n", res); + else + printk(BIOS_DEBUG, "tas5825m init successful\n"); + } else { + printk(BIOS_ERR, "tas5825m: failed to find config\n"); + } + } +} + +static struct device_operations tas5825m_operations = { + .read_resources = noop_read_resources, + .set_resources = noop_set_resources, + .init = tas5825m_init, +}; + +static void tas5825m_enable_dev(struct device *dev) +{ + dev->ops = &tas5825m_operations; +} + +struct chip_operations drivers_i2c_tas5825m_ops = { + CHIP_NAME("TI TAS5825M Amplifier") + .enable_dev = tas5825m_enable_dev, +}; diff --git a/src/drivers/i2c/tas5825m/tas5825m.h b/src/drivers/i2c/tas5825m/tas5825m.h new file mode 100644 index 0000000..33b8a48 --- /dev/null +++ b/src/drivers/i2c/tas5825m/tas5825m.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef TAS5825M_H +#define TAS5825M_H + +#include <device/device.h> + +int tas5825m_write_at(struct device *dev, uint8_t addr, uint8_t value); +int tas5825m_write_block_at(struct device *dev, uint8_t addr, + const uint8_t *values, uint8_t length); +int tas5825m_set_page(struct device *dev, uint8_t page); +int tas5825m_set_book(struct device *dev, uint8_t book); +int tas5825m_setup(struct device *dev, int id); + +#endif // TAS5825M_H