cpts: specify the input clock frequency via DT
This patch adds a way to configure the CPTS input clock scaling factors via the device tree. Signed-off-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
78ca0b2873
commit
00ab94eeaf
@@ -854,6 +854,20 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
|
||||
}
|
||||
data->cpts_active_slave = prop;
|
||||
|
||||
if (of_property_read_u32(node, "cpts_clock_mult", &prop)) {
|
||||
pr_err("Missing cpts_clock_mult property in the DT.\n");
|
||||
ret = -EINVAL;
|
||||
goto error_ret;
|
||||
}
|
||||
data->cpts_clock_mult = prop;
|
||||
|
||||
if (of_property_read_u32(node, "cpts_clock_shift", &prop)) {
|
||||
pr_err("Missing cpts_clock_shift property in the DT.\n");
|
||||
ret = -EINVAL;
|
||||
goto error_ret;
|
||||
}
|
||||
data->cpts_clock_shift = prop;
|
||||
|
||||
data->slave_data = kzalloc(sizeof(struct cpsw_slave_data) *
|
||||
data->slaves, GFP_KERNEL);
|
||||
if (!data->slave_data) {
|
||||
|
Reference in New Issue
Block a user