From 9e3ea51f546fe4ed193ed97c47c7af09b1e5b477 Mon Sep 17 00:00:00 2001 From: Clément Leger Date: Mon, 15 Oct 2018 17:00:04 +0200 Subject: phy: call adjust_link in attach if using fixed-link Normally, phy_update_status is in charge of reporting a change in link status when phy is updated. When using fixed-link, speed and duplex are initialized directly after registering the phy and there is no driver. Hence when phy_update_status is called, the check for new values fails and returns directly. Since update_link call is mandatory for some network devices to work, call it directly when using fixed link in phy_device_attach to force update of link. Signed-off-by: Clement Leger Signed-off-by: Sascha Hauer --- drivers/net/phy/phy.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 42dcad9069..63f249fcff 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -398,6 +398,10 @@ static int phy_device_attach(struct phy_device *phy, struct eth_device *edev, phy->adjust_link = adjust_link; + /* If the phy is a fixed-link, then call adjust_link directly */ + if (!phy->bus && adjust_link) + adjust_link(edev); + return 0; } -- cgit v1.2.3 From 61850ba0d64826f789b32beffe0bb87f348e578e Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Mon, 15 Oct 2018 09:57:43 -0700 Subject: rave-sp: backlight: Specify parent device correctly Signed-off-by: Andrey Smirnov Signed-off-by: Sascha Hauer --- drivers/video/rave-sp-backlight.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/video/rave-sp-backlight.c b/drivers/video/rave-sp-backlight.c index 88ec86e730..3a20def661 100644 --- a/drivers/video/rave-sp-backlight.c +++ b/drivers/video/rave-sp-backlight.c @@ -46,6 +46,7 @@ static int rave_sp_backlight_probe(struct device_d *dev) bd = xzalloc(sizeof(*bd)); bd->dev.priv = dev->parent->priv; + bd->dev.parent = dev; bd->brightness_default = 50; bd->brightness_max = 100; bd->brightness_set = rave_sp_backlight_set; -- cgit v1.2.3 From 4da7cf0a63b7a821973b2de5f9319ff56ebe49bf Mon Sep 17 00:00:00 2001 From: Ulrich Ölmann Date: Fri, 19 Oct 2018 06:33:11 +0200 Subject: of: base: fix typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ulrich Ölmann Signed-off-by: Sascha Hauer --- drivers/of/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/of/base.c b/drivers/of/base.c index fc01a99ef2..0d8289d5fa 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1235,7 +1235,7 @@ int of_property_write_u64_array(struct device_node *np, * * @np: device node to which the property value is to be written. * @propname: name of the property to be written. - * value: pointer to the string to write + * @value: pointer to the string to write * * Search for a property in a device node and write a string to * it. If the property does not exist, it will be created and appended to -- cgit v1.2.3 From d8fcbad91a22be905b5fd8aec26ce1cc3b950d98 Mon Sep 17 00:00:00 2001 From: Marco Felsch Date: Thu, 18 Oct 2018 12:19:31 +0200 Subject: i2c: introduce device_i2c_driver() macro Add macro and dependency to avoid boilerplate code. Since now simple i2c drivers only have to include the i2c.h header and call the device_i2c_driver() macro to register a i2c device driver. Signed-off-by: Marco Felsch Signed-off-by: Sascha Hauer --- drivers/aiodev/lm75.c | 10 +--------- drivers/eeprom/at24.c | 9 +-------- drivers/gpio/gpio-pca953x.c | 8 +------- drivers/gpio/gpio-sx150x.c | 8 +------- drivers/i2c/muxes/i2c-mux-pca954x.c | 8 +------- drivers/input/qt1070.c | 9 +-------- drivers/mfd/act8846.c | 10 +--------- drivers/mfd/da9053.c | 10 +--------- drivers/mfd/da9063.c | 9 +-------- drivers/mfd/lp3972.c | 10 +--------- drivers/mfd/mc34704.c | 9 +-------- drivers/mfd/mc9sdz60.c | 10 +--------- drivers/mfd/stmpe-i2c.c | 10 +--------- drivers/mfd/twl4030.c | 10 +--------- drivers/mfd/twl6030.c | 10 +--------- drivers/rtc/rtc-abracon.c | 8 +------- drivers/rtc/rtc-ds1307.c | 8 +------- drivers/video/mtl017.c | 10 +--------- drivers/video/ssd1307fb.c | 10 +--------- drivers/video/tc358767.c | 8 +------- include/i2c/i2c.h | 4 ++++ 21 files changed, 24 insertions(+), 164 deletions(-) (limited to 'drivers') diff --git a/drivers/aiodev/lm75.c b/drivers/aiodev/lm75.c index b4da5a0f75..af54227e40 100644 --- a/drivers/aiodev/lm75.c +++ b/drivers/aiodev/lm75.c @@ -19,7 +19,6 @@ */ #include -#include #include #include #include @@ -252,11 +251,4 @@ static struct driver_d lm75_driver = { .probe = lm75_probe, .id_table = lm75_ids, }; - -static int lm75_init(void) -{ - i2c_driver_register(&lm75_driver); - return 0; -} - -device_initcall(lm75_init); +device_i2c_driver(lm75_driver); diff --git a/drivers/eeprom/at24.c b/drivers/eeprom/at24.c index 4fae3a12e4..e79031a2d3 100644 --- a/drivers/eeprom/at24.c +++ b/drivers/eeprom/at24.c @@ -11,7 +11,6 @@ */ #include -#include #include #include #include @@ -529,10 +528,4 @@ static struct driver_d at24_driver = { .probe = at24_probe, .id_table = at24_ids, }; - -static int at24_init(void) -{ - i2c_driver_register(&at24_driver); - return 0; -} -device_initcall(at24_init); +device_i2c_driver(at24_driver); diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 53e8c7650d..98a7a6c97c 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -14,7 +14,6 @@ */ #include -#include #include #include #include @@ -508,9 +507,4 @@ static struct driver_d pca953x_driver = { .of_compatible = DRV_OF_COMPAT(pca953x_dt_ids), .id_table = pca953x_id, }; - -static int __init pca953x_init(void) -{ - return i2c_driver_register(&pca953x_driver); -} -device_initcall(pca953x_init); +device_i2c_driver(pca953x_driver); diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c index 7b8cfb5042..76535187b0 100644 --- a/drivers/gpio/gpio-sx150x.c +++ b/drivers/gpio/gpio-sx150x.c @@ -17,7 +17,6 @@ */ #include -#include #include #include #include @@ -266,9 +265,4 @@ static struct driver_d sx150x_driver = { .probe = sx150x_probe, .of_compatible = sx150x_dt_ids, }; - -static int __init sx150x_init(void) -{ - return i2c_driver_register(&sx150x_driver); -} -device_initcall(sx150x_init); +device_i2c_driver(sx150x_driver); diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c index 395254cdca..d397e803b1 100644 --- a/drivers/i2c/muxes/i2c-mux-pca954x.c +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #include @@ -248,12 +247,7 @@ static struct driver_d pca954x_driver = { .probe = pca954x_probe, .id_table = pca954x_id, }; - -static int __init pca954x_init(void) -{ - return i2c_driver_register(&pca954x_driver); -} -device_initcall(pca954x_init); +device_i2c_driver(pca954x_driver); MODULE_AUTHOR("Rodolfo Giometti "); MODULE_DESCRIPTION("PCA954x I2C mux/switch driver"); diff --git a/drivers/input/qt1070.c b/drivers/input/qt1070.c index d81a8fa401..59acee5c39 100644 --- a/drivers/input/qt1070.c +++ b/drivers/input/qt1070.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include @@ -284,10 +283,4 @@ static struct driver_d qt1070_driver = { .name = "qt1070", .probe = qt1070_probe, }; - -static int qt1070_init(void) -{ - i2c_driver_register(&qt1070_driver); - return 0; -} -device_initcall(qt1070_init); +device_i2c_driver(qt1070_driver); diff --git a/drivers/mfd/act8846.c b/drivers/mfd/act8846.c index dfca0498b1..53ab70f5cc 100644 --- a/drivers/mfd/act8846.c +++ b/drivers/mfd/act8846.c @@ -18,7 +18,6 @@ */ #include -#include #include #include #include @@ -144,11 +143,4 @@ static struct driver_d act8846_driver = { .name = DRIVERNAME, .probe = act8846_probe, }; - -static int act8846_init(void) -{ - i2c_driver_register(&act8846_driver); - return 0; -} - -device_initcall(act8846_init); +device_i2c_driver(act8846_driver); diff --git a/drivers/mfd/da9053.c b/drivers/mfd/da9053.c index c706082a8b..b156bf113f 100644 --- a/drivers/mfd/da9053.c +++ b/drivers/mfd/da9053.c @@ -15,7 +15,6 @@ */ #include -#include #include #include #include @@ -310,11 +309,4 @@ static struct driver_d da9053_driver = { .probe = da9053_probe, .of_compatible = DRV_OF_COMPAT(da9053_dt_ids), }; - -static int da9053_init(void) -{ - i2c_driver_register(&da9053_driver); - return 0; -} - -device_initcall(da9053_init); +device_i2c_driver(da9053_driver); diff --git a/drivers/mfd/da9063.c b/drivers/mfd/da9063.c index 0c27bf495f..b6114a614b 100644 --- a/drivers/mfd/da9063.c +++ b/drivers/mfd/da9063.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -297,10 +296,4 @@ static struct driver_d da9063_driver = { .id_table = da9063_id, .of_compatible = DRV_OF_COMPAT(da906x_dt_ids), }; - -static int da9063_init(void) -{ - return i2c_driver_register(&da9063_driver); -} - -device_initcall(da9063_init); +device_i2c_driver(da9063_driver); diff --git a/drivers/mfd/lp3972.c b/drivers/mfd/lp3972.c index 054713b942..42b28070ad 100644 --- a/drivers/mfd/lp3972.c +++ b/drivers/mfd/lp3972.c @@ -17,7 +17,6 @@ */ #include -#include #include #include #include @@ -96,11 +95,4 @@ static struct driver_d lp_driver = { .name = DRIVERNAME, .probe = lp_probe, }; - -static int lp_init(void) -{ - i2c_driver_register(&lp_driver); - return 0; -} - -device_initcall(lp_init); +device_i2c_driver(lp_driver); diff --git a/drivers/mfd/mc34704.c b/drivers/mfd/mc34704.c index bfda169aaa..f15f37ef6e 100644 --- a/drivers/mfd/mc34704.c +++ b/drivers/mfd/mc34704.c @@ -17,7 +17,6 @@ */ #include -#include #include #include #include @@ -133,10 +132,4 @@ static struct driver_d mc34704_driver = { .probe = mc34704_probe, .of_compatible = DRV_OF_COMPAT(mc34704_dt_ids), }; - -static int mc34704_init(void) -{ - i2c_driver_register(&mc34704_driver); - return 0; -} -device_initcall(mc34704_init); +device_i2c_driver(mc34704_driver); diff --git a/drivers/mfd/mc9sdz60.c b/drivers/mfd/mc9sdz60.c index 9993efc5de..2cb38d9784 100644 --- a/drivers/mfd/mc9sdz60.c +++ b/drivers/mfd/mc9sdz60.c @@ -16,7 +16,6 @@ */ #include -#include #include #include #include @@ -139,11 +138,4 @@ static struct driver_d mc_driver = { .name = DRIVERNAME, .probe = mc_probe, }; - -static int mc_init(void) -{ - i2c_driver_register(&mc_driver); - return 0; -} - -device_initcall(mc_init); +device_i2c_driver(mc_driver); diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c index 51c56bbf56..084e4b43bb 100644 --- a/drivers/mfd/stmpe-i2c.c +++ b/drivers/mfd/stmpe-i2c.c @@ -15,7 +15,6 @@ */ #include -#include #include #include #include @@ -173,11 +172,4 @@ static struct driver_d stmpe_driver = { .probe = stmpe_probe, .id_table = stmpe_i2c_id, }; - -static int stmpe_init(void) -{ - i2c_driver_register(&stmpe_driver); - return 0; -} - -device_initcall(stmpe_init); +device_i2c_driver(stmpe_driver); diff --git a/drivers/mfd/twl4030.c b/drivers/mfd/twl4030.c index 3b4c661a87..cf33efbd89 100644 --- a/drivers/mfd/twl4030.c +++ b/drivers/mfd/twl4030.c @@ -6,7 +6,6 @@ */ #include -#include #include #include #include @@ -50,11 +49,4 @@ static struct driver_d twl_driver = { .name = DRIVERNAME, .probe = twl_probe, }; - -static int twl_init(void) -{ - i2c_driver_register(&twl_driver); - return 0; -} - -device_initcall(twl_init); +device_i2c_driver(twl_driver); diff --git a/drivers/mfd/twl6030.c b/drivers/mfd/twl6030.c index 0645d3c4db..0a244de077 100644 --- a/drivers/mfd/twl6030.c +++ b/drivers/mfd/twl6030.c @@ -5,7 +5,6 @@ */ #include -#include #include #include #include @@ -67,11 +66,4 @@ static struct driver_d twl_driver = { .name = DRIVERNAME, .probe = twl_probe, }; - -static int twl_init(void) -{ - i2c_driver_register(&twl_driver); - return 0; -} - -device_initcall(twl_init); +device_i2c_driver(twl_driver); diff --git a/drivers/rtc/rtc-abracon.c b/drivers/rtc/rtc-abracon.c index 02de2f1063..571909bf71 100644 --- a/drivers/rtc/rtc-abracon.c +++ b/drivers/rtc/rtc-abracon.c @@ -10,7 +10,6 @@ */ #include -#include #include #include #include @@ -118,9 +117,4 @@ static struct driver_d abracon_driver = { .probe = abracon_probe, .id_table = abracon_id, }; - -static int __init abracon_init(void) -{ - return i2c_driver_register(&abracon_driver); -} -device_initcall(abracon_init); +device_i2c_driver(abracon_driver); diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index 73d88ba6f2..78419811bd 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c @@ -14,7 +14,6 @@ */ #include -#include #include #include #include @@ -489,9 +488,4 @@ static struct driver_d ds1307_driver = { .probe = ds1307_probe, .id_table = ds1307_id, }; - -static int __init ds1307_init(void) -{ - return i2c_driver_register(&ds1307_driver); -} -device_initcall(ds1307_init); +device_i2c_driver(ds1307_driver); diff --git a/drivers/video/mtl017.c b/drivers/video/mtl017.c index 1a1f686223..085ea110ba 100644 --- a/drivers/video/mtl017.c +++ b/drivers/video/mtl017.c @@ -16,7 +16,6 @@ * */ #include -#include #include #include #include @@ -270,11 +269,4 @@ static struct driver_d twl_driver = { .name = "mtl017", .probe = mtl017_probe, }; - -static int mtl017_init(void) -{ - i2c_driver_register(&twl_driver); - return 0; -} - -device_initcall(mtl017_init); +device_i2c_driver(twl_driver); diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c index 54e02e7220..d68f0c5056 100644 --- a/drivers/video/ssd1307fb.c +++ b/drivers/video/ssd1307fb.c @@ -18,7 +18,6 @@ */ #include -#include #include #include #include @@ -581,11 +580,4 @@ static struct driver_d ssd1307fb_driver = { .probe = ssd1307fb_probe, .of_compatible = DRV_OF_COMPAT(ssd1307fb_of_match), }; - -static int ssd1307_init(void) -{ - i2c_driver_register(&ssd1307fb_driver); - return 0; -} - -device_initcall(ssd1307_init); +device_i2c_driver(ssd1307fb_driver); diff --git a/drivers/video/tc358767.c b/drivers/video/tc358767.c index 125e8236c1..e64dde1ddf 100644 --- a/drivers/video/tc358767.c +++ b/drivers/video/tc358767.c @@ -20,7 +20,6 @@ */ #include -#include #include #include #include @@ -1434,9 +1433,4 @@ static struct driver_d tc_driver = { .name = "tc358767", .probe = tc_probe, }; - -static int tc_init(void) -{ - return i2c_driver_register(&tc_driver); -} -device_initcall(tc_init); +device_i2c_driver(tc_driver); diff --git a/include/i2c/i2c.h b/include/i2c/i2c.h index cf784ca1f1..17b507ca22 100644 --- a/include/i2c/i2c.h +++ b/include/i2c/i2c.h @@ -17,6 +17,7 @@ #define I2C_I2C_H #include +#include #include struct i2c_adapter; @@ -297,4 +298,7 @@ static inline int i2c_driver_register(struct driver_d *drv) return register_driver(drv); } +#define device_i2c_driver(drv) \ + register_driver_macro(device, i2c, drv) + #endif /* I2C_I2C_H */ -- cgit v1.2.3 From 2ab1c1bcc2c290b2e7a13b915d9e953b2cb2592d Mon Sep 17 00:00:00 2001 From: Marco Felsch Date: Thu, 18 Oct 2018 13:47:08 +0200 Subject: rtc: ds1307: Add ds3231 to driver's ID list In contrast to the ds1337 the ds3231 has a built-in temperature compensated crystal oscillator. The register map seems the same as the one from the ds1337, so using it's driver_data is okay. Signed-off-by: Marco Felsch Signed-off-by: Sascha Hauer --- drivers/rtc/rtc-ds1307.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index 78419811bd..bb597305e5 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c @@ -111,6 +111,7 @@ static struct platform_device_id ds1307_id[] = { { "ds1308", ds_1338 }, /* Difference 1308 to 1338 irrelevant */ { "ds1338", ds_1338 }, { "ds1341", ds_1341 }, + { "ds3231", ds_1337 }, { "pt7c4338", ds_1307 }, { } }; -- cgit v1.2.3 From a2566675bda879de505b04206f5eeaa85f574446 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Thu, 1 Nov 2018 17:01:36 +0000 Subject: net: designware: look for a child device node for MDIO bus The Designware driver registers a local MDIO bus for each MAC device, but without setting a device node pointer for the MDIO bus device. In this case, mdiobus_register() will use the MDIO bus's parent device node (if any) as the MDIO device node. If the MAC device node has a child node compatible with "snps,dwmac-mdio", let us use that as the MDIO bus device node. Otherwise, leave the MDIO bus device node pointer set to NULL and carry on as before. The upshot is that PHY device nodes can now be placed in an intermediate node for the MDIO bus instead of having to place them directly in the Designware MAC device node. (Tested on a Terasic DE0-Nano-SoC with a suitably modified device tree.) Signed-off-by: Ian Abbott Signed-off-by: Sascha Hauer --- drivers/net/designware.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers') diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 49ddaa20d8..58880b0e52 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -408,12 +408,22 @@ static void dwc_version(struct device_d *dev, u32 hwid) static int dwc_probe_dt(struct device_d *dev, struct dw_eth_dev *priv) { + struct device_node *child; + if (!IS_ENABLED(CONFIG_OFTREE)) return -ENODEV; priv->phy_addr = -1; priv->interface = of_get_phy_mode(dev->device_node); + /* Set MDIO bus device node, if present. */ + for_each_child_of_node(dev->device_node, child) { + if (of_device_is_compatible(child, "snps,dwmac-mdio")) { + priv->miibus.dev.device_node = child; + break; + } + } + return 0; } -- cgit v1.2.3 From b8cfa99541e218bdf76a63872eb252e0ef94078d Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 2 Nov 2018 08:16:12 +0100 Subject: pinctrl: at91: Do not print registration messages Turn registration messages into dev_dbg. Signed-off-by: Sascha Hauer --- drivers/pinctrl/pinctrl-at91.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index 0303869774..630f11be76 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c @@ -510,7 +510,7 @@ static int at91_pinctrl_probe(struct device_d *dev) if (ret) return ret; - dev_info(dev, "AT91 pinctrl registered\n"); + dev_dbg(dev, "AT91 pinctrl registered\n"); return 0; } @@ -690,7 +690,7 @@ static int at91_gpio_probe(struct device_d *dev) return ret; } - dev_info(dev, "AT91 gpio driver registered\n"); + dev_dbg(dev, "AT91 gpio driver registered\n"); return 0; } -- cgit v1.2.3 From 459bf1fd31da2c091c6c1e3a7e0f6a1b1cbf588b Mon Sep 17 00:00:00 2001 From: "perachet7@gmail.com" Date: Thu, 8 Nov 2018 15:34:29 +0100 Subject: ARM: clk: rk3188: don't set same clk rate twice We found setting a clock rate which has already been set, rk3188 (radxa rock pro) bails out. This is a quick fix only. Underlying situation not (yet) investigated: why it is even trying to set it to the same rate again. It remains to state that some but not all rrpro boards exhibit this behaviour, no other rk3188 boards have been tested. Signed-off-by: P. Rachet Signed-off-by: Sascha Hauer --- drivers/clk/rockchip/clk-pll.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/clk/rockchip/clk-pll.c b/drivers/clk/rockchip/clk-pll.c index f0dc12091b..87a3969c28 100644 --- a/drivers/clk/rockchip/clk-pll.c +++ b/drivers/clk/rockchip/clk-pll.c @@ -164,6 +164,9 @@ static int rockchip_rk3066_pll_set_rate(struct clk *hw, unsigned long drate, int cur_parent; int ret; + if (old_rate == drate) + return 0; + pr_debug("%s: changing %s from %lu to %lu with a parent rate of %lu\n", __func__, __clk_get_name(hw), old_rate, drate, prate); -- cgit v1.2.3