Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aca5e4aa authored by Michael Hennerich's avatar Michael Hennerich Committed by Bryan Wu
Browse files

Blackfin arch: add BF54x / BF52x Rotary Input device driver platform resource to board file

parent a5ac0129
Loading
Loading
Loading
Loading
+36 −0
Original line number Original line Diff line number Diff line
@@ -853,6 +853,38 @@ static struct platform_device bfin_device_gpiokeys = {
};
};
#endif
#endif


#if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
#include <linux/input.h>
#include <asm/bfin_rotary.h>

static struct bfin_rotary_platform_data bfin_rotary_data = {
	/*.rotary_up_key     = KEY_UP,*/
	/*.rotary_down_key   = KEY_DOWN,*/
	.rotary_rel_code   = REL_WHEEL,
	.rotary_button_key = KEY_ENTER,
	.debounce	   = 10,	/* 0..17 */
	.mode		   = ROT_QUAD_ENC | ROT_DEBE,
};

static struct resource bfin_rotary_resources[] = {
	{
		.start = IRQ_CNT,
		.end = IRQ_CNT,
		.flags = IORESOURCE_IRQ,
	},
};

static struct platform_device bfin_rotary_device = {
	.name		= "bfin-rotary",
	.id		= -1,
	.num_resources 	= ARRAY_SIZE(bfin_rotary_resources),
	.resource 	= bfin_rotary_resources,
	.dev		= {
		.platform_data = &bfin_rotary_data,
	},
};
#endif

static struct resource bfin_gpios_resources = {
static struct resource bfin_gpios_resources = {
	.start = 0,
	.start = 0,
	.end   = MAX_BLACKFIN_GPIOS - 1,
	.end   = MAX_BLACKFIN_GPIOS - 1,
@@ -969,6 +1001,10 @@ static struct platform_device *stamp_devices[] __initdata = {
	&bfin_device_gpiokeys,
	&bfin_device_gpiokeys,
#endif
#endif


#if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
	&bfin_rotary_device,
#endif

#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
	&ezkit_flash_device,
	&ezkit_flash_device,
#endif
#endif
+27 −0
Original line number Original line Diff line number Diff line
@@ -1840,6 +1840,33 @@


#define                 DPRESCALE  0xf        /* Load Counter Register */
#define                 DPRESCALE  0xf        /* Load Counter Register */


/* CNT_COMMAND bit field options */

#define W1LCNT_ZERO   0x0001   /* write 1 to load CNT_COUNTER with zero */
#define W1LCNT_MIN    0x0004   /* write 1 to load CNT_COUNTER from CNT_MIN */
#define W1LCNT_MAX    0x0008   /* write 1 to load CNT_COUNTER from CNT_MAX */

#define W1LMIN_ZERO   0x0010   /* write 1 to load CNT_MIN with zero */
#define W1LMIN_CNT    0x0020   /* write 1 to load CNT_MIN from CNT_COUNTER */
#define W1LMIN_MAX    0x0080   /* write 1 to load CNT_MIN from CNT_MAX */

#define W1LMAX_ZERO   0x0100   /* write 1 to load CNT_MAX with zero */
#define W1LMAX_CNT    0x0200   /* write 1 to load CNT_MAX from CNT_COUNTER */
#define W1LMAX_MIN    0x0400   /* write 1 to load CNT_MAX from CNT_MIN */

/* CNT_CONFIG bit field options */

#define CNTMODE_QUADENC  0x0000  /* quadrature encoder mode */
#define CNTMODE_BINENC   0x0100  /* binary encoder mode */
#define CNTMODE_UDCNT    0x0200  /* up/down counter mode */
#define CNTMODE_DIRCNT   0x0400  /* direction counter mode */
#define CNTMODE_DIRTMR   0x0500  /* direction timer mode */

#define BNDMODE_COMP     0x0000  /* boundary compare mode */
#define BNDMODE_ZERO     0x1000  /* boundary compare and zero mode */
#define BNDMODE_CAPT     0x2000  /* boundary capture mode */
#define BNDMODE_AEXT     0x3000  /* boundary auto-extend mode */

/* Bit masks for OTP_CONTROL */
/* Bit masks for OTP_CONTROL */


#define                FUSE_FADDR  0x1ff      /* OTP/Fuse Address */
#define                FUSE_FADDR  0x1ff      /* OTP/Fuse Address */
+4 −0
Original line number Original line Diff line number Diff line
@@ -67,6 +67,10 @@
#define P_UART1_RX	(P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(1))
#define P_UART1_RX	(P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(1))
#endif
#endif


#define P_CNT_CZM	(P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(3))
#define P_CNT_CDG	(P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(3))
#define P_CNT_CUD	(P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(3))

#define P_HWAIT		(P_DONTCARE)
#define P_HWAIT		(P_DONTCARE)


#define P_SPI0_SS	(P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0))
#define P_SPI0_SS	(P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0))
+35 −0
Original line number Original line Diff line number Diff line
@@ -183,6 +183,37 @@ static struct platform_device bf54x_kpad_device = {
};
};
#endif
#endif


#if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
#include <asm/bfin_rotary.h>

static struct bfin_rotary_platform_data bfin_rotary_data = {
	/*.rotary_up_key     = KEY_UP,*/
	/*.rotary_down_key   = KEY_DOWN,*/
	.rotary_rel_code   = REL_WHEEL,
	.rotary_button_key = KEY_ENTER,
	.debounce	   = 10,	/* 0..17 */
	.mode		   = ROT_QUAD_ENC | ROT_DEBE,
};

static struct resource bfin_rotary_resources[] = {
	{
		.start = IRQ_CNT,
		.end = IRQ_CNT,
		.flags = IORESOURCE_IRQ,
	},
};

static struct platform_device bfin_rotary_device = {
	.name		= "bfin-rotary",
	.id		= -1,
	.num_resources 	= ARRAY_SIZE(bfin_rotary_resources),
	.resource 	= bfin_rotary_resources,
	.dev		= {
		.platform_data = &bfin_rotary_data,
	},
};
#endif

#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
static struct platform_device rtc_device = {
static struct platform_device rtc_device = {
	.name = "rtc-bfin",
	.name = "rtc-bfin",
@@ -817,6 +848,10 @@ static struct platform_device *ezkit_devices[] __initdata = {
	&bf54x_kpad_device,
	&bf54x_kpad_device,
#endif
#endif


#if defined(CONFIG_JOYSTICK_BFIN_ROTARY) || defined(CONFIG_JOYSTICK_BFIN_ROTARY_MODULE)
	&bfin_rotary_device,
#endif

#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
	&i2c_bfin_twi0_device,
	&i2c_bfin_twi0_device,
#if !defined(CONFIG_BF542)
#if !defined(CONFIG_BF542)