diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-18 16:14:02 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-18 16:14:02 -0400 |
| commit | 4a5219edcdae52bfb5eea0dfc2a7bd575961dad7 (patch) | |
| tree | 863f6efeac5fe9ba4f1f8d23b32b2947130ed510 /include/linux | |
| parent | 9797f6b0504122e4ad9ff047a3d0521ad6706386 (diff) | |
| parent | 5420f9fd159761b88978c312c3b350546f8615bb (diff) | |
Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver updates from Arnd Bergmann:
"Driver updates for ARM SoCs, these contain various things that touch
the drivers/ directory but got merged through arm-soc for practical
reasons.
For the most part, this is now related to power management
controllers, which have not yet been abstracted into a separate
subsystem, and typically require some code in drivers/soc or arch/arm
to control the power domains.
Another large chunk here is a rework of the NVIDIA Tegra USB3.0
support, which was surprisingly tricky and took a long time to get
done.
Finally, reset controller handling as always gets merged through here
as well"
* tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (97 commits)
arm-ccn: Enable building as module
soc/tegra: pmc: Add generic PM domain support
usb: xhci: tegra: Add Tegra210 support
usb: xhci: Add NVIDIA Tegra XUSB controller driver
dt-bindings: usb: xhci-tegra: Add Tegra210 XUSB controller support
dt-bindings: usb: Add NVIDIA Tegra XUSB controller binding
PCI: tegra: Support per-lane PHYs
dt-bindings: pci: tegra: Update for per-lane PHYs
phy: tegra: Add Tegra210 support
phy: Add Tegra XUSB pad controller support
dt-bindings: phy: tegra-xusb-padctl: Add Tegra210 support
dt-bindings: phy: Add NVIDIA Tegra XUSB pad controller binding
phy: core: Allow children node to be overridden
clk: tegra: Add interface to enable hardware control of SATA/XUSB PLLs
drivers: firmware: psci: make two helper functions inline
soc: renesas: rcar-sysc: Add support for R-Car H3 power areas
soc: renesas: rcar-sysc: Add support for R-Car E2 power areas
soc: renesas: rcar-sysc: Add support for R-Car M2-N power areas
soc: renesas: rcar-sysc: Add support for R-Car M2-W power areas
soc: renesas: rcar-sysc: Add support for R-Car H2 power areas
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/clk/renesas.h | 16 | ||||
| -rw-r--r-- | include/linux/clk/tegra.h | 5 | ||||
| -rw-r--r-- | include/linux/phy/phy.h | 31 | ||||
| -rw-r--r-- | include/linux/phy/tegra/xusb.h | 30 | ||||
| -rw-r--r-- | include/linux/psci.h | 2 | ||||
| -rw-r--r-- | include/linux/reset-controller.h | 2 | ||||
| -rw-r--r-- | include/linux/reset.h | 194 | ||||
| -rw-r--r-- | include/linux/soc/renesas/rcar-sysc.h | 16 |
8 files changed, 246 insertions, 50 deletions
diff --git a/include/linux/clk/renesas.h b/include/linux/clk/renesas.h index 7adfd80fbf55..ba6fa4148515 100644 --- a/include/linux/clk/renesas.h +++ b/include/linux/clk/renesas.h | |||
| @@ -24,12 +24,20 @@ void r8a7778_clocks_init(u32 mode); | |||
| 24 | void r8a7779_clocks_init(u32 mode); | 24 | void r8a7779_clocks_init(u32 mode); |
| 25 | void rcar_gen2_clocks_init(u32 mode); | 25 | void rcar_gen2_clocks_init(u32 mode); |
| 26 | 26 | ||
| 27 | #ifdef CONFIG_PM_GENERIC_DOMAINS_OF | ||
| 28 | void cpg_mstp_add_clk_domain(struct device_node *np); | 27 | void cpg_mstp_add_clk_domain(struct device_node *np); |
| 29 | int cpg_mstp_attach_dev(struct generic_pm_domain *domain, struct device *dev); | 28 | #ifdef CONFIG_CLK_RENESAS_CPG_MSTP |
| 30 | void cpg_mstp_detach_dev(struct generic_pm_domain *domain, struct device *dev); | 29 | int cpg_mstp_attach_dev(struct generic_pm_domain *unused, struct device *dev); |
| 30 | void cpg_mstp_detach_dev(struct generic_pm_domain *unused, struct device *dev); | ||
| 31 | #else | 31 | #else |
| 32 | static inline void cpg_mstp_add_clk_domain(struct device_node *np) {} | 32 | #define cpg_mstp_attach_dev NULL |
| 33 | #define cpg_mstp_detach_dev NULL | ||
| 33 | #endif | 34 | #endif |
| 34 | 35 | ||
| 36 | #ifdef CONFIG_CLK_RENESAS_CPG_MSSR | ||
| 37 | int cpg_mssr_attach_dev(struct generic_pm_domain *unused, struct device *dev); | ||
| 38 | void cpg_mssr_detach_dev(struct generic_pm_domain *unused, struct device *dev); | ||
| 39 | #else | ||
| 40 | #define cpg_mssr_attach_dev NULL | ||
| 41 | #define cpg_mssr_detach_dev NULL | ||
| 42 | #endif | ||
| 35 | #endif | 43 | #endif |
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h index 57bf7aab4516..7007a5f48080 100644 --- a/include/linux/clk/tegra.h +++ b/include/linux/clk/tegra.h | |||
| @@ -121,4 +121,9 @@ static inline void tegra_cpu_clock_resume(void) | |||
| 121 | } | 121 | } |
| 122 | #endif | 122 | #endif |
| 123 | 123 | ||
| 124 | extern void tegra210_xusb_pll_hw_control_enable(void); | ||
| 125 | extern void tegra210_xusb_pll_hw_sequence_start(void); | ||
| 126 | extern void tegra210_sata_pll_hw_control_enable(void); | ||
| 127 | extern void tegra210_sata_pll_hw_sequence_start(void); | ||
| 128 | |||
| 124 | #endif /* __LINUX_CLK_TEGRA_H_ */ | 129 | #endif /* __LINUX_CLK_TEGRA_H_ */ |
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 8cf05e341cff..a810f2a18842 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h | |||
| @@ -77,6 +77,7 @@ struct phy { | |||
| 77 | */ | 77 | */ |
| 78 | struct phy_provider { | 78 | struct phy_provider { |
| 79 | struct device *dev; | 79 | struct device *dev; |
| 80 | struct device_node *children; | ||
| 80 | struct module *owner; | 81 | struct module *owner; |
| 81 | struct list_head list; | 82 | struct list_head list; |
| 82 | struct phy * (*of_xlate)(struct device *dev, | 83 | struct phy * (*of_xlate)(struct device *dev, |
| @@ -93,10 +94,16 @@ struct phy_lookup { | |||
| 93 | #define to_phy(a) (container_of((a), struct phy, dev)) | 94 | #define to_phy(a) (container_of((a), struct phy, dev)) |
| 94 | 95 | ||
| 95 | #define of_phy_provider_register(dev, xlate) \ | 96 | #define of_phy_provider_register(dev, xlate) \ |
| 96 | __of_phy_provider_register((dev), THIS_MODULE, (xlate)) | 97 | __of_phy_provider_register((dev), NULL, THIS_MODULE, (xlate)) |
| 97 | 98 | ||
| 98 | #define devm_of_phy_provider_register(dev, xlate) \ | 99 | #define devm_of_phy_provider_register(dev, xlate) \ |
| 99 | __devm_of_phy_provider_register((dev), THIS_MODULE, (xlate)) | 100 | __devm_of_phy_provider_register((dev), NULL, THIS_MODULE, (xlate)) |
| 101 | |||
| 102 | #define of_phy_provider_register_full(dev, children, xlate) \ | ||
| 103 | __of_phy_provider_register(dev, children, THIS_MODULE, xlate) | ||
| 104 | |||
| 105 | #define devm_of_phy_provider_register_full(dev, children, xlate) \ | ||
| 106 | __devm_of_phy_provider_register(dev, children, THIS_MODULE, xlate) | ||
| 100 | 107 | ||
| 101 | static inline void phy_set_drvdata(struct phy *phy, void *data) | 108 | static inline void phy_set_drvdata(struct phy *phy, void *data) |
| 102 | { | 109 | { |
| @@ -147,11 +154,13 @@ struct phy *devm_phy_create(struct device *dev, struct device_node *node, | |||
| 147 | void phy_destroy(struct phy *phy); | 154 | void phy_destroy(struct phy *phy); |
| 148 | void devm_phy_destroy(struct device *dev, struct phy *phy); | 155 | void devm_phy_destroy(struct device *dev, struct phy *phy); |
| 149 | struct phy_provider *__of_phy_provider_register(struct device *dev, | 156 | struct phy_provider *__of_phy_provider_register(struct device *dev, |
| 150 | struct module *owner, struct phy * (*of_xlate)(struct device *dev, | 157 | struct device_node *children, struct module *owner, |
| 151 | struct of_phandle_args *args)); | 158 | struct phy * (*of_xlate)(struct device *dev, |
| 159 | struct of_phandle_args *args)); | ||
| 152 | struct phy_provider *__devm_of_phy_provider_register(struct device *dev, | 160 | struct phy_provider *__devm_of_phy_provider_register(struct device *dev, |
| 153 | struct module *owner, struct phy * (*of_xlate)(struct device *dev, | 161 | struct device_node *children, struct module *owner, |
| 154 | struct of_phandle_args *args)); | 162 | struct phy * (*of_xlate)(struct device *dev, |
| 163 | struct of_phandle_args *args)); | ||
| 155 | void of_phy_provider_unregister(struct phy_provider *phy_provider); | 164 | void of_phy_provider_unregister(struct phy_provider *phy_provider); |
| 156 | void devm_of_phy_provider_unregister(struct device *dev, | 165 | void devm_of_phy_provider_unregister(struct device *dev, |
| 157 | struct phy_provider *phy_provider); | 166 | struct phy_provider *phy_provider); |
| @@ -312,15 +321,17 @@ static inline void devm_phy_destroy(struct device *dev, struct phy *phy) | |||
| 312 | } | 321 | } |
| 313 | 322 | ||
| 314 | static inline struct phy_provider *__of_phy_provider_register( | 323 | static inline struct phy_provider *__of_phy_provider_register( |
| 315 | struct device *dev, struct module *owner, struct phy * (*of_xlate)( | 324 | struct device *dev, struct device_node *children, struct module *owner, |
| 316 | struct device *dev, struct of_phandle_args *args)) | 325 | struct phy * (*of_xlate)(struct device *dev, |
| 326 | struct of_phandle_args *args)) | ||
| 317 | { | 327 | { |
| 318 | return ERR_PTR(-ENOSYS); | 328 | return ERR_PTR(-ENOSYS); |
| 319 | } | 329 | } |
| 320 | 330 | ||
| 321 | static inline struct phy_provider *__devm_of_phy_provider_register(struct device | 331 | static inline struct phy_provider *__devm_of_phy_provider_register(struct device |
| 322 | *dev, struct module *owner, struct phy * (*of_xlate)(struct device *dev, | 332 | *dev, struct device_node *children, struct module *owner, |
| 323 | struct of_phandle_args *args)) | 333 | struct phy * (*of_xlate)(struct device *dev, |
| 334 | struct of_phandle_args *args)) | ||
| 324 | { | 335 | { |
| 325 | return ERR_PTR(-ENOSYS); | 336 | return ERR_PTR(-ENOSYS); |
| 326 | } | 337 | } |
diff --git a/include/linux/phy/tegra/xusb.h b/include/linux/phy/tegra/xusb.h new file mode 100644 index 000000000000..8e1a57a78d9f --- /dev/null +++ b/include/linux/phy/tegra/xusb.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify it | ||
| 5 | * under the terms and conditions of the GNU General Public License, | ||
| 6 | * version 2, as published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 11 | * more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef PHY_TEGRA_XUSB_H | ||
| 15 | #define PHY_TEGRA_XUSB_H | ||
| 16 | |||
| 17 | struct tegra_xusb_padctl; | ||
| 18 | struct device; | ||
| 19 | |||
| 20 | struct tegra_xusb_padctl *tegra_xusb_padctl_get(struct device *dev); | ||
| 21 | void tegra_xusb_padctl_put(struct tegra_xusb_padctl *padctl); | ||
| 22 | |||
| 23 | int tegra_xusb_padctl_usb3_save_context(struct tegra_xusb_padctl *padctl, | ||
| 24 | unsigned int port); | ||
| 25 | int tegra_xusb_padctl_hsic_set_idle(struct tegra_xusb_padctl *padctl, | ||
| 26 | unsigned int port, bool idle); | ||
| 27 | int tegra_xusb_padctl_usb3_set_lfps_detect(struct tegra_xusb_padctl *padctl, | ||
| 28 | unsigned int port, bool enable); | ||
| 29 | |||
| 30 | #endif /* PHY_TEGRA_XUSB_H */ | ||
diff --git a/include/linux/psci.h b/include/linux/psci.h index 393efe2edf9a..bdea1cb5e1db 100644 --- a/include/linux/psci.h +++ b/include/linux/psci.h | |||
| @@ -21,8 +21,6 @@ | |||
| 21 | #define PSCI_POWER_STATE_TYPE_POWER_DOWN 1 | 21 | #define PSCI_POWER_STATE_TYPE_POWER_DOWN 1 |
| 22 | 22 | ||
| 23 | bool psci_tos_resident_on(int cpu); | 23 | bool psci_tos_resident_on(int cpu); |
| 24 | bool psci_power_state_loses_context(u32 state); | ||
| 25 | bool psci_power_state_is_valid(u32 state); | ||
| 26 | 24 | ||
| 27 | int psci_cpu_init_idle(unsigned int cpu); | 25 | int psci_cpu_init_idle(unsigned int cpu); |
| 28 | int psci_cpu_suspend_enter(unsigned long index); | 26 | int psci_cpu_suspend_enter(unsigned long index); |
diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h index a3a5bcdb1d02..b91ba932bbd4 100644 --- a/include/linux/reset-controller.h +++ b/include/linux/reset-controller.h | |||
| @@ -31,6 +31,7 @@ struct of_phandle_args; | |||
| 31 | * @ops: a pointer to device specific struct reset_control_ops | 31 | * @ops: a pointer to device specific struct reset_control_ops |
| 32 | * @owner: kernel module of the reset controller driver | 32 | * @owner: kernel module of the reset controller driver |
| 33 | * @list: internal list of reset controller devices | 33 | * @list: internal list of reset controller devices |
| 34 | * @reset_control_head: head of internal list of requested reset controls | ||
| 34 | * @of_node: corresponding device tree node as phandle target | 35 | * @of_node: corresponding device tree node as phandle target |
| 35 | * @of_reset_n_cells: number of cells in reset line specifiers | 36 | * @of_reset_n_cells: number of cells in reset line specifiers |
| 36 | * @of_xlate: translation function to translate from specifier as found in the | 37 | * @of_xlate: translation function to translate from specifier as found in the |
| @@ -41,6 +42,7 @@ struct reset_controller_dev { | |||
| 41 | const struct reset_control_ops *ops; | 42 | const struct reset_control_ops *ops; |
| 42 | struct module *owner; | 43 | struct module *owner; |
| 43 | struct list_head list; | 44 | struct list_head list; |
| 45 | struct list_head reset_control_head; | ||
| 44 | struct device_node *of_node; | 46 | struct device_node *of_node; |
| 45 | int of_reset_n_cells; | 47 | int of_reset_n_cells; |
| 46 | int (*of_xlate)(struct reset_controller_dev *rcdev, | 48 | int (*of_xlate)(struct reset_controller_dev *rcdev, |
diff --git a/include/linux/reset.h b/include/linux/reset.h index c4c097de0ba9..ec0306ce7b92 100644 --- a/include/linux/reset.h +++ b/include/linux/reset.h | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | #ifndef _LINUX_RESET_H_ | 1 | #ifndef _LINUX_RESET_H_ |
| 2 | #define _LINUX_RESET_H_ | 2 | #define _LINUX_RESET_H_ |
| 3 | 3 | ||
| 4 | struct device; | 4 | #include <linux/device.h> |
| 5 | struct device_node; | 5 | |
| 6 | struct reset_control; | 6 | struct reset_control; |
| 7 | 7 | ||
| 8 | #ifdef CONFIG_RESET_CONTROLLER | 8 | #ifdef CONFIG_RESET_CONTROLLER |
| @@ -12,9 +12,11 @@ int reset_control_assert(struct reset_control *rstc); | |||
| 12 | int reset_control_deassert(struct reset_control *rstc); | 12 | int reset_control_deassert(struct reset_control *rstc); |
| 13 | int reset_control_status(struct reset_control *rstc); | 13 | int reset_control_status(struct reset_control *rstc); |
| 14 | 14 | ||
| 15 | struct reset_control *reset_control_get(struct device *dev, const char *id); | 15 | struct reset_control *__of_reset_control_get(struct device_node *node, |
| 16 | const char *id, int index, int shared); | ||
| 16 | void reset_control_put(struct reset_control *rstc); | 17 | void reset_control_put(struct reset_control *rstc); |
| 17 | struct reset_control *devm_reset_control_get(struct device *dev, const char *id); | 18 | struct reset_control *__devm_reset_control_get(struct device *dev, |
| 19 | const char *id, int index, int shared); | ||
| 18 | 20 | ||
| 19 | int __must_check device_reset(struct device *dev); | 21 | int __must_check device_reset(struct device *dev); |
| 20 | 22 | ||
| @@ -23,24 +25,6 @@ static inline int device_reset_optional(struct device *dev) | |||
| 23 | return device_reset(dev); | 25 | return device_reset(dev); |
| 24 | } | 26 | } |
| 25 | 27 | ||
| 26 | static inline struct reset_control *reset_control_get_optional( | ||
| 27 | struct device *dev, const char *id) | ||
| 28 | { | ||
| 29 | return reset_control_get(dev, id); | ||
| 30 | } | ||
| 31 | |||
| 32 | static inline struct reset_control *devm_reset_control_get_optional( | ||
| 33 | struct device *dev, const char *id) | ||
| 34 | { | ||
| 35 | return devm_reset_control_get(dev, id); | ||
| 36 | } | ||
| 37 | |||
| 38 | struct reset_control *of_reset_control_get(struct device_node *node, | ||
| 39 | const char *id); | ||
| 40 | |||
| 41 | struct reset_control *of_reset_control_get_by_index( | ||
| 42 | struct device_node *node, int index); | ||
| 43 | |||
| 44 | #else | 28 | #else |
| 45 | 29 | ||
| 46 | static inline int reset_control_reset(struct reset_control *rstc) | 30 | static inline int reset_control_reset(struct reset_control *rstc) |
| @@ -72,49 +56,191 @@ static inline void reset_control_put(struct reset_control *rstc) | |||
| 72 | WARN_ON(1); | 56 | WARN_ON(1); |
| 73 | } | 57 | } |
| 74 | 58 | ||
| 59 | static inline int __must_check device_reset(struct device *dev) | ||
| 60 | { | ||
| 61 | WARN_ON(1); | ||
| 62 | return -ENOTSUPP; | ||
| 63 | } | ||
| 64 | |||
| 75 | static inline int device_reset_optional(struct device *dev) | 65 | static inline int device_reset_optional(struct device *dev) |
| 76 | { | 66 | { |
| 77 | return -ENOTSUPP; | 67 | return -ENOTSUPP; |
| 78 | } | 68 | } |
| 79 | 69 | ||
| 80 | static inline struct reset_control *__must_check reset_control_get( | 70 | static inline struct reset_control *__of_reset_control_get( |
| 81 | struct device *dev, const char *id) | 71 | struct device_node *node, |
| 72 | const char *id, int index, int shared) | ||
| 82 | { | 73 | { |
| 83 | WARN_ON(1); | ||
| 84 | return ERR_PTR(-EINVAL); | 74 | return ERR_PTR(-EINVAL); |
| 85 | } | 75 | } |
| 86 | 76 | ||
| 87 | static inline struct reset_control *__must_check devm_reset_control_get( | 77 | static inline struct reset_control *__devm_reset_control_get( |
| 78 | struct device *dev, | ||
| 79 | const char *id, int index, int shared) | ||
| 80 | { | ||
| 81 | return ERR_PTR(-EINVAL); | ||
| 82 | } | ||
| 83 | |||
| 84 | #endif /* CONFIG_RESET_CONTROLLER */ | ||
| 85 | |||
| 86 | /** | ||
| 87 | * reset_control_get - Lookup and obtain an exclusive reference to a | ||
| 88 | * reset controller. | ||
| 89 | * @dev: device to be reset by the controller | ||
| 90 | * @id: reset line name | ||
| 91 | * | ||
| 92 | * Returns a struct reset_control or IS_ERR() condition containing errno. | ||
| 93 | * If this function is called more then once for the same reset_control it will | ||
| 94 | * return -EBUSY. | ||
| 95 | * | ||
| 96 | * See reset_control_get_shared for details on shared references to | ||
| 97 | * reset-controls. | ||
| 98 | * | ||
| 99 | * Use of id names is optional. | ||
| 100 | */ | ||
| 101 | static inline struct reset_control *__must_check reset_control_get( | ||
| 88 | struct device *dev, const char *id) | 102 | struct device *dev, const char *id) |
| 89 | { | 103 | { |
| 104 | #ifndef CONFIG_RESET_CONTROLLER | ||
| 90 | WARN_ON(1); | 105 | WARN_ON(1); |
| 91 | return ERR_PTR(-EINVAL); | 106 | #endif |
| 107 | return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0); | ||
| 92 | } | 108 | } |
| 93 | 109 | ||
| 94 | static inline struct reset_control *reset_control_get_optional( | 110 | static inline struct reset_control *reset_control_get_optional( |
| 95 | struct device *dev, const char *id) | 111 | struct device *dev, const char *id) |
| 96 | { | 112 | { |
| 97 | return ERR_PTR(-ENOTSUPP); | 113 | return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0); |
| 98 | } | 114 | } |
| 99 | 115 | ||
| 100 | static inline struct reset_control *devm_reset_control_get_optional( | 116 | /** |
| 117 | * reset_control_get_shared - Lookup and obtain a shared reference to a | ||
| 118 | * reset controller. | ||
| 119 | * @dev: device to be reset by the controller | ||
| 120 | * @id: reset line name | ||
| 121 | * | ||
| 122 | * Returns a struct reset_control or IS_ERR() condition containing errno. | ||
| 123 | * This function is intended for use with reset-controls which are shared | ||
| 124 | * between hardware-blocks. | ||
| 125 | * | ||
| 126 | * When a reset-control is shared, the behavior of reset_control_assert / | ||
| 127 | * deassert is changed, the reset-core will keep track of a deassert_count | ||
| 128 | * and only (re-)assert the reset after reset_control_assert has been called | ||
| 129 | * as many times as reset_control_deassert was called. Also see the remark | ||
| 130 | * about shared reset-controls in the reset_control_assert docs. | ||
| 131 | * | ||
| 132 | * Calling reset_control_assert without first calling reset_control_deassert | ||
| 133 | * is not allowed on a shared reset control. Calling reset_control_reset is | ||
| 134 | * also not allowed on a shared reset control. | ||
| 135 | * | ||
| 136 | * Use of id names is optional. | ||
| 137 | */ | ||
| 138 | static inline struct reset_control *reset_control_get_shared( | ||
| 101 | struct device *dev, const char *id) | 139 | struct device *dev, const char *id) |
| 102 | { | 140 | { |
| 103 | return ERR_PTR(-ENOTSUPP); | 141 | return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1); |
| 104 | } | 142 | } |
| 105 | 143 | ||
| 144 | /** | ||
| 145 | * of_reset_control_get - Lookup and obtain an exclusive reference to a | ||
| 146 | * reset controller. | ||
| 147 | * @node: device to be reset by the controller | ||
| 148 | * @id: reset line name | ||
| 149 | * | ||
| 150 | * Returns a struct reset_control or IS_ERR() condition containing errno. | ||
| 151 | * | ||
| 152 | * Use of id names is optional. | ||
| 153 | */ | ||
| 106 | static inline struct reset_control *of_reset_control_get( | 154 | static inline struct reset_control *of_reset_control_get( |
| 107 | struct device_node *node, const char *id) | 155 | struct device_node *node, const char *id) |
| 108 | { | 156 | { |
| 109 | return ERR_PTR(-ENOTSUPP); | 157 | return __of_reset_control_get(node, id, 0, 0); |
| 110 | } | 158 | } |
| 111 | 159 | ||
| 160 | /** | ||
| 161 | * of_reset_control_get_by_index - Lookup and obtain an exclusive reference to | ||
| 162 | * a reset controller by index. | ||
| 163 | * @node: device to be reset by the controller | ||
| 164 | * @index: index of the reset controller | ||
| 165 | * | ||
| 166 | * This is to be used to perform a list of resets for a device or power domain | ||
| 167 | * in whatever order. Returns a struct reset_control or IS_ERR() condition | ||
| 168 | * containing errno. | ||
| 169 | */ | ||
| 112 | static inline struct reset_control *of_reset_control_get_by_index( | 170 | static inline struct reset_control *of_reset_control_get_by_index( |
| 113 | struct device_node *node, int index) | 171 | struct device_node *node, int index) |
| 114 | { | 172 | { |
| 115 | return ERR_PTR(-ENOTSUPP); | 173 | return __of_reset_control_get(node, NULL, index, 0); |
| 116 | } | 174 | } |
| 117 | 175 | ||
| 118 | #endif /* CONFIG_RESET_CONTROLLER */ | 176 | /** |
| 177 | * devm_reset_control_get - resource managed reset_control_get() | ||
| 178 | * @dev: device to be reset by the controller | ||
| 179 | * @id: reset line name | ||
| 180 | * | ||
| 181 | * Managed reset_control_get(). For reset controllers returned from this | ||
| 182 | * function, reset_control_put() is called automatically on driver detach. | ||
| 183 | * See reset_control_get() for more information. | ||
| 184 | */ | ||
| 185 | static inline struct reset_control *__must_check devm_reset_control_get( | ||
| 186 | struct device *dev, const char *id) | ||
| 187 | { | ||
| 188 | #ifndef CONFIG_RESET_CONTROLLER | ||
| 189 | WARN_ON(1); | ||
| 190 | #endif | ||
| 191 | return __devm_reset_control_get(dev, id, 0, 0); | ||
| 192 | } | ||
| 193 | |||
| 194 | static inline struct reset_control *devm_reset_control_get_optional( | ||
| 195 | struct device *dev, const char *id) | ||
| 196 | { | ||
| 197 | return __devm_reset_control_get(dev, id, 0, 0); | ||
| 198 | } | ||
| 199 | |||
| 200 | /** | ||
| 201 | * devm_reset_control_get_by_index - resource managed reset_control_get | ||
| 202 | * @dev: device to be reset by the controller | ||
| 203 | * @index: index of the reset controller | ||
| 204 | * | ||
| 205 | * Managed reset_control_get(). For reset controllers returned from this | ||
| 206 | * function, reset_control_put() is called automatically on driver detach. | ||
| 207 | * See reset_control_get() for more information. | ||
| 208 | */ | ||
| 209 | static inline struct reset_control *devm_reset_control_get_by_index( | ||
| 210 | struct device *dev, int index) | ||
| 211 | { | ||
| 212 | return __devm_reset_control_get(dev, NULL, index, 0); | ||
| 213 | } | ||
| 214 | |||
| 215 | /** | ||
| 216 | * devm_reset_control_get_shared - resource managed reset_control_get_shared() | ||
| 217 | * @dev: device to be reset by the controller | ||
| 218 | * @id: reset line name | ||
| 219 | * | ||
| 220 | * Managed reset_control_get_shared(). For reset controllers returned from | ||
| 221 | * this function, reset_control_put() is called automatically on driver detach. | ||
| 222 | * See reset_control_get_shared() for more information. | ||
| 223 | */ | ||
| 224 | static inline struct reset_control *devm_reset_control_get_shared( | ||
| 225 | struct device *dev, const char *id) | ||
| 226 | { | ||
| 227 | return __devm_reset_control_get(dev, id, 0, 1); | ||
| 228 | } | ||
| 229 | |||
| 230 | /** | ||
| 231 | * devm_reset_control_get_shared_by_index - resource managed | ||
| 232 | * reset_control_get_shared | ||
| 233 | * @dev: device to be reset by the controller | ||
| 234 | * @index: index of the reset controller | ||
| 235 | * | ||
| 236 | * Managed reset_control_get_shared(). For reset controllers returned from | ||
| 237 | * this function, reset_control_put() is called automatically on driver detach. | ||
| 238 | * See reset_control_get_shared() for more information. | ||
| 239 | */ | ||
| 240 | static inline struct reset_control *devm_reset_control_get_shared_by_index( | ||
| 241 | struct device *dev, int index) | ||
| 242 | { | ||
| 243 | return __devm_reset_control_get(dev, NULL, index, 1); | ||
| 244 | } | ||
| 119 | 245 | ||
| 120 | #endif | 246 | #endif |
diff --git a/include/linux/soc/renesas/rcar-sysc.h b/include/linux/soc/renesas/rcar-sysc.h new file mode 100644 index 000000000000..92fc613ab23d --- /dev/null +++ b/include/linux/soc/renesas/rcar-sysc.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #ifndef __LINUX_SOC_RENESAS_RCAR_SYSC_H__ | ||
| 2 | #define __LINUX_SOC_RENESAS_RCAR_SYSC_H__ | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | struct rcar_sysc_ch { | ||
| 7 | u16 chan_offs; | ||
| 8 | u8 chan_bit; | ||
| 9 | u8 isr_bit; | ||
| 10 | }; | ||
| 11 | |||
| 12 | int rcar_sysc_power_down(const struct rcar_sysc_ch *sysc_ch); | ||
| 13 | int rcar_sysc_power_up(const struct rcar_sysc_ch *sysc_ch); | ||
| 14 | void __iomem *rcar_sysc_init(phys_addr_t base); | ||
| 15 | |||
| 16 | #endif /* __LINUX_SOC_RENESAS_RCAR_SYSC_H__ */ | ||
