Merge branches 'cleanup-part3', 'voltage', 'dmtimer' and 'l3' into dt-base
authorTony Lindgren <tony@atomide.com>
Tue, 4 Oct 2011 16:47:06 +0000 (09:47 -0700)
committerTony Lindgren <tony@atomide.com>
Tue, 4 Oct 2011 16:47:06 +0000 (09:47 -0700)
1  2  3  4  5 
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/hsmmc.c
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
arch/arm/mach-omap2/pm.c
arch/arm/mach-omap2/sr_device.c
arch/arm/mach-omap2/timer.c
arch/arm/mach-omap2/usb-musb.c
arch/arm/plat-omap/include/plat/io.h

@@@@@@ -259,8 -247,8 -253,8 -253,8 -258,8 +248,8 @@@@@@ MACHINE_START(OMAP_2430SDP, "OMAP2430 s
        /* Maintainer: Syed Khasim - Texas Instruments Inc */
        .boot_params    = 0x80000100,
        .reserve        = omap_reserve,
- ---   .map_io         = omap_2430sdp_map_io,
-   -   .init_early     = omap_2430sdp_init_early,
+ +++   .map_io         = omap243x_map_io,
+   +   .init_early     = omap2430_init_early,
        .init_irq       = omap2_init_irq,
        .init_machine   = omap_2430sdp_init,
        .timer          = &omap2_timer,
@@@@@@ -840,8 -829,8 -835,8 -835,8 -840,8 +829,8 @@@@@@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4
        /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
        .boot_params    = 0x80000100,
        .reserve        = omap_reserve,
- ---   .map_io         = omap_4430sdp_map_io,
-   -   .init_early     = omap_4430sdp_init_early,
+ +++   .map_io         = omap4_map_io,
+   +   .init_early     = omap4430_init_early,
        .init_irq       = gic_init_irq,
        .init_machine   = omap_4430sdp_init,
        .timer          = &omap4_timer,
Simple merge
@@@@@@ -181,9 -181,9 -181,9 -181,9 -181,9 +181,9 @@@@@@ static int __init omap2_set_init_voltag
                goto exit;
        }
     
