]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/platforms/ps3/system-bus.c
Merge branch 'linus' into x86/pebs
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / ps3 / system-bus.c
index 6405f4a36763b00df384c1db6153e6125db0d822..280ee88cb0b001c21449c18694d498a9c58e6de0 100644 (file)
@@ -42,8 +42,8 @@ struct {
        int gpu;
 } static usage_hack;
 
-static int ps3_is_device(struct ps3_system_bus_device *dev,
-                        unsigned int bus_id, unsigned int dev_id)
+static int ps3_is_device(struct ps3_system_bus_device *dev, u64 bus_id,
+                        u64 dev_id)
 {
        return dev->bus_id == bus_id && dev->dev_id == dev_id;
 }
@@ -182,8 +182,8 @@ int ps3_open_hv_device(struct ps3_system_bus_device *dev)
        case PS3_MATCH_ID_SYSTEM_MANAGER:
                pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
                        __LINE__, dev->match_id);
-               pr_debug("%s:%d: bus_id: %u\n", __func__,
-                       __LINE__, dev->bus_id);
+               pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__,
+                       dev->bus_id);
                BUG();
                return -EINVAL;
 
@@ -220,8 +220,8 @@ int ps3_close_hv_device(struct ps3_system_bus_device *dev)
        case PS3_MATCH_ID_SYSTEM_MANAGER:
                pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
                        __LINE__, dev->match_id);
-               pr_debug("%s:%d: bus_id: %u\n", __func__,
-                       __LINE__, dev->bus_id);
+               pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__,
+                       dev->bus_id);
                BUG();
                return -EINVAL;
 
