Kuninori Morimoto | 8f45b11 | 2012-07-05 01:24:46 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 Renesas Solutions Corp. |
| 3 | * |
| 4 | * Kuninori Morimoto <morimoto.kuninori@renesas.com> |
| 5 | * |
| 6 | * This file is subject to the terms and conditions of the GNU General Public |
| 7 | * License. See the file "COPYING" in the main directory of this archive |
| 8 | * for more details. |
| 9 | */ |
| 10 | #ifndef PM_RMOBILE_H |
| 11 | #define PM_RMOBILE_H |
| 12 | |
| 13 | #include <linux/pm_domain.h> |
| 14 | |
Rafael J. Wysocki | ac18e02 | 2012-08-15 20:56:26 +0200 | [diff] [blame] | 15 | #define DEFAULT_DEV_LATENCY_NS 250000 |
| 16 | |
Kuninori Morimoto | 8f45b11 | 2012-07-05 01:24:46 -0700 | [diff] [blame] | 17 | struct platform_device; |
| 18 | |
| 19 | struct rmobile_pm_domain { |
| 20 | struct generic_pm_domain genpd; |
| 21 | struct dev_power_governor *gov; |
| 22 | int (*suspend)(void); |
| 23 | void (*resume)(void); |
Geert Uytterhoeven | 25717b8 | 2014-12-03 14:41:44 +0100 | [diff] [blame] | 24 | void __iomem *base; |
Kuninori Morimoto | 8f45b11 | 2012-07-05 01:24:46 -0700 | [diff] [blame] | 25 | unsigned int bit_shift; |
| 26 | bool no_debug; |
| 27 | }; |
| 28 | |
| 29 | static inline |
| 30 | struct rmobile_pm_domain *to_rmobile_pd(struct generic_pm_domain *d) |
| 31 | { |
| 32 | return container_of(d, struct rmobile_pm_domain, genpd); |
| 33 | } |
| 34 | |
Rafael J. Wysocki | ac18e02 | 2012-08-15 20:56:26 +0200 | [diff] [blame] | 35 | struct pm_domain_device { |
| 36 | const char *domain_name; |
| 37 | struct platform_device *pdev; |
| 38 | }; |
| 39 | |
Geert Uytterhoeven | 2173fc7 | 2014-12-03 14:41:45 +0100 | [diff] [blame] | 40 | #if defined(CONFIG_PM_RMOBILE) && defined(CONFIG_ARCH_SHMOBILE_LEGACY) |
Rafael J. Wysocki | 0d09f45 | 2012-08-07 01:10:22 +0200 | [diff] [blame] | 41 | extern void rmobile_init_domains(struct rmobile_pm_domain domains[], int num); |
Rafael J. Wysocki | 455ae3a | 2012-08-08 00:27:52 +0200 | [diff] [blame] | 42 | extern void rmobile_add_device_to_domain_td(const char *domain_name, |
| 43 | struct platform_device *pdev, |
| 44 | struct gpd_timing_data *td); |
| 45 | |
| 46 | static inline void rmobile_add_device_to_domain(const char *domain_name, |
| 47 | struct platform_device *pdev) |
| 48 | { |
| 49 | rmobile_add_device_to_domain_td(domain_name, pdev, NULL); |
| 50 | } |
| 51 | |
Rafael J. Wysocki | ac18e02 | 2012-08-15 20:56:26 +0200 | [diff] [blame] | 52 | extern void rmobile_add_devices_to_domains(struct pm_domain_device data[], |
| 53 | int size); |
Kuninori Morimoto | 8f45b11 | 2012-07-05 01:24:46 -0700 | [diff] [blame] | 54 | #else |
Rafael J. Wysocki | 455ae3a | 2012-08-08 00:27:52 +0200 | [diff] [blame] | 55 | |
Rafael J. Wysocki | 0d09f45 | 2012-08-07 01:10:22 +0200 | [diff] [blame] | 56 | #define rmobile_init_domains(domains, num) do { } while (0) |
Rafael J. Wysocki | 455ae3a | 2012-08-08 00:27:52 +0200 | [diff] [blame] | 57 | #define rmobile_add_device_to_domain_td(name, pdev, td) do { } while (0) |
Rafael J. Wysocki | 8bdd946 | 2012-08-07 01:07:01 +0200 | [diff] [blame] | 58 | #define rmobile_add_device_to_domain(name, pdev) do { } while (0) |
Rafael J. Wysocki | ac18e02 | 2012-08-15 20:56:26 +0200 | [diff] [blame] | 59 | |
| 60 | static inline void rmobile_add_devices_to_domains(struct pm_domain_device d[], |
| 61 | int size) {} |
Magnus Damm | abebbc4 | 2014-08-25 12:04:01 +0900 | [diff] [blame] | 62 | #endif /* CONFIG_PM_RMOBILE */ |
Kuninori Morimoto | 8f45b11 | 2012-07-05 01:24:46 -0700 | [diff] [blame] | 63 | |
| 64 | #endif /* PM_RMOBILE_H */ |