xref: /linux/arch/sh/boards/mach-rsk/devices-rsk7264.c (revision 597473720f4dc69749542bfcfed4a927a43d935e)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * RSK+SH7264 Support.
4  *
5  * Copyright (C) 2012 Renesas Electronics Europe
6  */
7 #include <linux/init.h>
8 #include <linux/types.h>
9 #include <linux/platform_device.h>
10 #include <linux/interrupt.h>
11 #include <linux/input.h>
12 #include <linux/smsc911x.h>
13 #include <asm/machvec.h>
14 #include <asm/io.h>
15 
16 static struct smsc911x_platform_config smsc911x_config = {
17 	.phy_interface	= PHY_INTERFACE_MODE_MII,
18 	.irq_polarity	= SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
19 	.irq_type	= SMSC911X_IRQ_TYPE_OPEN_DRAIN,
20 	.flags		= SMSC911X_USE_16BIT | SMSC911X_SWAP_FIFO,
21 };
22 
23 static struct resource smsc911x_resources[] = {
24 	[0] = {
25 		.start		= 0x28000000,
26 		.end		= 0x280000ff,
27 		.flags		= IORESOURCE_MEM,
28 	},
29 	[1] = {
30 		.start		= 65,
31 		.end		= 65,
32 		.flags		= IORESOURCE_IRQ,
33 	},
34 };
35 
36 static struct platform_device smsc911x_device = {
37 	.name		= "smsc911x",
38 	.id		= -1,
39 	.num_resources	= ARRAY_SIZE(smsc911x_resources),
40 	.resource	= smsc911x_resources,
41 	.dev		= {
42 		.platform_data = &smsc911x_config,
43 	},
44 };
45 
46 static struct platform_device *rsk7264_devices[] __initdata = {
47 	&smsc911x_device,
48 };
49 
rsk7264_devices_setup(void)50 static int __init rsk7264_devices_setup(void)
51 {
52 	return platform_add_devices(rsk7264_devices,
53 				    ARRAY_SIZE(rsk7264_devices));
54 }
55 device_initcall(rsk7264_devices_setup);
56