Skip to content

Commit 3627335

Browse files
kishongregkh
authored andcommitted
ARM: OMAP: devices: create device for usb part of control module
A seperate driver has been added to handle the usb part of control module. A device for the above driver is created here, using the register address information to be used by the driver for powering on the PHY and for writing to the mailbox. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5b9479e commit 3627335

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

‎arch/arm/mach-omap2/devices.c‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/pinctrl/machine.h>
2121
#include <linux/platform_data/omap4-keypad.h>
2222
#include <linux/platform_data/omap_ocp2scp.h>
23+
#include <linux/usb/omap_control_usb.h>
2324

2425
#include <asm/mach-types.h>
2526
#include <asm/mach/map.h>
@@ -254,6 +255,49 @@ static inline void omap_init_camera(void)
254255
#endif
255256
}
256257

258+
#if IS_ENABLED(CONFIG_OMAP_CONTROL_USB)
259+
static struct omap_control_usb_platform_data omap4_control_usb_pdata = {
260+
.type = 1,
261+
};
262+
263+
struct resource omap4_control_usb_res[] = {
264+
{
265+
.name = "control_dev_conf",
266+
.start = 0x4a002300,
267+
.end = 0x4a002303,
268+
.flags = IORESOURCE_MEM,
269+
},
270+
{
271+
.name = "otghs_control",
272+
.start = 0x4a00233c,
273+
.end = 0x4a00233f,
274+
.flags = IORESOURCE_MEM,
275+
},
276+
};
277+
278+
static struct platform_device omap4_control_usb = {
279+
.name = "omap-control-usb",
280+
.id = -1,
281+
.dev = {
282+
.platform_data = &omap4_control_usb_pdata,
283+
},
284+
.num_resources = 2,
285+
.resource = omap4_control_usb_res,
286+
};
287+
288+
static inline void __init omap_init_control_usb(void)
289+
{
290+
if (!cpu_is_omap44xx())
291+
return;
292+
293+
if (platform_device_register(&omap4_control_usb))
294+
pr_err("Error registering omap_control_usb device\n");
295+
}
296+
297+
#else
298+
static inline void omap_init_control_usb(void) { }
299+
#endif /* CONFIG_OMAP_CONTROL_USB */
300+
257301
int __init omap4_keyboard_init(struct omap4_keypad_platform_data
258302
*sdp4430_keypad_data, struct omap_board_data *bdata)
259303
{
@@ -721,6 +765,7 @@ static int __init omap2_init_devices(void)
721765
omap_init_mbox();
722766
/* If dtb is there, the devices will be created dynamically */
723767
if (!of_have_populated_dt()) {
768+
omap_init_control_usb();
724769
omap_init_dmic();
725770
omap_init_mcpdm();
726771
omap_init_mcspi();

0 commit comments

Comments
 (0)