diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-04 18:51:45 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-04 18:51:45 -0400 |
| commit | 74b9272bbedf45cb01a048217830d64d59aaa73b (patch) | |
| tree | 11cf66b529d4861edd03d16f97c8178e9cfd9f77 | |
| parent | f5b63ac0f77ecab46796ba5d368ea5dd51834e6e (diff) | |
| parent | 6dd18e4684f3d188277bbbc27545248487472108 (diff) | |
Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux
Pull device tree updates from Grant Likely:
"This branch contains the following changes:
- Removal of CONFIG_OF_DEVICE, it is always enabled by CONFIG_OF
- Remove #ifdef from linux/of_platform.h to increase compiler syntax
coverage
- Bug fix for address decoding on Bimini and js2x powerpc platforms.
- miscellaneous binding changes
One note on the above. The binding changes going in from all kinds of
different trees has gotten rather out of hand. I picked up some
during this cycle, but even going though my tree isn't a great fit.
Ian Campbell has prototyped splitting the bindings and .dtb files into
a separate repository. The plan is to migrate to using that sometime
in the next few kernel releases which should get rid of a lot of the
churn on binding docs and .dts files"
* tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux:
of: Fix address decoding on Bimini and js2x machines
of: remove CONFIG_OF_DEVICE
usb: chipidea: depend on CONFIG_OF instead of CONFIG_OF_DEVICE
of: remove of_platform_driver
ibmebus: convert of_platform_driver to platform_driver
driver core: move to_platform_driver to platform_device.h
mfd: DT bindings for the palmas family MFD
ARM: dts: omap3-devkit8000: fix NAND memory binding
of/base: fix typos
of: remove #ifdef from linux/of_platform.h
| -rw-r--r-- | Documentation/devicetree/bindings/mfd/palmas.txt | 49 | ||||
| -rw-r--r-- | Documentation/devicetree/bindings/regulator/palmas-pmic.txt | 72 | ||||
| -rw-r--r-- | arch/arm/boot/dts/omap3-devkit8000.dts | 29 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/ibmebus.h | 4 | ||||
| -rw-r--r-- | arch/powerpc/kernel/ibmebus.c | 22 | ||||
| -rw-r--r-- | drivers/base/platform.c | 3 | ||||
| -rw-r--r-- | drivers/infiniband/hw/ehca/ehca_main.c | 5 | ||||
| -rw-r--r-- | drivers/net/ethernet/ibm/ehea/ehea_main.c | 8 | ||||
| -rw-r--r-- | drivers/of/Kconfig | 3 | ||||
| -rw-r--r-- | drivers/of/Makefile | 3 | ||||
| -rw-r--r-- | drivers/of/address.c | 8 | ||||
| -rw-r--r-- | drivers/of/base.c | 12 | ||||
| -rw-r--r-- | drivers/usb/chipidea/Makefile | 2 | ||||
| -rw-r--r-- | include/linux/of_device.h | 6 | ||||
| -rw-r--r-- | include/linux/of_platform.h | 35 | ||||
| -rw-r--r-- | include/linux/platform_device.h | 3 |
16 files changed, 176 insertions, 88 deletions
diff --git a/Documentation/devicetree/bindings/mfd/palmas.txt b/Documentation/devicetree/bindings/mfd/palmas.txt new file mode 100644 index 000000000000..892537d1a48f --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/palmas.txt | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | * palmas device tree bindings | ||
| 2 | |||
| 3 | The TI palmas family current members :- | ||
| 4 | twl6035 (palmas) | ||
| 5 | twl6037 (palmas) | ||
| 6 | tps65913 (palmas) | ||
| 7 | tps65914 (palmas) | ||
| 8 | |||
| 9 | Required properties: | ||
| 10 | - compatible : Should be from the list | ||
| 11 | ti,twl6035 | ||
| 12 | ti,twl6036 | ||
| 13 | ti,twl6037 | ||
| 14 | ti,tps65913 | ||
| 15 | ti,tps65914 | ||
| 16 | ti,tps80036 | ||
| 17 | and also the generic series names | ||
| 18 | ti,palmas | ||
| 19 | - interrupt-controller : palmas has its own internal IRQs | ||
| 20 | - #interrupt-cells : should be set to 2 for IRQ number and flags | ||
| 21 | The first cell is the IRQ number. | ||
| 22 | The second cell is the flags, encoded as the trigger masks from | ||
| 23 | Documentation/devicetree/bindings/interrupts.txt | ||
| 24 | - interrupt-parent : The parent interrupt controller. | ||
| 25 | |||
| 26 | Optional properties: | ||
| 27 | ti,mux-padX : set the pad register X (1-2) to the correct muxing for the | ||
| 28 | hardware, if not set will use muxing in OTP. | ||
| 29 | |||
| 30 | Example: | ||
| 31 | |||
| 32 | palmas { | ||
| 33 | compatible = "ti,twl6035", "ti,palmas"; | ||
| 34 | reg = <0x48> | ||
| 35 | interrupt-parent = <&intc>; | ||
| 36 | interrupt-controller; | ||
| 37 | #interrupt-cells = <2>; | ||
| 38 | |||
| 39 | ti,mux-pad1 = <0>; | ||
| 40 | ti,mux-pad2 = <0>; | ||
| 41 | |||
| 42 | #address-cells = <1>; | ||
| 43 | #size-cells = <0>; | ||
| 44 | |||
| 45 | pmic { | ||
| 46 | compatible = "ti,twl6035-pmic", "ti,palmas-pmic"; | ||
| 47 | .... | ||
| 48 | }; | ||
| 49 | } | ||
diff --git a/Documentation/devicetree/bindings/regulator/palmas-pmic.txt b/Documentation/devicetree/bindings/regulator/palmas-pmic.txt new file mode 100644 index 000000000000..d5a308629c57 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/palmas-pmic.txt | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | * palmas regulator IP block devicetree bindings | ||
| 2 | |||
| 3 | Required properties: | ||
| 4 | - compatible : Should be from the list | ||
| 5 | ti,twl6035-pmic | ||
| 6 | ti,twl6036-pmic | ||
| 7 | ti,twl6037-pmic | ||
| 8 | ti,tps65913-pmic | ||
| 9 | ti,tps65914-pmic | ||
| 10 | and also the generic series names | ||
| 11 | ti,palmas-pmic | ||
| 12 | - interrupt-parent : The parent interrupt controller which is palmas. | ||
| 13 | - interrupts : The interrupt number and the type which can be looked up here: | ||
| 14 | arch/arm/boot/dts/include/dt-bindings/interrupt-controller/irq.h | ||
| 15 | - interrupts-name: The names of the individual interrupts. | ||
| 16 | |||
| 17 | Optional properties: | ||
| 18 | - ti,ldo6-vibrator : ldo6 is in vibrator mode | ||
| 19 | |||
| 20 | Optional nodes: | ||
| 21 | - regulators : Must contain a sub-node per regulator from the list below. | ||
| 22 | Each sub-node should contain the constraints and initialization | ||
| 23 | information for that regulator. See regulator.txt for a | ||
| 24 | description of standard properties for these sub-nodes. | ||
| 25 | Additional custom properties are listed below. | ||
| 26 | |||
| 27 | For ti,palmas-pmic - smps12, smps123, smps3 depending on OTP, | ||
| 28 | smps45, smps457, smps7 depending on variant, smps6, smps[8-10], | ||
| 29 | ldo[1-9], ldoln, ldousb. | ||
| 30 | |||
| 31 | Optional sub-node properties: | ||
| 32 | ti,warm-reset - maintain voltage during warm reset(boolean) | ||
| 33 | ti,roof-floor - control voltage selection by pin(boolean) | ||
| 34 | ti,sleep-mode - mode to adopt in pmic sleep 0 - off, 1 - auto, | ||
| 35 | 2 - eco, 3 - forced pwm | ||
| 36 | ti,tstep - slope control 0 - Jump, 1 10mV/us, 2 5mV/us, 3 2.5mV/us | ||
| 37 | ti,smps-range - OTP has the wrong range set for the hardware so override | ||
| 38 | 0 - low range, 1 - high range. | ||
| 39 | |||
| 40 | Example: | ||
| 41 | |||
| 42 | #include <dt-bindings/interrupt-controller/irq.h> | ||
| 43 | |||
| 44 | pmic { | ||
| 45 | compatible = "ti,twl6035-pmic", "ti,palmas-pmic"; | ||
| 46 | interrupt-parent = <&palmas>; | ||
| 47 | interrupts = <14 IRQ_TYPE_NONE>; | ||
| 48 | interrupts-name = "short-irq"; | ||
| 49 | |||
| 50 | ti,ldo6-vibrator; | ||
| 51 | |||
| 52 | regulators { | ||
| 53 | smps12_reg : smps12 { | ||
| 54 | regulator-name = "smps12"; | ||
| 55 | regulator-min-microvolt = < 600000>; | ||
| 56 | regulator-max-microvolt = <1500000>; | ||
| 57 | regulator-always-on; | ||
| 58 | regulator-boot-on; | ||
| 59 | ti,warm-reset; | ||
| 60 | ti,roof-floor; | ||
| 61 | ti,mode-sleep = <0>; | ||
| 62 | ti,tstep = <0>; | ||
| 63 | ti,smps-range = <1>; | ||
| 64 | }; | ||
| 65 | |||
| 66 | ldo1_reg: ldo1 { | ||
| 67 | regulator-name = "ldo1"; | ||
| 68 | regulator-min-microvolt = <2800000>; | ||
| 69 | regulator-max-microvolt = <2800000>; | ||
| 70 | }; | ||
| 71 | }; | ||
| 72 | }; | ||
diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index af32eff9f4b7..7ef282795dd4 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts | |||
| @@ -124,20 +124,21 @@ | |||
| 124 | reg = <0 0 0>; /* CS0, offset 0 */ | 124 | reg = <0 0 0>; /* CS0, offset 0 */ |
| 125 | nand-bus-width = <16>; | 125 | nand-bus-width = <16>; |
| 126 | 126 | ||
| 127 | gpmc,sync-clk = <0>; | 127 | gpmc,device-nand; |
| 128 | gpmc,cs-on = <0>; | 128 | gpmc,sync-clki-ps = <0>; |
| 129 | gpmc,cs-rd-off = <44>; | 129 | gpmc,cs-on-ns = <0>; |
| 130 | gpmc,cs-wr-off = <44>; | 130 | gpmc,cs-rd-off-ns = <44>; |
| 131 | gpmc,adv-on = <6>; | 131 | gpmc,cs-wr-off-ns = <44>; |
| 132 | gpmc,adv-rd-off = <34>; | 132 | gpmc,adv-on-ns = <6>; |
| 133 | gpmc,adv-wr-off = <44>; | 133 | gpmc,adv-rd-off-ns = <34>; |
| 134 | gpmc,we-off = <40>; | 134 | gpmc,adv-wr-off-ns = <44>; |
| 135 | gpmc,oe-off = <54>; | 135 | gpmc,we-off-ns = <40>; |
| 136 | gpmc,access = <64>; | 136 | gpmc,oe-off-ns = <54>; |
| 137 | gpmc,rd-cycle = <82>; | 137 | gpmc,access-ns = <64>; |
| 138 | gpmc,wr-cycle = <82>; | 138 | gpmc,rd-cycle-ns = <82>; |
| 139 | gpmc,wr-access = <40>; | 139 | gpmc,wr-cycle-ns = <82>; |
| 140 | gpmc,wr-data-mux-bus = <0>; | 140 | gpmc,wr-access-ns = <40>; |
| 141 | gpmc,wr-data-mux-bus-ns = <0>; | ||
| 141 | 142 | ||
| 142 | #address-cells = <1>; | 143 | #address-cells = <1>; |
| 143 | #size-cells = <1>; | 144 | #size-cells = <1>; |
diff --git a/arch/powerpc/include/asm/ibmebus.h b/arch/powerpc/include/asm/ibmebus.h index 1a9d9aea21fa..088f95b2e14f 100644 --- a/arch/powerpc/include/asm/ibmebus.h +++ b/arch/powerpc/include/asm/ibmebus.h | |||
| @@ -48,8 +48,8 @@ | |||
| 48 | 48 | ||
| 49 | extern struct bus_type ibmebus_bus_type; | 49 | extern struct bus_type ibmebus_bus_type; |
| 50 | 50 | ||
| 51 | int ibmebus_register_driver(struct of_platform_driver *drv); | 51 | int ibmebus_register_driver(struct platform_driver *drv); |
| 52 | void ibmebus_unregister_driver(struct of_platform_driver *drv); | 52 | void ibmebus_unregister_driver(struct platform_driver *drv); |
| 53 | 53 | ||
| 54 | int ibmebus_request_irq(u32 ist, irq_handler_t handler, | 54 | int ibmebus_request_irq(u32 ist, irq_handler_t handler, |
| 55 | unsigned long irq_flags, const char *devname, | 55 | unsigned long irq_flags, const char *devname, |
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index 8220baa46faf..16a7c2326d48 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c | |||
| @@ -205,7 +205,7 @@ static int ibmebus_create_devices(const struct of_device_id *matches) | |||
| 205 | return ret; | 205 | return ret; |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | int ibmebus_register_driver(struct of_platform_driver *drv) | 208 | int ibmebus_register_driver(struct platform_driver *drv) |
| 209 | { | 209 | { |
| 210 | /* If the driver uses devices that ibmebus doesn't know, add them */ | 210 | /* If the driver uses devices that ibmebus doesn't know, add them */ |
| 211 | ibmebus_create_devices(drv->driver.of_match_table); | 211 | ibmebus_create_devices(drv->driver.of_match_table); |
| @@ -215,7 +215,7 @@ int ibmebus_register_driver(struct of_platform_driver *drv) | |||
| 215 | } | 215 | } |
| 216 | EXPORT_SYMBOL(ibmebus_register_driver); | 216 | EXPORT_SYMBOL(ibmebus_register_driver); |
| 217 | 217 | ||
| 218 | void ibmebus_unregister_driver(struct of_platform_driver *drv) | 218 | void ibmebus_unregister_driver(struct platform_driver *drv) |
| 219 | { | 219 | { |
| 220 | driver_unregister(&drv->driver); | 220 | driver_unregister(&drv->driver); |
| 221 | } | 221 | } |
| @@ -338,11 +338,10 @@ static int ibmebus_bus_bus_match(struct device *dev, struct device_driver *drv) | |||
| 338 | static int ibmebus_bus_device_probe(struct device *dev) | 338 | static int ibmebus_bus_device_probe(struct device *dev) |
| 339 | { | 339 | { |
| 340 | int error = -ENODEV; | 340 | int error = -ENODEV; |
| 341 | struct of_platform_driver *drv; | 341 | struct platform_driver *drv; |
| 342 | struct platform_device *of_dev; | 342 | struct platform_device *of_dev; |
| 343 | const struct of_device_id *match; | ||
| 344 | 343 | ||
| 345 | drv = to_of_platform_driver(dev->driver); | 344 | drv = to_platform_driver(dev->driver); |
| 346 | of_dev = to_platform_device(dev); | 345 | of_dev = to_platform_device(dev); |
| 347 | 346 | ||
| 348 | if (!drv->probe) | 347 | if (!drv->probe) |
| @@ -350,9 +349,8 @@ static int ibmebus_bus_device_probe(struct device *dev) | |||
| 350 | 349 | ||
| 351 | of_dev_get(of_dev); | 350 | of_dev_get(of_dev); |
| 352 | 351 | ||
| 353 | match = of_match_device(drv->driver.of_match_table, dev); | 352 | if (of_driver_match_device(dev, dev->driver)) |
| 354 | if (match) | 353 | error = drv->probe(of_dev); |
| 355 | error = drv->probe(of_dev, match); | ||
| 356 | if (error) | 354 | if (error) |
| 357 | of_dev_put(of_dev); | 355 | of_dev_put(of_dev); |
| 358 | 356 | ||
| @@ -362,7 +360,7 @@ static int ibmebus_bus_device_probe(struct device *dev) | |||
| 362 | static int ibmebus_bus_device_remove(struct device *dev) | 360 | static int ibmebus_bus_device_remove(struct device *dev) |
| 363 | { | 361 | { |
| 364 | struct platform_device *of_dev = to_platform_device(dev); | 362 | struct platform_device *of_dev = to_platform_device(dev); |
| 365 | struct of_platform_driver *drv = to_of_platform_driver(dev->driver); | 363 | struct platform_driver *drv = to_platform_driver(dev->driver); |
| 366 | 364 | ||
| 367 | if (dev->driver && drv->remove) | 365 | if (dev->driver && drv->remove) |
| 368 | drv->remove(of_dev); | 366 | drv->remove(of_dev); |
| @@ -372,7 +370,7 @@ static int ibmebus_bus_device_remove(struct device *dev) | |||
| 372 | static void ibmebus_bus_device_shutdown(struct device *dev) | 370 | static void ibmebus_bus_device_shutdown(struct device *dev) |
| 373 | { | 371 | { |
| 374 | struct platform_device *of_dev = to_platform_device(dev); | 372 | struct platform_device *of_dev = to_platform_device(dev); |
| 375 | struct of_platform_driver *drv = to_of_platform_driver(dev->driver); | 373 | struct platform_driver *drv = to_platform_driver(dev->driver); |
| 376 | 374 | ||
| 377 | if (dev->driver && drv->shutdown) | 375 | if (dev->driver && drv->shutdown) |
| 378 | drv->shutdown(of_dev); | 376 | drv->shutdown(of_dev); |
| @@ -419,7 +417,7 @@ struct device_attribute ibmebus_bus_device_attrs[] = { | |||
| 419 | static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg) | 417 | static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg) |
| 420 | { | 418 | { |
| 421 | struct platform_device *of_dev = to_platform_device(dev); | 419 | struct platform_device *of_dev = to_platform_device(dev); |
| 422 | struct of_platform_driver *drv = to_of_platform_driver(dev->driver); | 420 | struct platform_driver *drv = to_platform_driver(dev->driver); |
| 423 | int ret = 0; | 421 | int ret = 0; |
| 424 | 422 | ||
| 425 | if (dev->driver && drv->suspend) | 423 | if (dev->driver && drv->suspend) |
| @@ -430,7 +428,7 @@ static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg) | |||
| 430 | static int ibmebus_bus_legacy_resume(struct device *dev) | 428 | static int ibmebus_bus_legacy_resume(struct device *dev) |
| 431 | { | 429 | { |
| 432 | struct platform_device *of_dev = to_platform_device(dev); | 430 | struct platform_device *of_dev = to_platform_device(dev); |
| 433 | struct of_platform_driver *drv = to_of_platform_driver(dev->driver); | 431 | struct platform_driver *drv = to_platform_driver(dev->driver); |
| 434 | int ret = 0; | 432 | int ret = 0; |
| 435 | 433 | ||
| 436 | if (dev->driver && drv->resume) | 434 | if (dev->driver && drv->resume) |
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 6eaa7ab9e4bc..15789875128e 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
| @@ -29,9 +29,6 @@ | |||
| 29 | /* For automatically allocated device IDs */ | 29 | /* For automatically allocated device IDs */ |
| 30 | static DEFINE_IDA(platform_devid_ida); | 30 | static DEFINE_IDA(platform_devid_ida); |
| 31 | 31 | ||
| 32 | #define to_platform_driver(drv) (container_of((drv), struct platform_driver, \ | ||
| 33 | driver)) | ||
| 34 | |||
| 35 | struct device platform_bus = { | 32 | struct device platform_bus = { |
| 36 | .init_name = "platform", | 33 | .init_name = "platform", |
| 37 | }; | 34 | }; |
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index f8a62918a88d..982e3efd98d3 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c | |||
| @@ -713,8 +713,7 @@ static struct attribute_group ehca_dev_attr_grp = { | |||
| 713 | .attrs = ehca_dev_attrs | 713 | .attrs = ehca_dev_attrs |
| 714 | }; | 714 | }; |
| 715 | 715 | ||
| 716 | static int ehca_probe(struct platform_device *dev, | 716 | static int ehca_probe(struct platform_device *dev) |
| 717 | const struct of_device_id *id) | ||
| 718 | { | 717 | { |
| 719 | struct ehca_shca *shca; | 718 | struct ehca_shca *shca; |
| 720 | const u64 *handle; | 719 | const u64 *handle; |
| @@ -937,7 +936,7 @@ static struct of_device_id ehca_device_table[] = | |||
| 937 | }; | 936 | }; |
| 938 | MODULE_DEVICE_TABLE(of, ehca_device_table); | 937 | MODULE_DEVICE_TABLE(of, ehca_device_table); |
| 939 | 938 | ||
| 940 | static struct of_platform_driver ehca_driver = { | 939 | static struct platform_driver ehca_driver = { |
| 941 | .probe = ehca_probe, | 940 | .probe = ehca_probe, |
| 942 | .remove = ehca_remove, | 941 | .remove = ehca_remove, |
| 943 | .driver = { | 942 | .driver = { |
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index 90ea0b1673ca..de2969cae262 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c | |||
| @@ -98,8 +98,7 @@ static struct ehea_fw_handle_array ehea_fw_handles; | |||
| 98 | static struct ehea_bcmc_reg_array ehea_bcmc_regs; | 98 | static struct ehea_bcmc_reg_array ehea_bcmc_regs; |
| 99 | 99 | ||
| 100 | 100 | ||
| 101 | static int ehea_probe_adapter(struct platform_device *dev, | 101 | static int ehea_probe_adapter(struct platform_device *dev); |
| 102 | const struct of_device_id *id); | ||
| 103 | 102 | ||
| 104 | static int ehea_remove(struct platform_device *dev); | 103 | static int ehea_remove(struct platform_device *dev); |
| 105 | 104 | ||
| @@ -112,7 +111,7 @@ static struct of_device_id ehea_device_table[] = { | |||
| 112 | }; | 111 | }; |
| 113 | MODULE_DEVICE_TABLE(of, ehea_device_table); | 112 | MODULE_DEVICE_TABLE(of, ehea_device_table); |
| 114 | 113 | ||
| 115 | static struct of_platform_driver ehea_driver = { | 114 | static struct platform_driver ehea_driver = { |
| 116 | .driver = { | 115 | .driver = { |
| 117 | .name = "ehea", | 116 | .name = "ehea", |
| 118 | .owner = THIS_MODULE, | 117 | .owner = THIS_MODULE, |
| @@ -3251,8 +3250,7 @@ static void ehea_remove_device_sysfs(struct platform_device *dev) | |||
| 3251 | device_remove_file(&dev->dev, &dev_attr_remove_port); | 3250 | device_remove_file(&dev->dev, &dev_attr_remove_port); |
| 3252 | } | 3251 | } |
| 3253 | 3252 | ||
| 3254 | static int ehea_probe_adapter(struct platform_device *dev, | 3253 | static int ehea_probe_adapter(struct platform_device *dev) |
| 3255 | const struct of_device_id *id) | ||
| 3256 | { | 3254 | { |
| 3257 | struct ehea_adapter *adapter; | 3255 | struct ehea_adapter *adapter; |
| 3258 | const u64 *adapter_handle; | 3256 | const u64 *adapter_handle; |
diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig index d37bfcf5a3a2..80e5c13b930d 100644 --- a/drivers/of/Kconfig +++ b/drivers/of/Kconfig | |||
| @@ -48,9 +48,6 @@ config OF_IRQ | |||
| 48 | def_bool y | 48 | def_bool y |
| 49 | depends on !SPARC | 49 | depends on !SPARC |
| 50 | 50 | ||
| 51 | config OF_DEVICE | ||
| 52 | def_bool y | ||
| 53 | |||
| 54 | config OF_I2C | 51 | config OF_I2C |
| 55 | def_tristate I2C | 52 | def_tristate I2C |
| 56 | depends on I2C | 53 | depends on I2C |
diff --git a/drivers/of/Makefile b/drivers/of/Makefile index e027f444d10c..1f9c0c492ef9 100644 --- a/drivers/of/Makefile +++ b/drivers/of/Makefile | |||
| @@ -1,9 +1,8 @@ | |||
| 1 | obj-y = base.o | 1 | obj-y = base.o device.o platform.o |
| 2 | obj-$(CONFIG_OF_FLATTREE) += fdt.o | 2 | obj-$(CONFIG_OF_FLATTREE) += fdt.o |
| 3 | obj-$(CONFIG_OF_PROMTREE) += pdt.o | 3 | obj-$(CONFIG_OF_PROMTREE) += pdt.o |
| 4 | obj-$(CONFIG_OF_ADDRESS) += address.o | 4 | obj-$(CONFIG_OF_ADDRESS) += address.o |
| 5 | obj-$(CONFIG_OF_IRQ) += irq.o | 5 | obj-$(CONFIG_OF_IRQ) += irq.o |
| 6 | obj-$(CONFIG_OF_DEVICE) += device.o platform.o | ||
| 7 | obj-$(CONFIG_OF_I2C) += of_i2c.o | 6 | obj-$(CONFIG_OF_I2C) += of_i2c.o |
| 8 | obj-$(CONFIG_OF_NET) += of_net.o | 7 | obj-$(CONFIG_OF_NET) += of_net.o |
| 9 | obj-$(CONFIG_OF_SELFTEST) += selftest.o | 8 | obj-$(CONFIG_OF_SELFTEST) += selftest.o |
diff --git a/drivers/of/address.c b/drivers/of/address.c index fdd0636a987d..b55c21890760 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c | |||
| @@ -106,8 +106,12 @@ static unsigned int of_bus_default_get_flags(const __be32 *addr) | |||
| 106 | 106 | ||
| 107 | static int of_bus_pci_match(struct device_node *np) | 107 | static int of_bus_pci_match(struct device_node *np) |
| 108 | { | 108 | { |
| 109 | /* "vci" is for the /chaos bridge on 1st-gen PCI powermacs */ | 109 | /* |
| 110 | return !strcmp(np->type, "pci") || !strcmp(np->type, "vci"); | 110 | * "vci" is for the /chaos bridge on 1st-gen PCI powermacs |
| 111 | * "ht" is hypertransport | ||
| 112 | */ | ||
| 113 | return !strcmp(np->type, "pci") || !strcmp(np->type, "vci") || | ||
| 114 | !strcmp(np->type, "ht"); | ||
| 111 | } | 115 | } |
| 112 | 116 | ||
| 113 | static void of_bus_pci_count_cells(struct device_node *np, | 117 | static void of_bus_pci_count_cells(struct device_node *np, |
diff --git a/drivers/of/base.c b/drivers/of/base.c index a6f584a7f4a1..5c5427918eb2 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
| @@ -812,7 +812,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u32_index); | |||
| 812 | * | 812 | * |
| 813 | * @np: device node from which the property value is to be read. | 813 | * @np: device node from which the property value is to be read. |
| 814 | * @propname: name of the property to be searched. | 814 | * @propname: name of the property to be searched. |
| 815 | * @out_value: pointer to return value, modified only if return value is 0. | 815 | * @out_values: pointer to return value, modified only if return value is 0. |
| 816 | * @sz: number of array elements to read | 816 | * @sz: number of array elements to read |
| 817 | * | 817 | * |
| 818 | * Search for a property in a device node and read 8-bit value(s) from | 818 | * Search for a property in a device node and read 8-bit value(s) from |
| @@ -823,7 +823,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u32_index); | |||
| 823 | * dts entry of array should be like: | 823 | * dts entry of array should be like: |
| 824 | * property = /bits/ 8 <0x50 0x60 0x70>; | 824 | * property = /bits/ 8 <0x50 0x60 0x70>; |
| 825 | * | 825 | * |
| 826 | * The out_value is modified only if a valid u8 value can be decoded. | 826 | * The out_values is modified only if a valid u8 value can be decoded. |
| 827 | */ | 827 | */ |
| 828 | int of_property_read_u8_array(const struct device_node *np, | 828 | int of_property_read_u8_array(const struct device_node *np, |
| 829 | const char *propname, u8 *out_values, size_t sz) | 829 | const char *propname, u8 *out_values, size_t sz) |
| @@ -845,7 +845,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u8_array); | |||
| 845 | * | 845 | * |
| 846 | * @np: device node from which the property value is to be read. | 846 | * @np: device node from which the property value is to be read. |
| 847 | * @propname: name of the property to be searched. | 847 | * @propname: name of the property to be searched. |
| 848 | * @out_value: pointer to return value, modified only if return value is 0. | 848 | * @out_values: pointer to return value, modified only if return value is 0. |
| 849 | * @sz: number of array elements to read | 849 | * @sz: number of array elements to read |
| 850 | * | 850 | * |
| 851 | * Search for a property in a device node and read 16-bit value(s) from | 851 | * Search for a property in a device node and read 16-bit value(s) from |
| @@ -856,7 +856,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u8_array); | |||
| 856 | * dts entry of array should be like: | 856 | * dts entry of array should be like: |
| 857 | * property = /bits/ 16 <0x5000 0x6000 0x7000>; | 857 | * property = /bits/ 16 <0x5000 0x6000 0x7000>; |
| 858 | * | 858 | * |
| 859 | * The out_value is modified only if a valid u16 value can be decoded. | 859 | * The out_values is modified only if a valid u16 value can be decoded. |
| 860 | */ | 860 | */ |
| 861 | int of_property_read_u16_array(const struct device_node *np, | 861 | int of_property_read_u16_array(const struct device_node *np, |
| 862 | const char *propname, u16 *out_values, size_t sz) | 862 | const char *propname, u16 *out_values, size_t sz) |
| @@ -879,7 +879,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u16_array); | |||
| 879 | * | 879 | * |
| 880 | * @np: device node from which the property value is to be read. | 880 | * @np: device node from which the property value is to be read. |
| 881 | * @propname: name of the property to be searched. | 881 | * @propname: name of the property to be searched. |
| 882 | * @out_value: pointer to return value, modified only if return value is 0. | 882 | * @out_values: pointer to return value, modified only if return value is 0. |
| 883 | * @sz: number of array elements to read | 883 | * @sz: number of array elements to read |
| 884 | * | 884 | * |
| 885 | * Search for a property in a device node and read 32-bit value(s) from | 885 | * Search for a property in a device node and read 32-bit value(s) from |
| @@ -887,7 +887,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u16_array); | |||
| 887 | * -ENODATA if property does not have a value, and -EOVERFLOW if the | 887 | * -ENODATA if property does not have a value, and -EOVERFLOW if the |
| 888 | * property data isn't large enough. | 888 | * property data isn't large enough. |
| 889 | * | 889 | * |
| 890 | * The out_value is modified only if a valid u32 value can be decoded. | 890 | * The out_values is modified only if a valid u32 value can be decoded. |
| 891 | */ | 891 | */ |
| 892 | int of_property_read_u32_array(const struct device_node *np, | 892 | int of_property_read_u32_array(const struct device_node *np, |
| 893 | const char *propname, u32 *out_values, | 893 | const char *propname, u32 *out_values, |
diff --git a/drivers/usb/chipidea/Makefile b/drivers/usb/chipidea/Makefile index 3bbbcba03815..6cf5f68dedd8 100644 --- a/drivers/usb/chipidea/Makefile +++ b/drivers/usb/chipidea/Makefile | |||
| @@ -16,6 +16,6 @@ ifneq ($(CONFIG_PCI),) | |||
| 16 | obj-$(CONFIG_USB_CHIPIDEA) += ci_hdrc_pci.o | 16 | obj-$(CONFIG_USB_CHIPIDEA) += ci_hdrc_pci.o |
| 17 | endif | 17 | endif |
| 18 | 18 | ||
| 19 | ifneq ($(CONFIG_OF_DEVICE),) | 19 | ifneq ($(CONFIG_OF),) |
| 20 | obj-$(CONFIG_USB_CHIPIDEA) += ci_hdrc_imx.o usbmisc_imx.o | 20 | obj-$(CONFIG_USB_CHIPIDEA) += ci_hdrc_imx.o usbmisc_imx.o |
| 21 | endif | 21 | endif |
diff --git a/include/linux/of_device.h b/include/linux/of_device.h index 901b7435e890..9d27475feec1 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h | |||
| @@ -4,12 +4,12 @@ | |||
| 4 | #include <linux/platform_device.h> | 4 | #include <linux/platform_device.h> |
| 5 | #include <linux/of_platform.h> /* temporary until merge */ | 5 | #include <linux/of_platform.h> /* temporary until merge */ |
| 6 | 6 | ||
| 7 | #ifdef CONFIG_OF_DEVICE | ||
| 8 | #include <linux/of.h> | 7 | #include <linux/of.h> |
| 9 | #include <linux/mod_devicetable.h> | 8 | #include <linux/mod_devicetable.h> |
| 10 | 9 | ||
| 11 | struct device; | 10 | struct device; |
| 12 | 11 | ||
| 12 | #ifdef CONFIG_OF | ||
| 13 | extern const struct of_device_id *of_match_device( | 13 | extern const struct of_device_id *of_match_device( |
| 14 | const struct of_device_id *matches, const struct device *dev); | 14 | const struct of_device_id *matches, const struct device *dev); |
| 15 | extern void of_device_make_bus_id(struct device *dev); | 15 | extern void of_device_make_bus_id(struct device *dev); |
| @@ -43,7 +43,7 @@ static inline void of_device_node_put(struct device *dev) | |||
| 43 | of_node_put(dev->of_node); | 43 | of_node_put(dev->of_node); |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | #else /* CONFIG_OF_DEVICE */ | 46 | #else /* CONFIG_OF */ |
| 47 | 47 | ||
| 48 | static inline int of_driver_match_device(struct device *dev, | 48 | static inline int of_driver_match_device(struct device *dev, |
| 49 | struct device_driver *drv) | 49 | struct device_driver *drv) |
| @@ -67,6 +67,6 @@ static inline const struct of_device_id *of_match_device( | |||
| 67 | { | 67 | { |
| 68 | return NULL; | 68 | return NULL; |
| 69 | } | 69 | } |
| 70 | #endif /* CONFIG_OF_DEVICE */ | 70 | #endif /* CONFIG_OF */ |
| 71 | 71 | ||
| 72 | #endif /* _LINUX_OF_DEVICE_H */ | 72 | #endif /* _LINUX_OF_DEVICE_H */ |
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 2a93b64a3869..05cb4a928252 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h | |||
| @@ -13,8 +13,6 @@ | |||
| 13 | 13 | ||
| 14 | #include <linux/device.h> | 14 | #include <linux/device.h> |
| 15 | #include <linux/mod_devicetable.h> | 15 | #include <linux/mod_devicetable.h> |
| 16 | |||
| 17 | #ifdef CONFIG_OF_DEVICE | ||
| 18 | #include <linux/pm.h> | 16 | #include <linux/pm.h> |
| 19 | #include <linux/of_device.h> | 17 | #include <linux/of_device.h> |
| 20 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
| @@ -53,27 +51,6 @@ struct of_dev_auxdata { | |||
| 53 | { .compatible = _compat, .phys_addr = _phys, .name = _name, \ | 51 | { .compatible = _compat, .phys_addr = _phys, .name = _name, \ |
| 54 | .platform_data = _pdata } | 52 | .platform_data = _pdata } |
| 55 | 53 | ||
| 56 | /** | ||
| 57 | * of_platform_driver - Legacy of-aware driver for platform devices. | ||
| 58 | * | ||
| 59 | * An of_platform_driver driver is attached to a basic platform_device on | ||
| 60 | * the ibm ebus (ibmebus_bus_type). | ||
| 61 | */ | ||
| 62 | struct of_platform_driver | ||
| 63 | { | ||
| 64 | int (*probe)(struct platform_device* dev, | ||
| 65 | const struct of_device_id *match); | ||
| 66 | int (*remove)(struct platform_device* dev); | ||
| 67 | |||
| 68 | int (*suspend)(struct platform_device* dev, pm_message_t state); | ||
| 69 | int (*resume)(struct platform_device* dev); | ||
| 70 | int (*shutdown)(struct platform_device* dev); | ||
| 71 | |||
| 72 | struct device_driver driver; | ||
| 73 | }; | ||
| 74 | #define to_of_platform_driver(drv) \ | ||
| 75 | container_of(drv,struct of_platform_driver, driver) | ||
| 76 | |||
| 77 | extern const struct of_device_id of_default_bus_match_table[]; | 54 | extern const struct of_device_id of_default_bus_match_table[]; |
| 78 | 55 | ||
| 79 | /* Platform drivers register/unregister */ | 56 | /* Platform drivers register/unregister */ |
| @@ -82,7 +59,6 @@ extern struct platform_device *of_device_alloc(struct device_node *np, | |||
| 82 | struct device *parent); | 59 | struct device *parent); |
| 83 | extern struct platform_device *of_find_device_by_node(struct device_node *np); | 60 | extern struct platform_device *of_find_device_by_node(struct device_node *np); |
| 84 | 61 | ||
| 85 | #ifdef CONFIG_OF_ADDRESS /* device reg helpers depend on OF_ADDRESS */ | ||
| 86 | /* Platform devices and busses creation */ | 62 | /* Platform devices and busses creation */ |
| 87 | extern struct platform_device *of_platform_device_create(struct device_node *np, | 63 | extern struct platform_device *of_platform_device_create(struct device_node *np, |
| 88 | const char *bus_id, | 64 | const char *bus_id, |
| @@ -91,17 +67,12 @@ extern struct platform_device *of_platform_device_create(struct device_node *np, | |||
| 91 | extern int of_platform_bus_probe(struct device_node *root, | 67 | extern int of_platform_bus_probe(struct device_node *root, |
| 92 | const struct of_device_id *matches, | 68 | const struct of_device_id *matches, |
| 93 | struct device *parent); | 69 | struct device *parent); |
| 70 | #ifdef CONFIG_OF_ADDRESS | ||
| 94 | extern int of_platform_populate(struct device_node *root, | 71 | extern int of_platform_populate(struct device_node *root, |
| 95 | const struct of_device_id *matches, | 72 | const struct of_device_id *matches, |
| 96 | const struct of_dev_auxdata *lookup, | 73 | const struct of_dev_auxdata *lookup, |
| 97 | struct device *parent); | 74 | struct device *parent); |
| 98 | #endif /* CONFIG_OF_ADDRESS */ | 75 | #else |
| 99 | |||
| 100 | #endif /* CONFIG_OF_DEVICE */ | ||
| 101 | |||
| 102 | #if !defined(CONFIG_OF_ADDRESS) | ||
| 103 | struct of_dev_auxdata; | ||
| 104 | struct device_node; | ||
| 105 | static inline int of_platform_populate(struct device_node *root, | 76 | static inline int of_platform_populate(struct device_node *root, |
| 106 | const struct of_device_id *matches, | 77 | const struct of_device_id *matches, |
| 107 | const struct of_dev_auxdata *lookup, | 78 | const struct of_dev_auxdata *lookup, |
| @@ -109,6 +80,6 @@ static inline int of_platform_populate(struct device_node *root, | |||
| 109 | { | 80 | { |
| 110 | return -ENODEV; | 81 | return -ENODEV; |
| 111 | } | 82 | } |
| 112 | #endif /* !CONFIG_OF_ADDRESS */ | 83 | #endif |
| 113 | 84 | ||
| 114 | #endif /* _LINUX_OF_PLATFORM_H */ | 85 | #endif /* _LINUX_OF_PLATFORM_H */ |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index cd46ee58b9dc..ce8e4ffd78c7 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -180,6 +180,9 @@ struct platform_driver { | |||
| 180 | const struct platform_device_id *id_table; | 180 | const struct platform_device_id *id_table; |
| 181 | }; | 181 | }; |
| 182 | 182 | ||
| 183 | #define to_platform_driver(drv) (container_of((drv), struct platform_driver, \ | ||
| 184 | driver)) | ||
| 185 | |||
| 183 | /* | 186 | /* |
| 184 | * use a macro to avoid include chaining to get THIS_MODULE | 187 | * use a macro to avoid include chaining to get THIS_MODULE |
| 185 | */ | 188 | */ |
