more refactor
Change-Id: If41733622084271c5dbf7945de08511413b63e01
diff --git a/system/dev/soc/aml-a113/a113-bus.c b/system/dev/soc/aml-a113/a113-bus.c
index c7fe793..e16b17a 100644
--- a/system/dev/soc/aml-a113/a113-bus.c
+++ b/system/dev/soc/aml-a113/a113-bus.c
@@ -171,8 +171,8 @@
thrd_t thrd;
thrd_create_with_name(&thrd, i2c_test_thread, conn1, "i2c_test_thread");
- aml_tdm_dev_t tdmc;
- aml_tdm_init(&tdmc, bus);
+ aml_tdmout_dev_t tdmc;
+ aml_tdmout_init(&tdmc, bus);
//aml_i2c_write(i2cb_dev, NULL, 2);
/*
diff --git a/system/dev/soc/aml-a113/aml-tdm.c b/system/dev/soc/aml-a113/aml-tdm.c
index 54ded39..c5876a5 100644
--- a/system/dev/soc/aml-a113/aml-tdm.c
+++ b/system/dev/soc/aml-a113/aml-tdm.c
@@ -24,7 +24,7 @@
/* create instance of aml_i2c_t and do basic initialization. There will
be one of these instances for each of the soc i2c ports.
*/
-zx_status_t aml_tdm_init(aml_tdm_dev_t *device, a113_bus_t *host_bus) {
+zx_status_t aml_tdmout_init(aml_tdmout_dev_t *device, a113_bus_t *host_bus) {
ZX_DEBUG_ASSERT(device);
ZX_DEBUG_ASSERT(host_bus);
@@ -71,10 +71,10 @@
// assign fclk/4 (500MHz) to the pdm clocks and divide to get ~48khz
reg->clk_pdmin_ctl0 = ( 1 << 31) | (6 << 24) | (10416/128);
- reg->clk_pdmin_ctl1 = ( 1 << 31) | (6 << 24) | (10416/128);
+ reg->clk_pdmin_ctl1 = ( 1 << 31) | (6 << 24) | (2);
// Enable clock gates for PDM and TDM blocks
- reg->clk_gate_en = (1 << 8) || (1 << 1);
+ reg->clk_gate_en = (1 << 8) | (1 << 1);
return ZX_OK;
diff --git a/system/dev/soc/aml-a113/aml-tdm.h b/system/dev/soc/aml-a113/aml-tdm.h
index 7436596..d4813cb 100644
--- a/system/dev/soc/aml-a113/aml-tdm.h
+++ b/system/dev/soc/aml-a113/aml-tdm.h
@@ -139,7 +139,7 @@
-zx_status_t aml_tdm_init(aml_tdm_dev_t *device, a113_bus_t *host_bus);
+zx_status_t aml_tdmout_init(aml_tdmout_dev_t *device, a113_bus_t *host_bus);
//Register offsets
#define AML_TDM_AUDIO_CLK_GATE_EN_REG 0x0000