Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+176 -88
+49
Documentation/devicetree/bindings/mfd/palmas.txt
··· 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 + }
+72
Documentation/devicetree/bindings/regulator/palmas-pmic.txt
··· 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 + };
+15 -14
arch/arm/boot/dts/omap3-devkit8000.dts
··· 124 124 reg = <0 0 0>; /* CS0, offset 0 */ 125 125 nand-bus-width = <16>; 126 126 127 - gpmc,sync-clk = <0>; 128 - gpmc,cs-on = <0>; 129 - gpmc,cs-rd-off = <44>; 130 - gpmc,cs-wr-off = <44>; 131 - gpmc,adv-on = <6>; 132 - gpmc,adv-rd-off = <34>; 133 - gpmc,adv-wr-off = <44>; 134 - gpmc,we-off = <40>; 135 - gpmc,oe-off = <54>; 136 - gpmc,access = <64>; 137 - gpmc,rd-cycle = <82>; 138 - gpmc,wr-cycle = <82>; 139 - gpmc,wr-access = <40>; 140 - gpmc,wr-data-mux-bus = <0>; 127 + gpmc,device-nand; 128 + gpmc,sync-clki-ps = <0>; 129 + gpmc,cs-on-ns = <0>; 130 + gpmc,cs-rd-off-ns = <44>; 131 + gpmc,cs-wr-off-ns = <44>; 132 + gpmc,adv-on-ns = <6>; 133 + gpmc,adv-rd-off-ns = <34>; 134 + gpmc,adv-wr-off-ns = <44>; 135 + gpmc,we-off-ns = <40>; 136 + gpmc,oe-off-ns = <54>; 137 + gpmc,access-ns = <64>; 138 + gpmc,rd-cycle-ns = <82>; 139 + gpmc,wr-cycle-ns = <82>; 140 + gpmc,wr-access-ns = <40>; 141 + gpmc,wr-data-mux-bus-ns = <0>; 141 142 142 143 #address-cells = <1>; 143 144 #size-cells = <1>;
+2 -2
arch/powerpc/include/asm/ibmebus.h
··· 48 48 49 49 extern struct bus_type ibmebus_bus_type; 50 50 51 - int ibmebus_register_driver(struct of_platform_driver *drv); 52 - void ibmebus_unregister_driver(struct of_platform_driver *drv); 51 + int ibmebus_register_driver(struct platform_driver *drv); 52 + void ibmebus_unregister_driver(struct platform_driver *drv); 53 53 54 54 int ibmebus_request_irq(u32 ist, irq_handler_t handler, 55 55 unsigned long irq_flags, const char *devname,
+10 -12
arch/powerpc/kernel/ibmebus.c
··· 205 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 210 /* If the driver uses devices that ibmebus doesn't know, add them */ 211 211 ibmebus_create_devices(drv->driver.of_match_table); ··· 215 215 } 216 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 220 driver_unregister(&drv->driver); 221 221 } ··· 338 338 static int ibmebus_bus_device_probe(struct device *dev) 339 339 { 340 340 int error = -ENODEV; 341 - struct of_platform_driver *drv; 341 + struct platform_driver *drv; 342 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 345 of_dev = to_platform_device(dev); 347 346 348 347 if (!drv->probe) ··· 349 350 350 351 of_dev_get(of_dev); 351 352 352 - match = of_match_device(drv->driver.of_match_table, dev); 353 - if (match) 354 - error = drv->probe(of_dev, match); 353 + if (of_driver_match_device(dev, dev->driver)) 354 + error = drv->probe(of_dev); 355 355 if (error) 356 356 of_dev_put(of_dev); 357 357 ··· 360 362 static int ibmebus_bus_device_remove(struct device *dev) 361 363 { 362 364 struct platform_device *of_dev = to_platform_device(dev); 363 - struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 365 + struct platform_driver *drv = to_platform_driver(dev->driver); 364 366 365 367 if (dev->driver && drv->remove) 366 368 drv->remove(of_dev); ··· 370 372 static void ibmebus_bus_device_shutdown(struct device *dev) 371 373 { 372 374 struct platform_device *of_dev = to_platform_device(dev); 373 - struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 375 + struct platform_driver *drv = to_platform_driver(dev->driver); 374 376 375 377 if (dev->driver && drv->shutdown) 376 378 drv->shutdown(of_dev); ··· 417 419 static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg) 418 420 { 419 421 struct platform_device *of_dev = to_platform_device(dev); 420 - struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 422 + struct platform_driver *drv = to_platform_driver(dev->driver); 421 423 int ret = 0; 422 424 423 425 if (dev->driver && drv->suspend) ··· 428 430 static int ibmebus_bus_legacy_resume(struct device *dev) 429 431 { 430 432 struct platform_device *of_dev = to_platform_device(dev); 431 - struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 433 + struct platform_driver *drv = to_platform_driver(dev->driver); 432 434 int ret = 0; 433 435 434 436 if (dev->driver && drv->resume)
-3
drivers/base/platform.c
··· 29 29 /* For automatically allocated device IDs */ 30 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 32 struct device platform_bus = { 36 33 .init_name = "platform", 37 34 };
+2 -3
drivers/infiniband/hw/ehca/ehca_main.c
··· 713 713 .attrs = ehca_dev_attrs 714 714 }; 715 715 716 - static int ehca_probe(struct platform_device *dev, 717 - const struct of_device_id *id) 716 + static int ehca_probe(struct platform_device *dev) 718 717 { 719 718 struct ehca_shca *shca; 720 719 const u64 *handle; ··· 936 937 }; 937 938 MODULE_DEVICE_TABLE(of, ehca_device_table); 938 939 939 - static struct of_platform_driver ehca_driver = { 940 + static struct platform_driver ehca_driver = { 940 941 .probe = ehca_probe, 941 942 .remove = ehca_remove, 942 943 .driver = {
+3 -5
drivers/net/ethernet/ibm/ehea/ehea_main.c
··· 98 98 static struct ehea_bcmc_reg_array ehea_bcmc_regs; 99 99 100 100 101 - static int ehea_probe_adapter(struct platform_device *dev, 102 - const struct of_device_id *id); 101 + static int ehea_probe_adapter(struct platform_device *dev); 103 102 104 103 static int ehea_remove(struct platform_device *dev); 105 104 ··· 111 112 }; 112 113 MODULE_DEVICE_TABLE(of, ehea_device_table); 113 114 114 - static struct of_platform_driver ehea_driver = { 115 + static struct platform_driver ehea_driver = { 115 116 .driver = { 116 117 .name = "ehea", 117 118 .owner = THIS_MODULE, ··· 3250 3251 device_remove_file(&dev->dev, &dev_attr_remove_port); 3251 3252 } 3252 3253 3253 - static int ehea_probe_adapter(struct platform_device *dev, 3254 - const struct of_device_id *id) 3254 + static int ehea_probe_adapter(struct platform_device *dev) 3255 3255 { 3256 3256 struct ehea_adapter *adapter; 3257 3257 const u64 *adapter_handle;
-3
drivers/of/Kconfig
··· 48 48 def_bool y 49 49 depends on !SPARC 50 50 51 - config OF_DEVICE 52 - def_bool y 53 - 54 51 config OF_I2C 55 52 def_tristate I2C 56 53 depends on I2C
+1 -2
drivers/of/Makefile
··· 1 - obj-y = base.o 1 + obj-y = base.o device.o platform.o 2 2 obj-$(CONFIG_OF_FLATTREE) += fdt.o 3 3 obj-$(CONFIG_OF_PROMTREE) += pdt.o 4 4 obj-$(CONFIG_OF_ADDRESS) += address.o 5 5 obj-$(CONFIG_OF_IRQ) += irq.o 6 - obj-$(CONFIG_OF_DEVICE) += device.o platform.o 7 6 obj-$(CONFIG_OF_I2C) += of_i2c.o 8 7 obj-$(CONFIG_OF_NET) += of_net.o 9 8 obj-$(CONFIG_OF_SELFTEST) += selftest.o
+6 -2
drivers/of/address.c
··· 106 106 107 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 */ 110 - return !strcmp(np->type, "pci") || !strcmp(np->type, "vci"); 109 + /* 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 117 static void of_bus_pci_count_cells(struct device_node *np,
+6 -6
drivers/of/base.c
··· 812 812 * 813 813 * @np: device node from which the property value is to be read. 814 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 816 * @sz: number of array elements to read 817 817 * 818 818 * Search for a property in a device node and read 8-bit value(s) from ··· 823 823 * dts entry of array should be like: 824 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 828 int of_property_read_u8_array(const struct device_node *np, 829 829 const char *propname, u8 *out_values, size_t sz) ··· 845 845 * 846 846 * @np: device node from which the property value is to be read. 847 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 849 * @sz: number of array elements to read 850 850 * 851 851 * Search for a property in a device node and read 16-bit value(s) from ··· 856 856 * dts entry of array should be like: 857 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 861 int of_property_read_u16_array(const struct device_node *np, 862 862 const char *propname, u16 *out_values, size_t sz) ··· 879 879 * 880 880 * @np: device node from which the property value is to be read. 881 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 883 * @sz: number of array elements to read 884 884 * 885 885 * Search for a property in a device node and read 32-bit value(s) from ··· 887 887 * -ENODATA if property does not have a value, and -EOVERFLOW if the 888 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 892 int of_property_read_u32_array(const struct device_node *np, 893 893 const char *propname, u32 *out_values,
+1 -1
drivers/usb/chipidea/Makefile
··· 16 16 obj-$(CONFIG_USB_CHIPIDEA) += ci_hdrc_pci.o 17 17 endif 18 18 19 - ifneq ($(CONFIG_OF_DEVICE),) 19 + ifneq ($(CONFIG_OF),) 20 20 obj-$(CONFIG_USB_CHIPIDEA) += ci_hdrc_imx.o usbmisc_imx.o 21 21 endif
+3 -3
include/linux/of_device.h
··· 4 4 #include <linux/platform_device.h> 5 5 #include <linux/of_platform.h> /* temporary until merge */ 6 6 7 - #ifdef CONFIG_OF_DEVICE 8 7 #include <linux/of.h> 9 8 #include <linux/mod_devicetable.h> 10 9 11 10 struct device; 12 11 12 + #ifdef CONFIG_OF 13 13 extern const struct of_device_id *of_match_device( 14 14 const struct of_device_id *matches, const struct device *dev); 15 15 extern void of_device_make_bus_id(struct device *dev); ··· 43 43 of_node_put(dev->of_node); 44 44 } 45 45 46 - #else /* CONFIG_OF_DEVICE */ 46 + #else /* CONFIG_OF */ 47 47 48 48 static inline int of_driver_match_device(struct device *dev, 49 49 struct device_driver *drv) ··· 67 67 { 68 68 return NULL; 69 69 } 70 - #endif /* CONFIG_OF_DEVICE */ 70 + #endif /* CONFIG_OF */ 71 71 72 72 #endif /* _LINUX_OF_DEVICE_H */
+3 -32
include/linux/of_platform.h
··· 13 13 14 14 #include <linux/device.h> 15 15 #include <linux/mod_devicetable.h> 16 - 17 - #ifdef CONFIG_OF_DEVICE 18 16 #include <linux/pm.h> 19 17 #include <linux/of_device.h> 20 18 #include <linux/platform_device.h> ··· 51 53 { .compatible = _compat, .phys_addr = _phys, .name = _name, \ 52 54 .platform_data = _pdata } 53 55 54 - /** 55 - * of_platform_driver - Legacy of-aware driver for platform devices. 56 - * 57 - * An of_platform_driver driver is attached to a basic platform_device on 58 - * the ibm ebus (ibmebus_bus_type). 59 - */ 60 - struct of_platform_driver 61 - { 62 - int (*probe)(struct platform_device* dev, 63 - const struct of_device_id *match); 64 - int (*remove)(struct platform_device* dev); 65 - 66 - int (*suspend)(struct platform_device* dev, pm_message_t state); 67 - int (*resume)(struct platform_device* dev); 68 - int (*shutdown)(struct platform_device* dev); 69 - 70 - struct device_driver driver; 71 - }; 72 - #define to_of_platform_driver(drv) \ 73 - container_of(drv,struct of_platform_driver, driver) 74 - 75 56 extern const struct of_device_id of_default_bus_match_table[]; 76 57 77 58 /* Platform drivers register/unregister */ ··· 59 82 struct device *parent); 60 83 extern struct platform_device *of_find_device_by_node(struct device_node *np); 61 84 62 - #ifdef CONFIG_OF_ADDRESS /* device reg helpers depend on OF_ADDRESS */ 63 85 /* Platform devices and busses creation */ 64 86 extern struct platform_device *of_platform_device_create(struct device_node *np, 65 87 const char *bus_id, ··· 67 91 extern int of_platform_bus_probe(struct device_node *root, 68 92 const struct of_device_id *matches, 69 93 struct device *parent); 94 + #ifdef CONFIG_OF_ADDRESS 70 95 extern int of_platform_populate(struct device_node *root, 71 96 const struct of_device_id *matches, 72 97 const struct of_dev_auxdata *lookup, 73 98 struct device *parent); 74 - #endif /* CONFIG_OF_ADDRESS */ 75 - 76 - #endif /* CONFIG_OF_DEVICE */ 77 - 78 - #if !defined(CONFIG_OF_ADDRESS) 79 - struct of_dev_auxdata; 80 - struct device_node; 99 + #else 81 100 static inline int of_platform_populate(struct device_node *root, 82 101 const struct of_device_id *matches, 83 102 const struct of_dev_auxdata *lookup, ··· 80 109 { 81 110 return -ENODEV; 82 111 } 83 - #endif /* !CONFIG_OF_ADDRESS */ 112 + #endif 84 113 85 114 #endif /* _LINUX_OF_PLATFORM_H */
+3
include/linux/platform_device.h
··· 180 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 187 * use a macro to avoid include chaining to get THIS_MODULE 185 188 */