aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-03-23 17:20:07 -0400
committerTom Rini <trini@konsulko.com>2022-04-01 10:28:47 -0400
commitb20e79f0bba277a33f7e0af3776c959fa1c31117 (patch)
tree3413fddca397c823eb27e2e8ecf3abc662a3bff8 /arch
parenta9ee1ad95a9a19bc41f77a0806a8686ae2fb912c (diff)
downloadu-boot-b20e79f0bba277a33f7e0af3776c959fa1c31117.zip
u-boot-b20e79f0bba277a33f7e0af3776c959fa1c31117.tar.gz
u-boot-b20e79f0bba277a33f7e0af3776c959fa1c31117.tar.bz2
Convert CONFIG_CLOCK_SYNTHESIZER to Kconfig
This converts the following to Kconfig: CONFIG_CLOCK_SYNTHESIZER Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/am33xx/Kconfig13
-rw-r--r--arch/arm/mach-omap2/am33xx/clk_synthesizer.c14
2 files changed, 20 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/am33xx/Kconfig b/arch/arm/mach-omap2/am33xx/Kconfig
index b8e115d..23865d4 100644
--- a/arch/arm/mach-omap2/am33xx/Kconfig
+++ b/arch/arm/mach-omap2/am33xx/Kconfig
@@ -207,6 +207,19 @@ config TARGET_PDU001
endchoice
+config CLOCK_SYNTHESIZER
+ bool "CDCE913 and CDCEL913 clock synthesizer support"
+ help
+ The CDCE913 and CDCEL913 devices are modular PLL-based, low cost,
+ high performance , programmable clock synthesizers. They generate
+ up to 3 output clocks from a single input frequency. Each output can
+ be programmed for any clock-frequency.
+
+config CLK_SYNTHESIZER_I2C_ADDR
+ hex "Clock synthesizer i2c bus address"
+ depends on CLOCK_SYNTHESIZER
+ default 0x65
+
endif
if AM43XX
diff --git a/arch/arm/mach-omap2/am33xx/clk_synthesizer.c b/arch/arm/mach-omap2/am33xx/clk_synthesizer.c
index 59f0d8e..c9b9502 100644
--- a/arch/arm/mach-omap2/am33xx/clk_synthesizer.c
+++ b/arch/arm/mach-omap2/am33xx/clk_synthesizer.c
@@ -31,12 +31,12 @@ static int clk_synthesizer_reg_read(struct udevice *dev, int addr, u8 *buf)
#if !CONFIG_IS_ENABLED(DM_I2C)
/* Send the command byte */
- rc = i2c_write(CLK_SYNTHESIZER_I2C_ADDR, addr, 1, buf, 1);
+ rc = i2c_write(CONFIG_CLK_SYNTHESIZER_I2C_ADDR, addr, 1, buf, 1);
if (rc)
printf("Failed to send command to clock synthesizer\n");
/* Read the Data */
- return i2c_read(CLK_SYNTHESIZER_I2C_ADDR, addr, 1, buf, 1);
+ return i2c_read(CONFIG_CLK_SYNTHESIZER_I2C_ADDR, addr, 1, buf, 1);
#else
/* Send the command byte */
rc = dm_i2c_reg_write(dev, addr, *buf);
@@ -73,7 +73,7 @@ static int clk_synthesizer_reg_write(struct udevice *dev, int addr, u8 val)
cmd[1] = val;
#if !CONFIG_IS_ENABLED(DM_I2C)
- rc = i2c_write(CLK_SYNTHESIZER_I2C_ADDR, addr, 1, cmd, 2);
+ rc = i2c_write(CONFIG_CLK_SYNTHESIZER_I2C_ADDR, addr, 1, cmd, 2);
#else
rc = dm_i2c_write(dev, addr, cmd, 2);
#endif
@@ -97,17 +97,17 @@ int setup_clock_synthesizer(struct clk_synth *data)
u8 val = 0;
struct udevice *dev = NULL;
#if !CONFIG_IS_ENABLED(DM_I2C)
- rc = i2c_probe(CLK_SYNTHESIZER_I2C_ADDR);
+ rc = i2c_probe(CONFIG_CLK_SYNTHESIZER_I2C_ADDR);
if (rc) {
printf("i2c probe failed at address 0x%x\n",
- CLK_SYNTHESIZER_I2C_ADDR);
+ CONFIG_CLK_SYNTHESIZER_I2C_ADDR);
return rc;
}
#else
- rc = i2c_get_chip_for_busnum(0, CLK_SYNTHESIZER_I2C_ADDR, 1, &dev);
+ rc = i2c_get_chip_for_busnum(0, CONFIG_CLK_SYNTHESIZER_I2C_ADDR, 1, &dev);
if (rc) {
printf("failed to get device for synthesizer at address 0x%x\n",
- CLK_SYNTHESIZER_I2C_ADDR);
+ CONFIG_CLK_SYNTHESIZER_I2C_ADDR);
return rc;
}
#endif