diff options
author | Richard Cochran <richardcochran@gmail.com> | 2012-10-29 09:45:19 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-01 17:21:32 +0100 |
commit | 00ab94eeaf6c1ad38ad7368c5148fed31403c8a2 (patch) | |
tree | e76e94fe6e4ff9ac7b48dfedd0584bf2bb5164de /drivers/net/ethernet/ti | |
parent | cpsw: add a DT field for the active time stamping port (diff) | |
download | linux-00ab94eeaf6c1ad38ad7368c5148fed31403c8a2.tar.xz linux-00ab94eeaf6c1ad38ad7368c5148fed31403c8a2.zip |
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>
Diffstat (limited to 'drivers/net/ethernet/ti')
-rw-r--r-- | drivers/net/ethernet/ti/cpsw.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index f16579123c1b..c04627cd60dd 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -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) { |