devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
  • * [PATCH 08/93] arm64: dts: rockchip: Add rktimer device node for rk3399
           [not found] ` <1467878526-1238-1-git-send-email-daniel.lezcano@linaro.org>
           [not found]   ` <1467878526-1238-1-git-send-email-daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
    @ 2016-07-07  8:00   ` Daniel Lezcano
      2016-07-07  8:00   ` [PATCH 11/93] of: Add a new macro to declare_of for one parameter function returning a value Daniel Lezcano
      2 siblings, 0 replies; 4+ messages in thread
    From: Daniel Lezcano @ 2016-07-07  8:00 UTC (permalink / raw)
      To: tglx, daniel.lezcano
      Cc: Huang Tao, devicetree, Heiko Stuebner, linux-kernel,
    	linux-rockchip, Jianqun Xu, linux-arm-kernel, Caesar Wang
    
    From: Huang Tao <huangtao@rock-chips.com>
    
    Add a 'rktimer' node in the device treee for the ARM64 rk3399 SoC.
    
    Signed-off-by: Huang Tao <huangtao@rock-chips.com>
    Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Heiko Stuebner <heiko@sntech.de>
    Tested-by: Jianqun Xu <jay.xu@rock-chips.com>
    Signed-off-by: Caesar Wang <wxt@rock-chips.com>
    Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
    ---
     arch/arm64/boot/dts/rockchip/rk3399.dtsi | 8 ++++++++
     1 file changed, 8 insertions(+)
    
    diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
    index 46f325a..f0c0d76 100644
    --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
    +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
    @@ -492,6 +492,14 @@
     		interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
     	};
     
    +	rktimer: rktimer@ff850000 {
    +		compatible = "rockchip,rk3399-timer";
    +		reg = <0x0 0xff850000 0x0 0x1000>;
    +		interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
    +		clocks = <&cru PCLK_TIMER0>, <&cru SCLK_TIMER00>;
    +		clock-names = "pclk", "timer";
    +	};
    +
     	spdif: spdif@ff870000 {
     		compatible = "rockchip,rk3399-spdif";
     		reg = <0x0 0xff870000 0x0 0x1000>;
    -- 
    1.9.1
    
    ^ permalink raw reply related	[flat|nested] 4+ messages in thread
  • * [PATCH 11/93] of: Add a new macro to declare_of for one parameter function returning a value
           [not found] ` <1467878526-1238-1-git-send-email-daniel.lezcano@linaro.org>
           [not found]   ` <1467878526-1238-1-git-send-email-daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
      2016-07-07  8:00   ` [PATCH 08/93] arm64: dts: rockchip: Add rktimer device node for rk3399 Daniel Lezcano
    @ 2016-07-07  8:00   ` Daniel Lezcano
      2 siblings, 0 replies; 4+ messages in thread
    From: Daniel Lezcano @ 2016-07-07  8:00 UTC (permalink / raw)
      To: tglx, daniel.lezcano; +Cc: linux-kernel, Rob Herring, devicetree
    
    The macro OF_DECLARE_1 expect a void (*func)(struct device_node *) while the
    OF_DECLARE_2 expect a int (*func)(struct device_node *, struct device_node *).
    
    The second one allows to pass an init function returning a value, which make
    possible to call the functions in the table and check the return value in order
    to catch at a higher level the errors and handle them from there instead of
    doing a panic in each driver (well at least this is the case for the clkevt).
    
    Unfortunately the OF_DECLARE_1 does not allow that and that lead to some code
    duplication and crappyness in the drivers.
    
    The OF_DECLARE_1 is used by all the clk drivers and the clocksource/clockevent
    drivers. It is not possible to do the change in one shot as we have to change
    all the init functions.
    
    The OF_DECLARE_2 specifies an init function prototype with two parameters with
    the node and its parent. The latter won't be used, ever, in the timer drivers.
    
    Introduce a OF_DECLARE_1_RET macro to be used, and hopefully we can smoothly
    and iteratively change the users of OF_DECLARE_1 to use the new macro instead.
    
    Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
    Acked-by: Rob Herring <robh@kernel.org>
    ---
     include/linux/of.h | 3 +++
     1 file changed, 3 insertions(+)
    
    diff --git a/include/linux/of.h b/include/linux/of.h
    index c7292e8..552943d 100644
    --- a/include/linux/of.h
    +++ b/include/linux/of.h
    @@ -1009,10 +1009,13 @@ static inline int of_get_available_child_count(const struct device_node *np)
     #endif
     
     typedef int (*of_init_fn_2)(struct device_node *, struct device_node *);
    +typedef int (*of_init_fn_1_ret)(struct device_node *);
     typedef void (*of_init_fn_1)(struct device_node *);
     
     #define OF_DECLARE_1(table, name, compat, fn) \
     		_OF_DECLARE(table, name, compat, fn, of_init_fn_1)
    +#define OF_DECLARE_1_RET(table, name, compat, fn) \
    +		_OF_DECLARE(table, name, compat, fn, of_init_fn_1_ret)
     #define OF_DECLARE_2(table, name, compat, fn) \
     		_OF_DECLARE(table, name, compat, fn, of_init_fn_2)
     
    -- 
    1.9.1
    
    ^ permalink raw reply related	[flat|nested] 4+ messages in thread

  • end of thread, other threads:[~2016-07-07  8:00 UTC | newest]
    
    Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <577E0BED.3020608@linaro.org>
         [not found] ` <1467878526-1238-1-git-send-email-daniel.lezcano@linaro.org>
         [not found]   ` <1467878526-1238-1-git-send-email-daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
    2016-07-07  8:00     ` [PATCH 05/93] dt-bindings: Document rk3399 rk-timer bindings Daniel Lezcano
    2016-07-07  8:00     ` [PATCH 10/93] dt-bindings: clocksource: Add Oxford Semiconductor RPS Timer bindings Daniel Lezcano
    2016-07-07  8:00   ` [PATCH 08/93] arm64: dts: rockchip: Add rktimer device node for rk3399 Daniel Lezcano
    2016-07-07  8:00   ` [PATCH 11/93] of: Add a new macro to declare_of for one parameter function returning a value Daniel Lezcano
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox;
    as well as URLs for NNTP newsgroup(s).