aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorMasakazu Mokuno <mokuno@sm.sony.co.jp>2008-07-16 17:22:19 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-21 20:39:33 -0400
commit059e4938f8b060b10c4352e6c45739473bc73267 (patch)
tree27bd214190ba1a42b45fade9bbae310c2369d6cb /arch/powerpc
parent6e5f1537833a9fc8251157dff403231f5c89a894 (diff)
powerpc/ps3: Add a sub-match id to ps3_system_bus
Add sub match id for ps3 system bus so that two different system bus devices can be connected to a shared device. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/ps3/device-init.c1
-rw-r--r--arch/powerpc/platforms/ps3/system-bus.c21
2 files changed, 15 insertions, 7 deletions
diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c
index 3866debfa3c4..ffdd8e963fbd 100644
--- a/arch/powerpc/platforms/ps3/device-init.c
+++ b/arch/powerpc/platforms/ps3/device-init.c
@@ -486,6 +486,7 @@ static int __init ps3_register_graphics_devices(void)
486 return -ENOMEM; 486 return -ENOMEM;
487 487
488 p->dev.match_id = PS3_MATCH_ID_GRAPHICS; 488 p->dev.match_id = PS3_MATCH_ID_GRAPHICS;
489 p->dev.match_sub_id = PS3_MATCH_SUB_ID_FB;
489 p->dev.dev_type = PS3_DEVICE_TYPE_IOC0; 490 p->dev.dev_type = PS3_DEVICE_TYPE_IOC0;
490 491
491 result = ps3_system_bus_device_register(&p->dev); 492 result = ps3_system_bus_device_register(&p->dev);
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index d66c3628a112..280ee88cb0b0 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -347,16 +347,23 @@ static int ps3_system_bus_match(struct device *_dev,
347 struct ps3_system_bus_driver *drv = ps3_drv_to_system_bus_drv(_drv); 347 struct ps3_system_bus_driver *drv = ps3_drv_to_system_bus_drv(_drv);
348 struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); 348 struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
349 349
350 result = dev->match_id == drv->match_id; 350 if (!dev->match_sub_id)
351 result = dev->match_id == drv->match_id;
352 else
353 result = dev->match_sub_id == drv->match_sub_id &&
354 dev->match_id == drv->match_id;
351 355
352 if (result) 356 if (result)
353 pr_info("%s:%d: dev=%u(%s), drv=%u(%s): match\n", __func__, 357 pr_info("%s:%d: dev=%u.%u(%s), drv=%u.%u(%s): match\n",
354 __LINE__, dev->match_id, dev->core.bus_id, 358 __func__, __LINE__,
355 drv->match_id, drv->core.name); 359 dev->match_id, dev->match_sub_id, dev->core.bus_id,
360 drv->match_id, drv->match_sub_id, drv->core.name);
356 else 361 else
357 pr_debug("%s:%d: dev=%u(%s), drv=%u(%s): miss\n", __func__, 362 pr_debug("%s:%d: dev=%u.%u(%s), drv=%u.%u(%s): miss\n",
358 __LINE__, dev->match_id, dev->core.bus_id, 363 __func__, __LINE__,
359 drv->match_id, drv->core.name); 364 dev->match_id, dev->match_sub_id, dev->core.bus_id,
365 drv->match_id, drv->match_sub_id, drv->core.name);
366
360 return result; 367 return result;
361} 368}
362 369