| Paul Mundt | 51a5006 | 2010-03-08 21:45:19 +0900 | [diff] [blame] | 1 | /* | 
| Jean-Christop PLAGNIOL-VILLARD | 6d803ba | 2010-11-17 10:04:33 +0100 | [diff] [blame] | 2 |  *  Copyright (C) 2010 Paul Mundt <lethal@linux-sh.org> | 
| Paul Mundt | 51a5006 | 2010-03-08 21:45:19 +0900 | [diff] [blame] | 3 |  * | 
 | 4 |  * This program is free software; you can redistribute it and/or modify | 
 | 5 |  * it under the terms of the GNU General Public License version 2 as | 
 | 6 |  * published by the Free Software Foundation. | 
 | 7 |  * | 
 | 8 |  * Helper for the clk API to assist looking up a struct clk. | 
 | 9 |  */ | 
| Paul Mundt | 51a5006 | 2010-03-08 21:45:19 +0900 | [diff] [blame] | 10 |  | 
| Jean-Christop PLAGNIOL-VILLARD | 6d803ba | 2010-11-17 10:04:33 +0100 | [diff] [blame] | 11 | #ifndef __CLKDEV__H_ | 
 | 12 | #define __CLKDEV__H_ | 
| Paul Mundt | 51a5006 | 2010-03-08 21:45:19 +0900 | [diff] [blame] | 13 |  | 
| Jean-Christop PLAGNIOL-VILLARD | 6d803ba | 2010-11-17 10:04:33 +0100 | [diff] [blame] | 14 | #include <linux/bootmem.h> | 
 | 15 | #include <linux/mm.h> | 
 | 16 | #include <linux/slab.h> | 
| Paul Mundt | 51a5006 | 2010-03-08 21:45:19 +0900 | [diff] [blame] | 17 |  | 
| Jean-Christop PLAGNIOL-VILLARD | 6d803ba | 2010-11-17 10:04:33 +0100 | [diff] [blame] | 18 | #include <asm/clock.h> | 
| Paul Mundt | 51a5006 | 2010-03-08 21:45:19 +0900 | [diff] [blame] | 19 |  | 
| Jean-Christop PLAGNIOL-VILLARD | 6d803ba | 2010-11-17 10:04:33 +0100 | [diff] [blame] | 20 | static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size) | 
 | 21 | { | 
 | 22 | 	if (!slab_is_available()) | 
 | 23 | 		return alloc_bootmem_low_pages(size); | 
 | 24 | 	else | 
 | 25 | 		return kzalloc(size, GFP_KERNEL); | 
 | 26 | } | 
| Paul Mundt | 51a5006 | 2010-03-08 21:45:19 +0900 | [diff] [blame] | 27 |  | 
| Jean-Christop PLAGNIOL-VILLARD | 6d803ba | 2010-11-17 10:04:33 +0100 | [diff] [blame] | 28 | #define __clk_put(clk) | 
 | 29 | #define __clk_get(clk) ({ 1; }) | 
| Paul Mundt | 51a5006 | 2010-03-08 21:45:19 +0900 | [diff] [blame] | 30 |  | 
| Jean-Christop PLAGNIOL-VILLARD | 6d803ba | 2010-11-17 10:04:33 +0100 | [diff] [blame] | 31 | #endif /* __CLKDEV_H__ */ |