Subject: + rtc-at91rm9200-add-configuration-support.patch added to -mm tree To: jhovold@xxxxxxxxx,Robert.Nelson@xxxxxxxxxxx,dgilbert@xxxxxxxxxxxx,ludovic.desroches@xxxxxxxxx,nicolas.ferre@xxxxxxxxx,plagnioj@xxxxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Wed, 29 May 2013 13:34:00 -0700 The patch titled Subject: rtc-at91rm9200: add configuration support has been added to the -mm tree. Its filename is rtc-at91rm9200-add-configuration-support.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Johan Hovold <jhovold@xxxxxxxxx> Subject: rtc-at91rm9200: add configuration support Add configuration support which can be used to implement SoC-specific workarounds for broken hardware. Signed-off-by: Johan Hovold <jhovold@xxxxxxxxx> Cc: Nicolas Ferre <nicolas.ferre@xxxxxxxxx> Cc: Douglas Gilbert <dgilbert@xxxxxxxxxxxx> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@xxxxxxxxxxxx> Cc: Ludovic Desroches <ludovic.desroches@xxxxxxxxx> Cc: Robert Nelson <Robert.Nelson@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/rtc/rtc-at91rm9200.c | 46 +++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 8 deletions(-) diff -puN drivers/rtc/rtc-at91rm9200.c~rtc-at91rm9200-add-configuration-support drivers/rtc/rtc-at91rm9200.c --- a/drivers/rtc/rtc-at91rm9200.c~rtc-at91rm9200-add-configuration-support +++ a/drivers/rtc/rtc-at91rm9200.c @@ -41,6 +41,10 @@ #define AT91_RTC_EPOCH 1900UL /* just like arch/arm/common/rtctime.c */ +struct at91_rtc_config { +}; + +static const struct at91_rtc_config *at91_rtc_config; static DECLARE_COMPLETION(at91_rtc_updated); static unsigned int at91_alarm_year = AT91_RTC_EPOCH; static void __iomem *at91_rtc_regs; @@ -249,6 +253,36 @@ static irqreturn_t at91_rtc_interrupt(in return IRQ_NONE; /* not handled */ } +static const struct at91_rtc_config at91rm9200_config = { +}; + +#ifdef CONFIG_OF +static const struct of_device_id at91_rtc_dt_ids[] = { + { + .compatible = "atmel,at91rm9200-rtc", + .data = &at91rm9200_config, + }, { + /* sentinel */ + } +}; +MODULE_DEVICE_TABLE(of, at91_rtc_dt_ids); +#endif + +static const struct at91_rtc_config * +at91_rtc_get_config(struct platform_device *pdev) +{ + const struct of_device_id *match; + + if (pdev->dev.of_node) { + match = of_match_node(at91_rtc_dt_ids, pdev->dev.of_node); + if (!match) + return NULL; + return (const struct at91_rtc_config *)match->data; + } + + return &at91rm9200_config; +} + static const struct rtc_class_ops at91_rtc_ops = { .read_time = at91_rtc_readtime, .set_time = at91_rtc_settime, @@ -267,6 +301,10 @@ static int __init at91_rtc_probe(struct struct resource *regs; int ret = 0; + at91_rtc_config = at91_rtc_get_config(pdev); + if (!at91_rtc_config) + return -ENODEV; + regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!regs) { dev_err(&pdev->dev, "no mmio resource defined\n"); @@ -381,14 +419,6 @@ static int at91_rtc_resume(struct device static SIMPLE_DEV_PM_OPS(at91_rtc_pm_ops, at91_rtc_suspend, at91_rtc_resume); -#ifdef CONFIG_OF -static const struct of_device_id at91_rtc_dt_ids[] = { - { .compatible = "atmel,at91rm9200-rtc" }, - { /* sentinel */ } -}; -MODULE_DEVICE_TABLE(of, at91_rtc_dt_ids); -#endif - static struct platform_driver at91_rtc_driver = { .remove = __exit_p(at91_rtc_remove), .driver = { _ Patches currently in -mm which might be from jhovold@xxxxxxxxx are rtc-at91rm9200-add-match-table-compile-guard.patch rtc-at91rm9200-add-configuration-support.patch rtc-at91rm9200-refactor-interrupt-register-handling.patch rtc-at91rm9200-add-shadow-interrupt-mask.patch rtc-at91rm9200-use-shadow-imr-on-at91sam9x5.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html