@@ -240,7 +240,7 @@ EXPORT_SYMBOL_GPL(ps3_close_hv_device);
 static void _dump_mmio_region(const struct ps3_mmio_region* r,
        const char* func, int line)
 {
-       pr_debug("%s:%d: dev       %u:%u\n", func, line, r->dev->bus_id,
+       pr_debug("%s:%d: dev       %lu:%lu\n", func, line, r->dev->bus_id,
                r->dev->dev_id);
        pr_debug("%s:%d: bus_addr  %lxh\n", func, line, r->bus_addr);
        pr_debug("%s:%d: len       %lxh\n", func, line, r->len);
@@ -347,11 +347,23 @@ static int ps3_system_bus_match(struct device *_dev,
        struct ps3_system_bus_driver *drv = ps3_drv_to_system_bus_drv(_drv);
        struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
 
-       result = dev->match_id == drv->match_id;
+       if (!dev->match_sub_id)
+               result = dev->match_id == drv->match_id;
+       else
+               result = dev->match_sub_id == drv->match_sub_id &&
+                       dev->match_id == drv->match_id;
+
+       if (result)
+               pr_info("%s:%d: dev=%u.%u(%s), drv=%u.%u(%s): match\n",
+                       __func__, __LINE__,
+                       dev->match_id, dev->match_sub_id, dev->core.bus_id,
+                       drv->match_id, drv->match_sub_id, drv->core.name);
+       else
+               pr_debug("%s:%d: dev=%u.%u(%s), drv=%u.%u(%s): miss\n",
+                       __func__, __LINE__,
+                       dev->match_id, dev->match_sub_id, dev->core.bus_id,
+                       drv->match_id, drv->match_sub_id, drv->core.name);
 
-       pr_info("%s:%d: dev=%u(%s), drv=%u(%s): %s\n", __func__, __LINE__,
-               dev->match_id, dev->core.bus_id, drv->match_id, drv->core.name,
-               (result ? "match" : "miss"));
        return result;
 }
 
@@ -362,7 +374,7 @@ static int ps3_system_bus_probe(struct device *_dev)
        struct ps3_system_bus_driver *drv;
 
        BUG_ON(!dev);
-       pr_info(" -> %s:%d: %s\n", __func__, __LINE__, _dev->bus_id);
+       pr_debug(" -> %s:%d: %s\n", __func__, __LINE__, _dev->bus_id);
 
        drv = ps3_system_bus_dev_to_system_bus_drv(dev);
        BUG_ON(!drv);
@@ -370,10 +382,10 @@ static int ps3_system_bus_probe(struct device *_dev)
        if (drv->probe)
                result = drv->probe(dev);
        else
-               pr_info("%s:%d: %s no probe method\n", __func__, __LINE__,
+               pr_debug("%s:%d: %s no probe method\n", __func__, __LINE__,
                        dev->core.bus_id);
 
-       pr_info(" <- %s:%d: %s\n", __func__, __LINE__, dev->core.bus_id);
+       pr_debug(" <- %s:%d: %s\n", __func__, __LINE__, dev->core.bus_id);
        return result;
 }
 
@@ -384,7 +396,7 @@ static int ps3_system_bus_remove(struct device *_dev)
        struct ps3_system_bus_driver *drv;
 
        BUG_ON(!dev);
-       pr_info(" -> %s:%d: %s\n", __func__, __LINE__, _dev->bus_id);
+       pr_debug(" -> %s:%d: %s\n", __func__, __LINE__, _dev->bus_id);
 
        drv = ps3_system_bus_dev_to_system_bus_drv(dev);
        BUG_ON(!drv);
@@ -395,7 +407,7 @@ static int ps3_system_bus_remove(struct device *_dev)
                dev_dbg(&dev->core, "%s:%d %s: no remove method\n",
                        __func__, __LINE__, drv->core.name);
 
-       pr_info(" <- %s:%d: %s\n", __func__, __LINE__, dev->core.bus_id);
+       pr_debug(" <- %s:%d: %s\n", __func__, __LINE__, dev->core.bus_id);
        return result;
 }
 
@@ -550,7 +562,7 @@ static void ps3_free_coherent(struct device *_dev, size_t size, void *vaddr,
  */
 
 static dma_addr_t ps3_sb_map_single(struct device *_dev, void *ptr, size_t size,
-       enum dma_data_direction direction)
+       enum dma_data_direction direction, struct dma_attrs *attrs)
 {
        struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
        int result;
@@ -570,7 +582,8 @@ static dma_addr_t ps3_sb_map_single(struct device *_dev, void *ptr, size_t size,
 
 static dma_addr_t ps3_ioc0_map_single(struct device *_dev, void *ptr,
                                      size_t size,
-                                     enum dma_data_direction direction)
+                                     enum dma_data_direction direction,
+                                     struct dma_attrs *attrs)
 {
        struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
        int result;
@@ -603,7 +616,7 @@ static dma_addr_t ps3_ioc0_map_single(struct device *_dev, void *ptr,
 }
 
 static void ps3_unmap_single(struct device *_dev, dma_addr_t dma_addr,
-       size_t size, enum dma_data_direction direction)
+       size_t size, enum dma_data_direction direction, struct dma_attrs *attrs)
 {
        struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
        int result;
@@ -617,7 +630,7 @@ static void ps3_unmap_single(struct device *_dev, dma_addr_t dma_addr,
 }
 
 static int ps3_sb_map_sg(struct device *_dev, struct scatterlist *sgl,
-       int nents, enum dma_data_direction direction)
+       int nents, enum dma_data_direction direction, struct dma_attrs *attrs)
 {
 #if defined(CONFIG_PS3_DYNAMIC_DMA)
        BUG_ON("do");
@@ -646,14 +659,15 @@ static int ps3_sb_map_sg(struct device *_dev, struct scatterlist *sgl,
 
 static int ps3_ioc0_map_sg(struct device *_dev, struct scatterlist *sg,
                           int nents,
-                          enum dma_data_direction direction)
+                          enum dma_data_direction direction,
+                          struct dma_attrs *attrs)
 {
        BUG();
        return 0;
 }
 
 static void ps3_sb_unmap_sg(struct device *_dev, struct scatterlist *sg,
-       int nents, enum dma_data_direction direction)
+       int nents, enum dma_data_direction direction, struct dma_attrs *attrs)
 {
 #if defined(CONFIG_PS3_DYNAMIC_DMA)
        BUG_ON("do");
@@ -661,7 +675,8 @@ static void ps3_sb_unmap_sg(struct device *_dev, struct scatterlist *sg,
 }
 
 static void ps3_ioc0_unmap_sg(struct device *_dev, struct scatterlist *sg,
-                           int nents, enum dma_data_direction direction)
+                           int nents, enum dma_data_direction direction,
+                           struct dma_attrs *attrs)
 {
        BUG();
 }
@@ -715,6 +730,7 @@ int ps3_system_bus_device_register(struct ps3_system_bus_device *dev)
        static unsigned int dev_ioc0_count;
        static unsigned int dev_sb_count;
        static unsigned int dev_vuart_count;
+       static unsigned int dev_lpm_count;
 
        if (!dev->core.parent)
                dev->core.parent = &ps3_system_bus;
@@ -737,6 +753,10 @@ int ps3_system_bus_device_register(struct ps3_system_bus_device *dev)
                snprintf(dev->core.bus_id, sizeof(dev->core.bus_id),
                        "vuart_%02x", ++dev_vuart_count);
                break;
+       case PS3_DEVICE_TYPE_LPM:
+               snprintf(dev->core.bus_id, sizeof(dev->core.bus_id),
+                       "lpm_%02x", ++dev_lpm_count);
+               break;
        default:
                BUG();
        };