From 8a46f4f7f95f2bece108998a2e1b87b58f99d590 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Sat, 1 Jun 2013 00:22:52 +0200 Subject: of: remove #ifdef from linux/of_platform.h A lot of code uses the functions from of_platform.h when built for devicetree-enabled platforms but can also be built without them. In order to avoid using #ifdef everywhere in drivers, this makes all the function declarations visible, which means we can use "if (IS_ENABLED(CONFIG_OF))" in driver code and get build coverage over the code but let the compiler drop the reference in the object code. Signed-off-by: Arnd Bergmann Cc: Grant Likely Cc: Rob Herring Signed-off-by: Grant Likely diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 2a93b64..7747ad0 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -13,8 +13,6 @@ #include #include - -#ifdef CONFIG_OF_DEVICE #include #include #include @@ -82,7 +80,6 @@ extern struct platform_device *of_device_alloc(struct device_node *np, struct device *parent); extern struct platform_device *of_find_device_by_node(struct device_node *np); -#ifdef CONFIG_OF_ADDRESS /* device reg helpers depend on OF_ADDRESS */ /* Platform devices and busses creation */ extern struct platform_device *of_platform_device_create(struct device_node *np, const char *bus_id, @@ -91,17 +88,12 @@ extern struct platform_device *of_platform_device_create(struct device_node *np, extern int of_platform_bus_probe(struct device_node *root, const struct of_device_id *matches, struct device *parent); +#ifdef CONFIG_OF_ADDRESS extern int of_platform_populate(struct device_node *root, const struct of_device_id *matches, const struct of_dev_auxdata *lookup, struct device *parent); -#endif /* CONFIG_OF_ADDRESS */ - -#endif /* CONFIG_OF_DEVICE */ - -#if !defined(CONFIG_OF_ADDRESS) -struct of_dev_auxdata; -struct device_node; +#else static inline int of_platform_populate(struct device_node *root, const struct of_device_id *matches, const struct of_dev_auxdata *lookup, @@ -109,6 +101,6 @@ static inline int of_platform_populate(struct device_node *root, { return -ENODEV; } -#endif /* !CONFIG_OF_ADDRESS */ +#endif #endif /* _LINUX_OF_PLATFORM_H */ -- cgit v0.10.2 From 792efb84670c5b4c58669645cb6fd7e943376ee0 Mon Sep 17 00:00:00 2001 From: "Lad, Prabhakar" Date: Tue, 7 May 2013 11:34:11 +0530 Subject: of/base: fix typos the function of_property_read_u8/16/32_array() has a parameter out_values, but the description mentioned it as out_value. This patch fixes this typo. Signed-off-by: Lad, Prabhakar Signed-off-by: Grant Likely diff --git a/drivers/of/base.c b/drivers/of/base.c index f53b992..c1cfc45 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -809,7 +809,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u32_index); * * @np: device node from which the property value is to be read. * @propname: name of the property to be searched. - * @out_value: pointer to return value, modified only if return value is 0. + * @out_values: pointer to return value, modified only if return value is 0. * @sz: number of array elements to read * * Search for a property in a device node and read 8-bit value(s) from @@ -820,7 +820,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u32_index); * dts entry of array should be like: * property = /bits/ 8 <0x50 0x60 0x70>; * - * The out_value is modified only if a valid u8 value can be decoded. + * The out_values is modified only if a valid u8 value can be decoded. */ int of_property_read_u8_array(const struct device_node *np, const char *propname, u8 *out_values, size_t sz) @@ -842,7 +842,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u8_array); * * @np: device node from which the property value is to be read. * @propname: name of the property to be searched. - * @out_value: pointer to return value, modified only if return value is 0. + * @out_values: pointer to return value, modified only if return value is 0. * @sz: number of array elements to read * * Search for a property in a device node and read 16-bit value(s) from @@ -853,7 +853,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u8_array); * dts entry of array should be like: * property = /bits/ 16 <0x5000 0x6000 0x7000>; * - * The out_value is modified only if a valid u16 value can be decoded. + * The out_values is modified only if a valid u16 value can be decoded. */ int of_property_read_u16_array(const struct device_node *np, const char *propname, u16 *out_values, size_t sz) @@ -876,7 +876,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u16_array); * * @np: device node from which the property value is to be read. * @propname: name of the property to be searched. - * @out_value: pointer to return value, modified only if return value is 0. + * @out_values: pointer to return value, modified only if return value is 0. * @sz: number of array elements to read * * Search for a property in a device node and read 32-bit value(s) from @@ -884,7 +884,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u16_array); * -ENODATA if property does not have a value, and -EOVERFLOW if the * property data isn't large enough. * - * The out_value is modified only if a valid u32 value can be decoded. + * The out_values is modified only if a valid u32 value can be decoded. */ int of_property_read_u32_array(const struct device_node *np, const char *propname, u32 *out_values, -- cgit v0.10.2 From 494235005bb7ed2f7f8713a492172897160b0e83 Mon Sep 17 00:00:00 2001 From: Florian Vaussard Date: Thu, 23 May 2013 10:11:37 +0200 Subject: ARM: dts: omap3-devkit8000: fix NAND memory binding Commit d36b4cd 'ARM: OMAP2+: Add additional GPMC timing parameters' updated GPMC binding, but omap3-devkit8000 was not updated accordingly, resulting in a broken configuration. Signed-off-by: Florian Vaussard Signed-off-by: Grant Likely diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index 8a5cdcc..e5b35f5 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts @@ -123,20 +123,21 @@ reg = <0 0 0>; /* CS0, offset 0 */ nand-bus-width = <16>; - gpmc,sync-clk = <0>; - gpmc,cs-on = <0>; - gpmc,cs-rd-off = <44>; - gpmc,cs-wr-off = <44>; - gpmc,adv-on = <6>; - gpmc,adv-rd-off = <34>; - gpmc,adv-wr-off = <44>; - gpmc,we-off = <40>; - gpmc,oe-off = <54>; - gpmc,access = <64>; - gpmc,rd-cycle = <82>; - gpmc,wr-cycle = <82>; - gpmc,wr-access = <40>; - gpmc,wr-data-mux-bus = <0>; + gpmc,device-nand; + gpmc,sync-clki-ps = <0>; + gpmc,cs-on-ns = <0>; + gpmc,cs-rd-off-ns = <44>; + gpmc,cs-wr-off-ns = <44>; + gpmc,adv-on-ns = <6>; + gpmc,adv-rd-off-ns = <34>; + gpmc,adv-wr-off-ns = <44>; + gpmc,we-off-ns = <40>; + gpmc,oe-off-ns = <54>; + gpmc,access-ns = <64>; + gpmc,rd-cycle-ns = <82>; + gpmc,wr-cycle-ns = <82>; + gpmc,wr-access-ns = <40>; + gpmc,wr-data-mux-bus-ns = <0>; #address-cells = <1>; #size-cells = <1>; -- cgit v0.10.2 From 8d561b60a9174defff2e48e109f68a5f2ae7dd9c Mon Sep 17 00:00:00 2001 From: J Keerthy Date: Thu, 6 Jun 2013 10:57:21 +0530 Subject: mfd: DT bindings for the palmas family MFD Add the various binding files for the palmas family of chips. There is a top level MFD binding then a seperate binding for regulators IP blocks on chips. Signed-off-by: Graeme Gregory Signed-off-by: J Keerthy Signed-off-by: Ian Lartey Reviewed-by: Stephen Warren Signed-off-by: Grant Likely diff --git a/Documentation/devicetree/bindings/mfd/palmas.txt b/Documentation/devicetree/bindings/mfd/palmas.txt new file mode 100644 index 0000000..892537d --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/palmas.txt @@ -0,0 +1,49 @@ +* palmas device tree bindings + +The TI palmas family current members :- +twl6035 (palmas) +twl6037 (palmas) +tps65913 (palmas) +tps65914 (palmas) + +Required properties: +- compatible : Should be from the list + ti,twl6035 + ti,twl6036 + ti,twl6037 + ti,tps65913 + ti,tps65914 + ti,tps80036 +and also the generic series names + ti,palmas +- interrupt-controller : palmas has its own internal IRQs +- #interrupt-cells : should be set to 2 for IRQ number and flags + The first cell is the IRQ number. + The second cell is the flags, encoded as the trigger masks from + Documentation/devicetree/bindings/interrupts.txt +- interrupt-parent : The parent interrupt controller. + +Optional properties: + ti,mux-padX : set the pad register X (1-2) to the correct muxing for the + hardware, if not set will use muxing in OTP. + +Example: + +palmas { + compatible = "ti,twl6035", "ti,palmas"; + reg = <0x48> + interrupt-parent = <&intc>; + interrupt-controller; + #interrupt-cells = <2>; + + ti,mux-pad1 = <0>; + ti,mux-pad2 = <0>; + + #address-cells = <1>; + #size-cells = <0>; + + pmic { + compatible = "ti,twl6035-pmic", "ti,palmas-pmic"; + .... + }; +} diff --git a/Documentation/devicetree/bindings/regulator/palmas-pmic.txt b/Documentation/devicetree/bindings/regulator/palmas-pmic.txt new file mode 100644 index 0000000..d5a3086 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/palmas-pmic.txt @@ -0,0 +1,72 @@ +* palmas regulator IP block devicetree bindings + +Required properties: +- compatible : Should be from the list + ti,twl6035-pmic + ti,twl6036-pmic + ti,twl6037-pmic + ti,tps65913-pmic + ti,tps65914-pmic +and also the generic series names + ti,palmas-pmic +- interrupt-parent : The parent interrupt controller which is palmas. +- interrupts : The interrupt number and the type which can be looked up here: + arch/arm/boot/dts/include/dt-bindings/interrupt-controller/irq.h +- interrupts-name: The names of the individual interrupts. + +Optional properties: +- ti,ldo6-vibrator : ldo6 is in vibrator mode + +Optional nodes: +- regulators : Must contain a sub-node per regulator from the list below. + Each sub-node should contain the constraints and initialization + information for that regulator. See regulator.txt for a + description of standard properties for these sub-nodes. + Additional custom properties are listed below. + + For ti,palmas-pmic - smps12, smps123, smps3 depending on OTP, + smps45, smps457, smps7 depending on variant, smps6, smps[8-10], + ldo[1-9], ldoln, ldousb. + + Optional sub-node properties: + ti,warm-reset - maintain voltage during warm reset(boolean) + ti,roof-floor - control voltage selection by pin(boolean) + ti,sleep-mode - mode to adopt in pmic sleep 0 - off, 1 - auto, + 2 - eco, 3 - forced pwm + ti,tstep - slope control 0 - Jump, 1 10mV/us, 2 5mV/us, 3 2.5mV/us + ti,smps-range - OTP has the wrong range set for the hardware so override + 0 - low range, 1 - high range. + +Example: + +#include + +pmic { + compatible = "ti,twl6035-pmic", "ti,palmas-pmic"; + interrupt-parent = <&palmas>; + interrupts = <14 IRQ_TYPE_NONE>; + interrupts-name = "short-irq"; + + ti,ldo6-vibrator; + + regulators { + smps12_reg : smps12 { + regulator-name = "smps12"; + regulator-min-microvolt = < 600000>; + regulator-max-microvolt = <1500000>; + regulator-always-on; + regulator-boot-on; + ti,warm-reset; + ti,roof-floor; + ti,mode-sleep = <0>; + ti,tstep = <0>; + ti,smps-range = <1>; + }; + + ldo1_reg: ldo1 { + regulator-name = "ldo1"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + }; + }; +}; -- cgit v0.10.2 From 10dbc5e39a60944536f3ca59bc9a8a8896355714 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Sun, 21 Apr 2013 16:38:31 -0500 Subject: driver core: move to_platform_driver to platform_device.h In converting the last remaining of_platform_driver (ibmebus) to a regular platform driver, to_platform_driver is needed to replace to_of_platform_driver. Signed-off-by: Rob Herring Acked-by: Arnd Bergmann Tested-by: Benjamin Herrenschmidt Signed-off-by: Grant Likely diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 9eda842..1bcb2a7 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -29,9 +29,6 @@ /* For automatically allocated device IDs */ static DEFINE_IDA(platform_devid_ida); -#define to_platform_driver(drv) (container_of((drv), struct platform_driver, \ - driver)) - struct device platform_bus = { .init_name = "platform", }; diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 9abf1db..3413897 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -180,6 +180,9 @@ struct platform_driver { const struct platform_device_id *id_table; }; +#define to_platform_driver(drv) (container_of((drv), struct platform_driver, \ + driver)) + extern int platform_driver_register(struct platform_driver *); extern void platform_driver_unregister(struct platform_driver *); -- cgit v0.10.2 From c45640e4a9f54f2f6f4bc51c2ba9644ffb3babde Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Sat, 20 Apr 2013 21:51:08 -0500 Subject: ibmebus: convert of_platform_driver to platform_driver ibmebus is the last remaining user of of_platform_driver and the conversion to a regular platform driver is trivial. Signed-off-by: Rob Herring Acked-by: Arnd Bergmann Tested-by: Benjamin Herrenschmidt Signed-off-by: Grant Likely diff --git a/arch/powerpc/include/asm/ibmebus.h b/arch/powerpc/include/asm/ibmebus.h index 1a9d9ae..088f95b 100644 --- a/arch/powerpc/include/asm/ibmebus.h +++ b/arch/powerpc/include/asm/ibmebus.h @@ -48,8 +48,8 @@ extern struct bus_type ibmebus_bus_type; -int ibmebus_register_driver(struct of_platform_driver *drv); -void ibmebus_unregister_driver(struct of_platform_driver *drv); +int ibmebus_register_driver(struct platform_driver *drv); +void ibmebus_unregister_driver(struct platform_driver *drv); int ibmebus_request_irq(u32 ist, irq_handler_t handler, unsigned long irq_flags, const char *devname, diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index 8220baa..16a7c23 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) return ret; } -int ibmebus_register_driver(struct of_platform_driver *drv) +int ibmebus_register_driver(struct platform_driver *drv) { /* If the driver uses devices that ibmebus doesn't know, add them */ ibmebus_create_devices(drv->driver.of_match_table); @@ -215,7 +215,7 @@ int ibmebus_register_driver(struct of_platform_driver *drv) } EXPORT_SYMBOL(ibmebus_register_driver); -void ibmebus_unregister_driver(struct of_platform_driver *drv) +void ibmebus_unregister_driver(struct platform_driver *drv) { driver_unregister(&drv->driver); } @@ -338,11 +338,10 @@ static int ibmebus_bus_bus_match(struct device *dev, struct device_driver *drv) static int ibmebus_bus_device_probe(struct device *dev) { int error = -ENODEV; - struct of_platform_driver *drv; + struct platform_driver *drv; struct platform_device *of_dev; - const struct of_device_id *match; - drv = to_of_platform_driver(dev->driver); + drv = to_platform_driver(dev->driver); of_dev = to_platform_device(dev); if (!drv->probe) @@ -350,9 +349,8 @@ static int ibmebus_bus_device_probe(struct device *dev) of_dev_get(of_dev); - match = of_match_device(drv->driver.of_match_table, dev); - if (match) - error = drv->probe(of_dev, match); + if (of_driver_match_device(dev, dev->driver)) + error = drv->probe(of_dev); if (error) of_dev_put(of_dev); @@ -362,7 +360,7 @@ static int ibmebus_bus_device_probe(struct device *dev) static int ibmebus_bus_device_remove(struct device *dev) { struct platform_device *of_dev = to_platform_device(dev); - struct of_platform_driver *drv = to_of_platform_driver(dev->driver); + struct platform_driver *drv = to_platform_driver(dev->driver); if (dev->driver && drv->remove) drv->remove(of_dev); @@ -372,7 +370,7 @@ static int ibmebus_bus_device_remove(struct device *dev) static void ibmebus_bus_device_shutdown(struct device *dev) { struct platform_device *of_dev = to_platform_device(dev); - struct of_platform_driver *drv = to_of_platform_driver(dev->driver); + struct platform_driver *drv = to_platform_driver(dev->driver); if (dev->driver && drv->shutdown) drv->shutdown(of_dev); @@ -419,7 +417,7 @@ struct device_attribute ibmebus_bus_device_attrs[] = { static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg) { struct platform_device *of_dev = to_platform_device(dev); - struct of_platform_driver *drv = to_of_platform_driver(dev->driver); + struct platform_driver *drv = to_platform_driver(dev->driver); int ret = 0; if (dev->driver && drv->suspend) @@ -430,7 +428,7 @@ static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg) static int ibmebus_bus_legacy_resume(struct device *dev) { struct platform_device *of_dev = to_platform_device(dev); - struct of_platform_driver *drv = to_of_platform_driver(dev->driver); + struct platform_driver *drv = to_platform_driver(dev->driver); int ret = 0; if (dev->driver && drv->resume) diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index f8a6291..982e3ef 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 = { .attrs = ehca_dev_attrs }; -static int ehca_probe(struct platform_device *dev, - const struct of_device_id *id) +static int ehca_probe(struct platform_device *dev) { struct ehca_shca *shca; const u64 *handle; @@ -937,7 +936,7 @@ static struct of_device_id ehca_device_table[] = }; MODULE_DEVICE_TABLE(of, ehca_device_table); -static struct of_platform_driver ehca_driver = { +static struct platform_driver ehca_driver = { .probe = ehca_probe, .remove = ehca_remove, .driver = { diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index 90ea0b1..de2969c 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; static struct ehea_bcmc_reg_array ehea_bcmc_regs; -static int ehea_probe_adapter(struct platform_device *dev, - const struct of_device_id *id); +static int ehea_probe_adapter(struct platform_device *dev); static int ehea_remove(struct platform_device *dev); @@ -112,7 +111,7 @@ static struct of_device_id ehea_device_table[] = { }; MODULE_DEVICE_TABLE(of, ehea_device_table); -static struct of_platform_driver ehea_driver = { +static struct platform_driver ehea_driver = { .driver = { .name = "ehea", .owner = THIS_MODULE, @@ -3251,8 +3250,7 @@ static void ehea_remove_device_sysfs(struct platform_device *dev) device_remove_file(&dev->dev, &dev_attr_remove_port); } -static int ehea_probe_adapter(struct platform_device *dev, - const struct of_device_id *id) +static int ehea_probe_adapter(struct platform_device *dev) { struct ehea_adapter *adapter; const u64 *adapter_handle; -- cgit v0.10.2 From f70c64f8b095c0c386840f2036a79523bfd66725 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Sun, 21 Apr 2013 16:40:13 -0500 Subject: of: remove of_platform_driver The last user of of_platform_driver is converted to a regular platform_driver, so of_platform_driver can be removed now. Signed-off-by: Rob Herring Acked-by: Arnd Bergmann Tested-by: Benjamin Herrenschmidt Signed-off-by: Grant Likely diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 7747ad0..05cb4a9 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h @@ -51,27 +51,6 @@ struct of_dev_auxdata { { .compatible = _compat, .phys_addr = _phys, .name = _name, \ .platform_data = _pdata } -/** - * of_platform_driver - Legacy of-aware driver for platform devices. - * - * An of_platform_driver driver is attached to a basic platform_device on - * the ibm ebus (ibmebus_bus_type). - */ -struct of_platform_driver -{ - int (*probe)(struct platform_device* dev, - const struct of_device_id *match); - int (*remove)(struct platform_device* dev); - - int (*suspend)(struct platform_device* dev, pm_message_t state); - int (*resume)(struct platform_device* dev); - int (*shutdown)(struct platform_device* dev); - - struct device_driver driver; -}; -#define to_of_platform_driver(drv) \ - container_of(drv,struct of_platform_driver, driver) - extern const struct of_device_id of_default_bus_match_table[]; /* Platform drivers register/unregister */ -- cgit v0.10.2 From 8973ba8b325f8c084815a3021c427c6fa3017a5d Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 19 Apr 2013 17:32:15 -0500 Subject: usb: chipidea: depend on CONFIG_OF instead of CONFIG_OF_DEVICE CONFIG_OF_DEVICE is going away, so use CONFIG_OF instead. It does not appear that CONFIG_OF_DEVICE was the correct dependency either. Signed-off-by: Rob Herring Acked-by: Arnd Bergmann Tested-by: Benjamin Herrenschmidt Signed-off-by: Grant Likely diff --git a/drivers/usb/chipidea/Makefile b/drivers/usb/chipidea/Makefile index 4ab83e9..4113feb 100644 --- a/drivers/usb/chipidea/Makefile +++ b/drivers/usb/chipidea/Makefile @@ -16,6 +16,6 @@ ifneq ($(CONFIG_PCI),) obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_pci.o endif -ifneq ($(CONFIG_OF_DEVICE),) +ifneq ($(CONFIG_OF),) obj-$(CONFIG_USB_CHIPIDEA) += ci13xxx_imx.o usbmisc_imx.o endif -- cgit v0.10.2 From ba166e900b502b74b9425881caa94f94891b0a1f Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 19 Apr 2013 17:32:52 -0500 Subject: of: remove CONFIG_OF_DEVICE CONFIG_OF_DEVICE is always selected when CONFIG_OF is enabled, so remove it and simplify of_platform.h and of_device.h headers. This also fixes !OF compiles using of_platform_populate. Signed-off-by: Rob Herring Acked-by: Arnd Bergmann Tested-by: Benjamin Herrenschmidt Signed-off-by: Grant Likely diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig index d37bfcf..80e5c13 100644 --- a/drivers/of/Kconfig +++ b/drivers/of/Kconfig @@ -48,9 +48,6 @@ config OF_IRQ def_bool y depends on !SPARC -config OF_DEVICE - def_bool y - config OF_I2C def_tristate I2C depends on I2C diff --git a/drivers/of/Makefile b/drivers/of/Makefile index e027f44..1f9c0c4 100644 --- a/drivers/of/Makefile +++ b/drivers/of/Makefile @@ -1,9 +1,8 @@ -obj-y = base.o +obj-y = base.o device.o platform.o obj-$(CONFIG_OF_FLATTREE) += fdt.o obj-$(CONFIG_OF_PROMTREE) += pdt.o obj-$(CONFIG_OF_ADDRESS) += address.o obj-$(CONFIG_OF_IRQ) += irq.o -obj-$(CONFIG_OF_DEVICE) += device.o platform.o obj-$(CONFIG_OF_I2C) += of_i2c.o obj-$(CONFIG_OF_NET) += of_net.o obj-$(CONFIG_OF_SELFTEST) += selftest.o diff --git a/include/linux/of_device.h b/include/linux/of_device.h index 901b743..9d27475 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h @@ -4,12 +4,12 @@ #include #include /* temporary until merge */ -#ifdef CONFIG_OF_DEVICE #include #include struct device; +#ifdef CONFIG_OF extern const struct of_device_id *of_match_device( const struct of_device_id *matches, const struct device *dev); extern void of_device_make_bus_id(struct device *dev); @@ -43,7 +43,7 @@ static inline void of_device_node_put(struct device *dev) of_node_put(dev->of_node); } -#else /* CONFIG_OF_DEVICE */ +#else /* CONFIG_OF */ static inline int of_driver_match_device(struct device *dev, struct device_driver *drv) @@ -67,6 +67,6 @@ static inline const struct of_device_id *of_match_device( { return NULL; } -#endif /* CONFIG_OF_DEVICE */ +#endif /* CONFIG_OF */ #endif /* _LINUX_OF_DEVICE_H */ -- cgit v0.10.2 From 6dd18e4684f3d188277bbbc27545248487472108 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Wed, 3 Jul 2013 16:01:10 +1000 Subject: of: Fix address decoding on Bimini and js2x machines Commit: e38c0a1fbc5803cbacdaac0557c70ac8ca5152e7 of/address: Handle #address-cells > 2 specially broke real time clock access on Bimini, js2x, and similar powerpc machines using the "maple" platform. That code was indirectly relying on the old (broken) behaviour of the translation for the hypertransport to ISA bridge. This fixes it by treating hypertransport as a PCI bus Signed-off-by: Benjamin Herrenschmidt Acked-by: Rob Herring Signed-off-by: Grant Likely diff --git a/drivers/of/address.c b/drivers/of/address.c index 04da786..7c8221d 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) static int of_bus_pci_match(struct device_node *np) { - /* "vci" is for the /chaos bridge on 1st-gen PCI powermacs */ - return !strcmp(np->type, "pci") || !strcmp(np->type, "vci"); + /* + * "vci" is for the /chaos bridge on 1st-gen PCI powermacs + * "ht" is hypertransport + */ + return !strcmp(np->type, "pci") || !strcmp(np->type, "vci") || + !strcmp(np->type, "ht"); } static void of_bus_pci_count_cells(struct device_node *np, -- cgit v0.10.2