-- --   voltdm = omap_voltage_domain_lookup(vdd_name);
++ ++   voltdm = voltdm_lookup(vdd_name);
        if (IS_ERR(voltdm)) {
- ---           printk(KERN_ERR "%s: Unable to get vdd pointer for vdd_%s\n",
+ +++           pr_err("%s: unable to get vdd pointer for vdd_%s\n",
                        __func__, vdd_name);
                goto exit;
        }
Simple merge
@@@@@@ -341,3 -341,3 -341,3 -347,167 -341,3 +347,167 @@@@@@ static void __init omap4_timer_init(voi
     }
     OMAP_SYS_TIMER(4)
     #endif
   -    struct omap_device *od;
+++ +
+++ +/**
+++ + * omap2_dm_timer_set_src - change the timer input clock source
+++ + * @pdev:  timer platform device pointer
+++ + * @source:        array index of parent clock source
+++ + */
+++ +static int omap2_dm_timer_set_src(struct platform_device *pdev, int source)
+++ +{
+++ +   int ret;
+++ +   struct dmtimer_platform_data *pdata = pdev->dev.platform_data;
+++ +   struct clk *fclk, *parent;
+++ +   char *parent_name = NULL;
+++ +
+++ +   fclk = clk_get(&pdev->dev, "fck");
+++ +   if (IS_ERR_OR_NULL(fclk)) {
+++ +           dev_err(&pdev->dev, "%s: %d: clk_get() FAILED\n",
+++ +                           __func__, __LINE__);
+++ +           return -EINVAL;
+++ +   }
+++ +
+++ +   switch (source) {
+++ +   case OMAP_TIMER_SRC_SYS_CLK:
+++ +           parent_name = "sys_ck";
+++ +           break;
+++ +
+++ +   case OMAP_TIMER_SRC_32_KHZ:
+++ +           parent_name = "32k_ck";
+++ +           break;
+++ +
+++ +   case OMAP_TIMER_SRC_EXT_CLK:
+++ +           if (pdata->timer_ip_version == OMAP_TIMER_IP_VERSION_1) {
+++ +                   parent_name = "alt_ck";
+++ +                   break;
+++ +           }
+++ +           dev_err(&pdev->dev, "%s: %d: invalid clk src.\n",
+++ +                   __func__, __LINE__);
+++ +           clk_put(fclk);
+++ +           return -EINVAL;
+++ +   }
+++ +
+++ +   parent = clk_get(&pdev->dev, parent_name);
+++ +   if (IS_ERR_OR_NULL(parent)) {
+++ +           dev_err(&pdev->dev, "%s: %d: clk_get() %s FAILED\n",
+++ +                   __func__, __LINE__, parent_name);
+++ +           clk_put(fclk);
+++ +           return -EINVAL;
+++ +   }
+++ +
+++ +   ret = clk_set_parent(fclk, parent);
+++ +   if (IS_ERR_VALUE(ret)) {
+++ +           dev_err(&pdev->dev, "%s: clk_set_parent() to %s FAILED\n",
+++ +                   __func__, parent_name);
+++ +           ret = -EINVAL;
+++ +   }
+++ +
+++ +   clk_put(parent);
+++ +   clk_put(fclk);
+++ +
+++ +   return ret;
+++ +}
+++ +
+++ +struct omap_device_pm_latency omap2_dmtimer_latency[] = {
+++ +   {
+++ +           .deactivate_func = omap_device_idle_hwmods,
+++ +           .activate_func   = omap_device_enable_hwmods,
+++ +           .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+++ +   },
+++ +};
+++ +
+++ +/**
+++ + * omap_timer_init - build and register timer device with an
+++ + * associated timer hwmod
+++ + * @oh:    timer hwmod pointer to be used to build timer device
+++ + * @user:  parameter that can be passed from calling hwmod API
+++ + *
+++ + * Called by omap_hwmod_for_each_by_class to register each of the timer
+++ + * devices present in the system. The number of timer devices is known
+++ + * by parsing through the hwmod database for a given class name. At the
+++ + * end of function call memory is allocated for timer device and it is
+++ + * registered to the framework ready to be proved by the driver.
+++ + */
+++ +static int __init omap_timer_init(struct omap_hwmod *oh, void *unused)
+++ +{
+++ +   int id;
+++ +   int ret = 0;
+++ +   char *name = "omap_timer";
+++ +   struct dmtimer_platform_data *pdata;
   -    od = omap_device_build(name, id, oh, pdata, sizeof(*pdata),
+++++   struct platform_device *pdev;
+++ +   struct omap_timer_capability_dev_attr *timer_dev_attr;
+++ +   struct powerdomain *pwrdm;
+++ +
+++ +   pr_debug("%s: %s\n", __func__, oh->name);
+++ +
+++ +   /* on secure device, do not register secure timer */
+++ +   timer_dev_attr = oh->dev_attr;
+++ +   if (omap_type() != OMAP2_DEVICE_TYPE_GP && timer_dev_attr)
+++ +           if (timer_dev_attr->timer_capability == OMAP_TIMER_SECURE)
+++ +                   return ret;
+++ +
+++ +   pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
+++ +   if (!pdata) {
+++ +           pr_err("%s: No memory for [%s]\n", __func__, oh->name);
+++ +           return -ENOMEM;
+++ +   }
+++ +
+++ +   /*
+++ +    * Extract the IDs from name field in hwmod database
+++ +    * and use the same for constructing ids' for the
+++ +    * timer devices. In a way, we are avoiding usage of
+++ +    * static variable witin the function to do the same.
+++ +    * CAUTION: We have to be careful and make sure the
+++ +    * name in hwmod database does not change in which case
+++ +    * we might either make corresponding change here or
+++ +    * switch back static variable mechanism.
+++ +    */
+++ +   sscanf(oh->name, "timer%2d", &id);
+++ +
+++ +   pdata->set_timer_src = omap2_dm_timer_set_src;
+++ +   pdata->timer_ip_version = oh->class->rev;
+++ +
+++ +   /* Mark clocksource and clockevent timers as reserved */
+++ +   if ((sys_timer_reserved >> (id - 1)) & 0x1)
+++ +           pdata->reserved = 1;
+++ +
+++ +   pwrdm = omap_hwmod_get_pwrdm(oh);
+++ +   pdata->loses_context = pwrdm_can_ever_lose_context(pwrdm);
+++ +#ifdef CONFIG_PM
+++ +   pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count;
+++ +#endif
   -    if (IS_ERR(od)) {
+++++   pdev = omap_device_build(name, id, oh, pdata, sizeof(*pdata),
+++ +                   omap2_dmtimer_latency,
+++ +                   ARRAY_SIZE(omap2_dmtimer_latency),
+++ +                   0);
+++ +
+++++   if (IS_ERR(pdev)) {
+++ +           pr_err("%s: Can't build omap_device for %s: %s.\n",
+++ +                   __func__, name, oh->name);
+++ +           ret = -EINVAL;
+++ +   }
+++ +
+++ +   kfree(pdata);
+++ +
+++ +   return ret;
+++ +}
+++ +
+++ +/**
+++ + * omap2_dm_timer_init - top level regular device initialization
+++ + *
+++ + * Uses dedicated hwmod api to parse through hwmod database for
+++ + * given class name and then build and register the timer device.
+++ + */
+++ +static int __init omap2_dm_timer_init(void)
+++ +{
+++ +   int ret;
+++ +
+++ +   ret = omap_hwmod_for_each_by_class("timer", omap_timer_init, NULL);
+++ +   if (unlikely(ret)) {
+++ +           pr_err("%s: device registration failed.\n", __func__);
+++ +           return -EINVAL;
+++ +   }
+++ +
+++ +   return 0;
+++ +}
+++ +arch_initcall(omap2_dm_timer_init);
@@@@@@ -115,7 -115,7 -115,7 -115,7 -115,7 +115,6 @@@@@@ static struct omap_musb_board_data musb
     void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
     {
        struct omap_hwmod               *oh;
-----   struct omap_device              *od;
        struct platform_device          *pdev;
        struct device                   *dev;
        int                             bus_id = -1;
                name = "musb-omap2430";
        }
     
-----   oh = omap_hwmod_lookup(oh_name);
-----   if (!oh) {
-----           pr_err("Could not look up %s\n", oh_name);
-----           return;
-----   }
+++++        oh = omap_hwmod_lookup(oh_name);
+++++        if (WARN(!oh, "%s: could not find omap_hwmod for %s\n",
+++++                 __func__, oh_name))
+++++                return;
     
-----   od = omap_device_build(name, bus_id, oh, &musb_plat,
+++++   pdev = omap_device_build(name, bus_id, oh, &musb_plat,
                               sizeof(musb_plat), omap_musb_latency,
                               ARRAY_SIZE(omap_musb_latency), false);
-----   if (IS_ERR(od)) {
+++++   if (IS_ERR(pdev)) {
                pr_err("Could not build omap_device for %s %s\n",
                                                name, oh_name);
                return;
        }
     
-----   pdev = &od->pdev;
        dev = &pdev->dev;
        get_device(dev);
        dev->dma_mask = &musb_dmamask;
Simple merge