Commit 464eed84 authored by Magnus Damm's avatar Magnus Damm Committed by Daniel Lezcano

clocksource/drivers/sh_cmt: Use 0x3f mask for SH_CMT_48BIT case

Always use 0x3f as channel mask for the SH_CMT_48BIT type of devices.
Once this patch is applied the "renesas,channels-mask" property will
be ignored by the driver for older devices matching SH_CMT_48BIT. In
the future when all CMT types store channel mask in the driver then
we will be able to deprecate and remove "renesas,channels-mask" from DTS.
Signed-off-by: default avatarMagnus Damm <damm+renesas@opensource.se>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent e20824e9
...@@ -74,6 +74,8 @@ enum sh_cmt_model { ...@@ -74,6 +74,8 @@ enum sh_cmt_model {
struct sh_cmt_info { struct sh_cmt_info {
enum sh_cmt_model model; enum sh_cmt_model model;
unsigned int channels_mask;
unsigned long width; /* 16 or 32 bit version of hardware block */ unsigned long width; /* 16 or 32 bit version of hardware block */
unsigned long overflow_bit; unsigned long overflow_bit;
unsigned long clear_bits; unsigned long clear_bits;
...@@ -212,6 +214,7 @@ static const struct sh_cmt_info sh_cmt_info[] = { ...@@ -212,6 +214,7 @@ static const struct sh_cmt_info sh_cmt_info[] = {
}, },
[SH_CMT_48BIT] = { [SH_CMT_48BIT] = {
.model = SH_CMT_48BIT, .model = SH_CMT_48BIT,
.channels_mask = 0x3f,
.width = 32, .width = 32,
.overflow_bit = SH_CMT32_CMCSR_CMF, .overflow_bit = SH_CMT32_CMCSR_CMF,
.clear_bits = ~(SH_CMT32_CMCSR_CMF | SH_CMT32_CMCSR_OVF), .clear_bits = ~(SH_CMT32_CMCSR_CMF | SH_CMT32_CMCSR_OVF),
...@@ -966,9 +969,14 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev) ...@@ -966,9 +969,14 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev)
id = of_match_node(sh_cmt_of_table, pdev->dev.of_node); id = of_match_node(sh_cmt_of_table, pdev->dev.of_node);
cmt->info = id->data; cmt->info = id->data;
ret = sh_cmt_parse_dt(cmt); /* prefer in-driver channel configuration over DT */
if (ret < 0) if (cmt->info->channels_mask) {
return ret; cmt->hw_channels = cmt->info->channels_mask;
} else {
ret = sh_cmt_parse_dt(cmt);
if (ret < 0)
return ret;
}
} else if (pdev->dev.platform_data) { } else if (pdev->dev.platform_data) {
struct sh_timer_config *cfg = pdev->dev.platform_data; struct sh_timer_config *cfg = pdev->dev.platform_data;
const struct platform_device_id *id = pdev->id_entry; const struct platform_device_id *id = pdev->id_entry;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment