2 * TI's OMAP DSP platform device registration
4 * Copyright (C) 2005-2006 Texas Instruments, Inc.
5 * Copyright (C) 2009 Nokia Corporation
7 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #include <linux/platform_device.h>
17 #ifdef CONFIG_BRIDGE_DVFS
18 #include <plat/omap-pm.h>
23 extern phys_addr_t omap_dsp_get_mempool_base(void);
25 static struct platform_device *omap_dsp_pdev;
27 static struct omap_dsp_platform_data omap_dsp_pdata __initdata = {
28 #ifdef CONFIG_BRIDGE_DVFS
29 .dsp_set_min_opp = omap_pm_dsp_set_min_opp,
30 .dsp_get_opp = omap_pm_dsp_get_opp,
31 .cpu_set_freq = omap_pm_cpu_set_freq,
32 .cpu_get_freq = omap_pm_cpu_get_freq,
34 .dsp_prm_read = prm_read_mod_reg,
35 .dsp_prm_write = prm_write_mod_reg,
36 .dsp_prm_rmw_bits = prm_rmw_mod_reg_bits,
37 .dsp_cm_read = cm_read_mod_reg,
38 .dsp_cm_write = cm_write_mod_reg,
39 .dsp_cm_rmw_bits = cm_rmw_mod_reg_bits,
42 static int __init omap_dsp_init(void)
44 struct platform_device *pdev;
46 struct omap_dsp_platform_data *pdata = &omap_dsp_pdata;
48 pdata->phys_mempool_base = omap_dsp_get_mempool_base();
50 if (pdata->phys_mempool_base) {
51 pdata->phys_mempool_size = CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE;
52 pr_info("%s: %x bytes @ %x\n", __func__,
53 pdata->phys_mempool_size, pdata->phys_mempool_base);
56 pdev = platform_device_alloc("omap-dsp", -1);
60 err = platform_device_add_data(pdev, pdata, sizeof(*pdata));
64 err = platform_device_add(pdev);
72 platform_device_put(pdev);
75 module_init(omap_dsp_init);
77 static void __exit omap_dsp_exit(void)
79 platform_device_unregister(omap_dsp_pdev);
81 module_exit(omap_dsp_exit);
83 MODULE_AUTHOR("Hiroshi DOYU");
84 MODULE_DESCRIPTION("TI's OMAP DSP platform device registration");
85 MODULE_LICENSE("GPL");