diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mfd/samsung/s2mps11.h | 2 | ||||
-rw-r--r-- | include/linux/mm.h | 9 | ||||
-rw-r--r-- | include/linux/swap.h | 6 |
3 files changed, 14 insertions, 3 deletions
diff --git a/include/linux/mfd/samsung/s2mps11.h b/include/linux/mfd/samsung/s2mps11.h index b288965e8101..2c14eeca46f0 100644 --- a/include/linux/mfd/samsung/s2mps11.h +++ b/include/linux/mfd/samsung/s2mps11.h | |||
@@ -173,10 +173,12 @@ enum s2mps11_regulators { | |||
173 | 173 | ||
174 | #define S2MPS11_LDO_VSEL_MASK 0x3F | 174 | #define S2MPS11_LDO_VSEL_MASK 0x3F |
175 | #define S2MPS11_BUCK_VSEL_MASK 0xFF | 175 | #define S2MPS11_BUCK_VSEL_MASK 0xFF |
176 | #define S2MPS11_BUCK9_VSEL_MASK 0x1F | ||
176 | #define S2MPS11_ENABLE_MASK (0x03 << S2MPS11_ENABLE_SHIFT) | 177 | #define S2MPS11_ENABLE_MASK (0x03 << S2MPS11_ENABLE_SHIFT) |
177 | #define S2MPS11_ENABLE_SHIFT 0x06 | 178 | #define S2MPS11_ENABLE_SHIFT 0x06 |
178 | #define S2MPS11_LDO_N_VOLTAGES (S2MPS11_LDO_VSEL_MASK + 1) | 179 | #define S2MPS11_LDO_N_VOLTAGES (S2MPS11_LDO_VSEL_MASK + 1) |
179 | #define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1) | 180 | #define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1) |
181 | #define S2MPS11_BUCK9_N_VOLTAGES (S2MPS11_BUCK9_VSEL_MASK + 1) | ||
180 | #define S2MPS11_RAMP_DELAY 25000 /* uV/us */ | 182 | #define S2MPS11_RAMP_DELAY 25000 /* uV/us */ |
181 | 183 | ||
182 | #define S2MPS11_CTRL1_PWRHOLD_MASK BIT(4) | 184 | #define S2MPS11_CTRL1_PWRHOLD_MASK BIT(4) |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 864d7221de84..8f468e0d2534 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -500,11 +500,20 @@ static inline int page_mapcount(struct page *page) | |||
500 | 500 | ||
501 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 501 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
502 | int total_mapcount(struct page *page); | 502 | int total_mapcount(struct page *page); |
503 | int page_trans_huge_mapcount(struct page *page, int *total_mapcount); | ||
503 | #else | 504 | #else |
504 | static inline int total_mapcount(struct page *page) | 505 | static inline int total_mapcount(struct page *page) |
505 | { | 506 | { |
506 | return page_mapcount(page); | 507 | return page_mapcount(page); |
507 | } | 508 | } |
509 | static inline int page_trans_huge_mapcount(struct page *page, | ||
510 | int *total_mapcount) | ||
511 | { | ||
512 | int mapcount = page_mapcount(page); | ||
513 | if (total_mapcount) | ||
514 | *total_mapcount = mapcount; | ||
515 | return mapcount; | ||
516 | } | ||
508 | #endif | 517 | #endif |
509 | 518 | ||
510 | static inline struct page *virt_to_head_page(const void *x) | 519 | static inline struct page *virt_to_head_page(const void *x) |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 0a4cd4703f40..ad220359f1b0 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -418,7 +418,7 @@ extern sector_t swapdev_block(int, pgoff_t); | |||
418 | extern int page_swapcount(struct page *); | 418 | extern int page_swapcount(struct page *); |
419 | extern int swp_swapcount(swp_entry_t entry); | 419 | extern int swp_swapcount(swp_entry_t entry); |
420 | extern struct swap_info_struct *page_swap_info(struct page *); | 420 | extern struct swap_info_struct *page_swap_info(struct page *); |
421 | extern int reuse_swap_page(struct page *); | 421 | extern bool reuse_swap_page(struct page *, int *); |
422 | extern int try_to_free_swap(struct page *); | 422 | extern int try_to_free_swap(struct page *); |
423 | struct backing_dev_info; | 423 | struct backing_dev_info; |
424 | 424 | ||
@@ -513,8 +513,8 @@ static inline int swp_swapcount(swp_entry_t entry) | |||
513 | return 0; | 513 | return 0; |
514 | } | 514 | } |
515 | 515 | ||
516 | #define reuse_swap_page(page) \ | 516 | #define reuse_swap_page(page, total_mapcount) \ |
517 | (!PageTransCompound(page) && page_mapcount(page) == 1) | 517 | (page_trans_huge_mapcount(page, total_mapcount) == 1) |
518 | 518 | ||
519 | static inline int try_to_free_swap(struct page *page) | 519 | static inline int try_to_free_swap(struct page *page) |
520 | { | 520 | { |