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

Commit e5c0fc41 authored by Russell King's avatar Russell King
Browse files

ARM: sa1111: change devid to be a bitmask



Change the sa1111 device id to be a bitmask.  This allows us to
specify the actual device, while allowing a single driver to bind
to both PS2 devices.

Acked-by: default avatarNicolas Pitre <nico@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 3259701c
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -158,7 +158,7 @@ static struct sa1111_dev_info sa1111_devices[] = {
	{
	{
		.offset		= SA1111_KBD,
		.offset		= SA1111_KBD,
		.skpcr_mask	= SKPCR_PTCLKEN,
		.skpcr_mask	= SKPCR_PTCLKEN,
		.devid		= SA1111_DEVID_PS2,
		.devid		= SA1111_DEVID_PS2_KBD,
		.irq = {
		.irq = {
			IRQ_TPRXINT,
			IRQ_TPRXINT,
			IRQ_TPTXINT
			IRQ_TPTXINT
@@ -167,7 +167,7 @@ static struct sa1111_dev_info sa1111_devices[] = {
	{
	{
		.offset		= SA1111_MSE,
		.offset		= SA1111_MSE,
		.skpcr_mask	= SKPCR_PMCLKEN,
		.skpcr_mask	= SKPCR_PMCLKEN,
		.devid		= SA1111_DEVID_PS2,
		.devid		= SA1111_DEVID_PS2_MSE,
		.irq = {
		.irq = {
			IRQ_MSRXINT,
			IRQ_MSRXINT,
			IRQ_MSTXINT
			IRQ_MSTXINT
@@ -835,12 +835,12 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
	has_devs = ~0;
	has_devs = ~0;
	if (machine_is_assabet() || machine_is_jornada720() ||
	if (machine_is_assabet() || machine_is_jornada720() ||
	    machine_is_badge4())
	    machine_is_badge4())
		has_devs &= ~(1 << 4);
		has_devs &= ~SA1111_DEVID_PS2_MSE;
	else
	else
		has_devs &= ~(1 << 1);
		has_devs &= ~SA1111_DEVID_SAC;


	for (i = 0; i < ARRAY_SIZE(sa1111_devices); i++)
	for (i = 0; i < ARRAY_SIZE(sa1111_devices); i++)
		if (has_devs & (1 << i))
		if (sa1111_devices[i].devid & has_devs)
			sa1111_init_one_child(sachip, mem, &sa1111_devices[i]);
			sa1111_init_one_child(sachip, mem, &sa1111_devices[i]);


	return 0;
	return 0;
@@ -1335,7 +1335,7 @@ static int sa1111_match(struct device *_dev, struct device_driver *_drv)
	struct sa1111_dev *dev = SA1111_DEV(_dev);
	struct sa1111_dev *dev = SA1111_DEV(_dev);
	struct sa1111_driver *drv = SA1111_DRV(_drv);
	struct sa1111_driver *drv = SA1111_DRV(_drv);


	return dev->devid == drv->devid;
	return dev->devid & drv->devid;
}
}


static int sa1111_bus_suspend(struct device *dev, pm_message_t state)
static int sa1111_bus_suspend(struct device *dev, pm_message_t state)
+11 −9
Original line number Original line Diff line number Diff line
@@ -516,15 +516,17 @@


extern struct bus_type sa1111_bus_type;
extern struct bus_type sa1111_bus_type;


#define SA1111_DEVID_SBI	0
#define SA1111_DEVID_SBI	(1 << 0)
#define SA1111_DEVID_SK		1
#define SA1111_DEVID_SK		(1 << 1)
#define SA1111_DEVID_USB	2
#define SA1111_DEVID_USB	(1 << 2)
#define SA1111_DEVID_SAC	3
#define SA1111_DEVID_SAC	(1 << 3)
#define SA1111_DEVID_SSP	4
#define SA1111_DEVID_SSP	(1 << 4)
#define SA1111_DEVID_PS2	5
#define SA1111_DEVID_PS2	(3 << 5)
#define SA1111_DEVID_GPIO	6
#define SA1111_DEVID_PS2_KBD	(1 << 5)
#define SA1111_DEVID_INT	7
#define SA1111_DEVID_PS2_MSE	(1 << 6)
#define SA1111_DEVID_PCMCIA	8
#define SA1111_DEVID_GPIO	(1 << 7)
#define SA1111_DEVID_INT	(1 << 8)
#define SA1111_DEVID_PCMCIA	(1 << 9)


struct sa1111_dev {
struct sa1111_dev {
	struct device	dev;
	struct device	dev;