media: i2c: maxim4c: Add config ssc-ratio property

Change-Id: I1178c5becbdf2ded1648e31ff609b7ce6a07bdf5
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
This commit is contained in:
Cody Xie
2023-10-07 15:35:51 +08:00
parent 368f785570
commit f237af29a4
3 changed files with 16 additions and 2 deletions

View File

@@ -29,8 +29,9 @@
* V2.03.00
* 1. remote device add the maxim4c prefix to driver name.
*
* V2.04.00
* V2.04.01
* 1. Add regulator supplier dependencies.
* 2. Add config ssc-ratio property
*
*/
#include <linux/clk.h>
@@ -61,7 +62,7 @@
#include "maxim4c_api.h"
#define DRIVER_VERSION KERNEL_VERSION(2, 0x04, 0x00)
#define DRIVER_VERSION KERNEL_VERSION(2, 0x04, 0x01)
#define MAXIM4C_XVCLK_FREQ 25000000

View File

@@ -182,6 +182,11 @@ int maxim4c_dphy_dpll_predef_set(maxim4c_t *maxim4c, s64 link_freq_hz)
reg_addr, MAXIM4C_I2C_REG_ADDR_16BITS,
0xf4);
reg_addr = 0x1C03 + 0x100 * phy_idx;
ret |= maxim4c_i2c_update_byte(client, reg_addr,
MAXIM4C_I2C_REG_ADDR_16BITS,
0x07, phy_cfg->ssc_ratio);
// Set dpll data rate
reg_addr = 0x0415 + 0x03 * phy_idx;
ret |= maxim4c_i2c_update_byte(client,
@@ -349,6 +354,12 @@ static int maxim4c_mipi_txphy_config_parse_dt(struct device *dev,
phy_cfg->clock_mode = value;
}
ret = of_property_read_u32(node, "ssc-ratio", &value);
if (ret == 0) {
dev_info(dev, "ssc-ratio property: %d", value);
phy_cfg->ssc_ratio = value;
}
sub_idx++;
}
}
@@ -541,6 +552,7 @@ void maxim4c_mipi_txphy_data_init(maxim4c_t *maxim4c)
phy_cfg->vc_ext_en = 0;
phy_cfg->clock_master = 0;
phy_cfg->clock_mode = MAXIM4C_TXPHY_DPLL_PREDEF;
phy_cfg->ssc_ratio = 0;
}
}
EXPORT_SYMBOL(maxim4c_mipi_txphy_data_init);

View File

@@ -53,6 +53,7 @@ struct maxim4c_txphy_cfg {
u8 vc_ext_en;
u8 clock_master;
u8 clock_mode;
u8 ssc_ratio;
};
typedef struct maxim4c_mipi_txphy {