Skip to content

Commit 74b9272

Browse files
committed
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
2 parents f5b63ac + 6dd18e4 commit 74b9272

16 files changed

Lines changed: 176 additions & 88 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
};

‎arch/arm/boot/dts/omap3-devkit8000.dts‎

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,20 +124,21 @@
124124
reg = <0 0 0>; /* CS0, offset 0 */
125125
nand-bus-width = <16>;
126126

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>;
141142

142143
#address-cells = <1>;
143144
#size-cells = <1>;

‎arch/powerpc/include/asm/ibmebus.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848

4949
extern struct bus_type ibmebus_bus_type;
5050

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);
5353

5454
int ibmebus_request_irq(u32 ist, irq_handler_t handler,
5555
unsigned long irq_flags, const char *devname,

‎arch/powerpc/kernel/ibmebus.c‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static int ibmebus_create_devices(const struct of_device_id *matches)
205205
return ret;
206206
}
207207

208-
int ibmebus_register_driver(struct of_platform_driver *drv)
208+
int ibmebus_register_driver(struct platform_driver *drv)
209209
{
210210
/* If the driver uses devices that ibmebus doesn't know, add them */
211211
ibmebus_create_devices(drv->driver.of_match_table);
@@ -215,7 +215,7 @@ int ibmebus_register_driver(struct of_platform_driver *drv)
215215
}
216216
EXPORT_SYMBOL(ibmebus_register_driver);
217217

218-
void ibmebus_unregister_driver(struct of_platform_driver *drv)
218+
void ibmebus_unregister_driver(struct platform_driver *drv)
219219
{
220220
driver_unregister(&drv->driver);
221221
}
@@ -338,21 +338,19 @@ static int ibmebus_bus_bus_match(struct device *dev, struct device_driver *drv)
338338
static int ibmebus_bus_device_probe(struct device *dev)
339339
{
340340
int error = -ENODEV;
341-
struct of_platform_driver *drv;
341+
struct platform_driver *drv;
342342
struct platform_device *of_dev;
343-
const struct of_device_id *match;
344343

345-
drv = to_of_platform_driver(dev->driver);
344+
drv = to_platform_driver(dev->driver);
346345
of_dev = to_platform_device(dev);
347346

348347
if (!drv->probe)
349348
return error;
350349

351350
of_dev_get(of_dev);
352351

353-
match = of_match_device(drv->driver.of_match_table, dev);
354-
if (match)
355-
error = drv->probe(of_dev, match);
352+
if (of_driver_match_device(dev, dev->driver))
353+
error = drv->probe(of_dev);
356354
if (error)
357355
of_dev_put(of_dev);
358356

@@ -362,7 +360,7 @@ static int ibmebus_bus_device_probe(struct device *dev)
362360
static int ibmebus_bus_device_remove(struct device *dev)
363361
{
364362
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);
366364

367365
if (dev->driver && drv->remove)
368366
drv->remove(of_dev);
@@ -372,7 +370,7 @@ static int ibmebus_bus_device_remove(struct device *dev)
372370
static void ibmebus_bus_device_shutdown(struct device *dev)
373371
{
374372
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);
376374

377375
if (dev->driver && drv->shutdown)
378376
drv->shutdown(of_dev);
@@ -419,7 +417,7 @@ struct device_attribute ibmebus_bus_device_attrs[] = {
419417
static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg)
420418
{
421419
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);
423421
int ret = 0;
424422

425423
if (dev->driver && drv->suspend)
@@ -430,7 +428,7 @@ static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg)
430428
static int ibmebus_bus_legacy_resume(struct device *dev)
431429
{
432430
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);
434432
int ret = 0;
435433

436434
if (dev->driver && drv->resume)

‎drivers/base/platform.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929
/* For automatically allocated device IDs */
3030
static DEFINE_IDA(platform_devid_ida);
3131

32-
#define to_platform_driver(drv) (container_of((drv), struct platform_driver, \
33-
driver))
34-
3532
struct device platform_bus = {
3633
.init_name = "platform",
3734
};

‎drivers/infiniband/hw/ehca/ehca_main.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,7 @@ static struct attribute_group ehca_dev_attr_grp = {
713713
.attrs = ehca_dev_attrs
714714
};
715715

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)
718717
{
719718
struct ehca_shca *shca;
720719
const u64 *handle;
@@ -937,7 +936,7 @@ static struct of_device_id ehca_device_table[] =
937936
};
938937
MODULE_DEVICE_TABLE(of, ehca_device_table);
939938

940-
static struct of_platform_driver ehca_driver = {
939+
static struct platform_driver ehca_driver = {
941940
.probe = ehca_probe,
942941
.remove = ehca_remove,
943942
.driver = {

‎drivers/net/ethernet/ibm/ehea/ehea_main.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ static struct ehea_fw_handle_array ehea_fw_handles;
9898
static struct ehea_bcmc_reg_array ehea_bcmc_regs;
9999

100100

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);
103102

104103
static int ehea_remove(struct platform_device *dev);
105104

@@ -112,7 +111,7 @@ static struct of_device_id ehea_device_table[] = {
112111
};
113112
MODULE_DEVICE_TABLE(of, ehea_device_table);
114113

115-
static struct of_platform_driver ehea_driver = {
114+
static struct platform_driver ehea_driver = {
116115
.driver = {
117116
.name = "ehea",
118117
.owner = THIS_MODULE,
@@ -3251,8 +3250,7 @@ static void ehea_remove_device_sysfs(struct platform_device *dev)
32513250
device_remove_file(&dev->dev, &dev_attr_remove_port);
32523251
}
32533252

3254-
static int ehea_probe_adapter(struct platform_device *dev,
3255-
const struct of_device_id *id)
3253+
static int ehea_probe_adapter(struct platform_device *dev)
32563254
{
32573255
struct ehea_adapter *adapter;
32583256
const u64 *adapter_handle;

‎drivers/of/Kconfig‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ config OF_IRQ
4848
def_bool y
4949
depends on !SPARC
5050

51-
config OF_DEVICE
52-
def_bool y
53-
5451
config OF_I2C
5552
def_tristate I2C
5653
depends on I2C

‎drivers/of/Makefile‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
obj-y = base.o
1+
obj-y = base.o device.o platform.o
22
obj-$(CONFIG_OF_FLATTREE) += fdt.o
33
obj-$(CONFIG_OF_PROMTREE) += pdt.o
44
obj-$(CONFIG_OF_ADDRESS) += address.o
55
obj-$(CONFIG_OF_IRQ) += irq.o
6-
obj-$(CONFIG_OF_DEVICE) += device.o platform.o
76
obj-$(CONFIG_OF_I2C) += of_i2c.o
87
obj-$(CONFIG_OF_NET) += of_net.o
98
obj-$(CONFIG_OF_SELFTEST) += selftest.o

0 commit comments

Comments
 (0)