Skip to content

Commit

Permalink
Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linus Torvalds committed Jul 4, 2013
2 parents f5b63ac + 6dd18e4 commit 74b9272
Show file tree
Hide file tree
Showing 16 changed files with 176 additions and 88 deletions.
49 changes: 49 additions & 0 deletions Documentation/devicetree/bindings/mfd/palmas.txt
Original file line number Diff line number Diff line change
@@ -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";
....
};
}
72 changes: 72 additions & 0 deletions Documentation/devicetree/bindings/regulator/palmas-pmic.txt
Original file line number Diff line number Diff line change
@@ -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 <dt-bindings/interrupt-controller/irq.h>

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>;
};
};
};
29 changes: 15 additions & 14 deletions arch/arm/boot/dts/omap3-devkit8000.dts
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,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>;
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/include/asm/ibmebus.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
22 changes: 10 additions & 12 deletions arch/powerpc/kernel/ibmebus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down Expand Up @@ -338,21 +338,19 @@ 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)
return error;

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

Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions drivers/base/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
};
Expand Down
5 changes: 2 additions & 3 deletions drivers/infiniband/hw/ehca/ehca_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 = {
Expand Down
8 changes: 3 additions & 5 deletions drivers/net/ethernet/ibm/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions drivers/of/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions drivers/of/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 6 additions & 2 deletions drivers/of/address.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,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
Expand All @@ -823,7 +823,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)
Expand All @@ -845,7 +845,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
Expand All @@ -856,7 +856,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)
Expand All @@ -879,15 +879,15 @@ 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
* it. Returns 0 on success, -EINVAL if the property does not exist,
* -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,
Expand Down
Loading

0 comments on commit 74b9272

Please sign in to comment.