aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-11-25 02:45:43 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-11-25 02:45:43 -0500
commit1ad2096c4eba144522d87541c4024b8c84e95051 (patch)
treea149d469a4da72a7b6e6b777879b740046c4ebc9 /include
parentc4d73e7d75a54451d6e073c118ba2b8d87bd350d (diff)
parentdf73af86b6e737f357aae85e0b5e621516117780 (diff)
Merge branch 'rmobile/mmcif' into rmobile-latest
Diffstat (limited to 'include')
-rw-r--r--include/linux/fb.h1
-rw-r--r--include/linux/fs.h6
-rw-r--r--include/linux/mmc/sh_mmcif.h54
-rw-r--r--include/linux/module.h2
-rw-r--r--include/linux/page_cgroup.h7
-rw-r--r--include/linux/sh_clk.h34
-rw-r--r--include/video/da8xx-fb.h1
7 files changed, 58 insertions, 47 deletions
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 7fca3dc4e475..d1631d37e9e0 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -1122,6 +1122,7 @@ extern const struct fb_videomode *fb_find_best_display(const struct fb_monspecs
1122 1122
1123/* drivers/video/fbcmap.c */ 1123/* drivers/video/fbcmap.c */
1124extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); 1124extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
1125extern int fb_alloc_cmap_gfp(struct fb_cmap *cmap, int len, int transp, gfp_t flags);
1125extern void fb_dealloc_cmap(struct fb_cmap *cmap); 1126extern void fb_dealloc_cmap(struct fb_cmap *cmap);
1126extern int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to); 1127extern int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to);
1127extern int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to); 1128extern int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index eedc00b7b1ee..c9e06cc70dad 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -34,9 +34,9 @@
34#define SEEK_MAX SEEK_END 34#define SEEK_MAX SEEK_END
35 35
36struct fstrim_range { 36struct fstrim_range {
37 uint64_t start; 37 __u64 start;
38 uint64_t len; 38 __u64 len;
39 uint64_t minlen; 39 __u64 minlen;
40}; 40};
41 41
42/* And dynamically-tunable limits and defaults: */ 42/* And dynamically-tunable limits and defaults: */
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index 5c99da1078aa..f216a8879b58 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -14,8 +14,9 @@
14#ifndef __SH_MMCIF_H__ 14#ifndef __SH_MMCIF_H__
15#define __SH_MMCIF_H__ 15#define __SH_MMCIF_H__
16 16
17#include <linux/platform_device.h>
18#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/platform_device.h>
19#include <linux/sh_dma.h>
19 20
20/* 21/*
21 * MMCIF : CE_CLK_CTRL [19:16] 22 * MMCIF : CE_CLK_CTRL [19:16]
@@ -31,13 +32,19 @@
31 * 1111 : Peripheral clock (sup_pclk set '1') 32 * 1111 : Peripheral clock (sup_pclk set '1')
32 */ 33 */
33 34
35struct sh_mmcif_dma {
36 struct sh_dmae_slave chan_priv_tx;
37 struct sh_dmae_slave chan_priv_rx;
38};
39
34struct sh_mmcif_plat_data { 40struct sh_mmcif_plat_data {
35 void (*set_pwr)(struct platform_device *pdev, int state); 41 void (*set_pwr)(struct platform_device *pdev, int state);
36 void (*down_pwr)(struct platform_device *pdev); 42 void (*down_pwr)(struct platform_device *pdev);
37 int (*get_cd)(struct platform_device *pdef); 43 int (*get_cd)(struct platform_device *pdef);
38 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ 44 struct sh_mmcif_dma *dma;
39 unsigned long caps; 45 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */
40 u32 ocr; 46 unsigned long caps;
47 u32 ocr;
41}; 48};
42 49
43#define MMCIF_CE_CMD_SET 0x00000000 50#define MMCIF_CE_CMD_SET 0x00000000
@@ -59,6 +66,29 @@ struct sh_mmcif_plat_data {
59#define MMCIF_CE_HOST_STS2 0x0000004C 66#define MMCIF_CE_HOST_STS2 0x0000004C
60#define MMCIF_CE_VERSION 0x0000007C 67#define MMCIF_CE_VERSION 0x0000007C
61 68
69/* CE_BUF_ACC */
70#define BUF_ACC_DMAWEN (1 << 25)
71#define BUF_ACC_DMAREN (1 << 24)
72#define BUF_ACC_BUSW_32 (0 << 17)
73#define BUF_ACC_BUSW_16 (1 << 17)
74#define BUF_ACC_ATYP (1 << 16)
75
76/* CE_CLK_CTRL */
77#define CLK_ENABLE (1 << 24) /* 1: output mmc clock */
78#define CLK_CLEAR ((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16))
79#define CLK_SUP_PCLK ((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16))
80#define SRSPTO_256 ((1 << 13) | (0 << 12)) /* resp timeout */
81#define SRBSYTO_29 ((1 << 11) | (1 << 10) | \
82 (1 << 9) | (1 << 8)) /* resp busy timeout */
83#define SRWDTO_29 ((1 << 7) | (1 << 6) | \
84 (1 << 5) | (1 << 4)) /* read/write timeout */
85#define SCCSTO_29 ((1 << 3) | (1 << 2) | \
86 (1 << 1) | (1 << 0)) /* ccs timeout */
87
88/* CE_VERSION */
89#define SOFT_RST_ON (1 << 31)
90#define SOFT_RST_OFF ~SOFT_RST_ON
91
62static inline u32 sh_mmcif_readl(void __iomem *addr, int reg) 92static inline u32 sh_mmcif_readl(void __iomem *addr, int reg)
63{ 93{
64 return readl(addr + reg); 94 return readl(addr + reg);
@@ -149,17 +179,23 @@ static inline void sh_mmcif_boot_init(void __iomem *base)
149 179
150 /* reset */ 180 /* reset */
151 tmp = sh_mmcif_readl(base, MMCIF_CE_VERSION); 181 tmp = sh_mmcif_readl(base, MMCIF_CE_VERSION);
152 sh_mmcif_writel(base, MMCIF_CE_VERSION, tmp | 0x80000000); 182 sh_mmcif_writel(base, MMCIF_CE_VERSION, tmp | SOFT_RST_ON);
153 sh_mmcif_writel(base, MMCIF_CE_VERSION, tmp & ~0x80000000); 183 sh_mmcif_writel(base, MMCIF_CE_VERSION, tmp & SOFT_RST_OFF);
154 184
155 /* byte swap */ 185 /* byte swap */
156 sh_mmcif_writel(base, MMCIF_CE_BUF_ACC, 0x00010000); 186 sh_mmcif_writel(base, MMCIF_CE_BUF_ACC, BUF_ACC_ATYP);
157 187
158 /* Set block size in MMCIF hardware */ 188 /* Set block size in MMCIF hardware */
159 sh_mmcif_writel(base, MMCIF_CE_BLOCK_SET, SH_MMCIF_BBS); 189 sh_mmcif_writel(base, MMCIF_CE_BLOCK_SET, SH_MMCIF_BBS);
160 190
161 /* Enable the clock, set it to Bus clock/256 (about 325Khz)*/ 191 /* Enable the clock, set it to Bus clock/256 (about 325Khz).
162 sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, 0x01072fff); 192 * It is unclear where 0x70000 comes from or if it is even needed.
193 * It is there for byte-compatibility with code that is known to
194 * work.
195 */
196 sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL,
197 CLK_ENABLE | SRSPTO_256 | SRBSYTO_29 | SRWDTO_29 |
198 SCCSTO_29 | 0x70000);
163 199
164 /* CMD0 */ 200 /* CMD0 */
165 sh_mmcif_boot_cmd(base, 0x00000040, 0); 201 sh_mmcif_boot_cmd(base, 0x00000040, 0);
diff --git a/include/linux/module.h b/include/linux/module.h
index b29e7458b966..7575bbbdf2a2 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -517,7 +517,7 @@ static inline void __module_get(struct module *module)
517#define symbol_put_addr(p) do { } while(0) 517#define symbol_put_addr(p) do { } while(0)
518 518
519#endif /* CONFIG_MODULE_UNLOAD */ 519#endif /* CONFIG_MODULE_UNLOAD */
520int use_module(struct module *a, struct module *b); 520int ref_module(struct module *a, struct module *b);
521 521
522/* This is a #define so the string doesn't get put in every .o file */ 522/* This is a #define so the string doesn't get put in every .o file */
523#define module_name(mod) \ 523#define module_name(mod) \
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index 5bb13b3db84d..b02195dfc1b0 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -59,8 +59,6 @@ static inline void ClearPageCgroup##uname(struct page_cgroup *pc) \
59static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \ 59static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \
60 { return test_and_clear_bit(PCG_##lname, &pc->flags); } 60 { return test_and_clear_bit(PCG_##lname, &pc->flags); }
61 61
62TESTPCGFLAG(Locked, LOCK)
63
64/* Cache flag is set only once (at allocation) */ 62/* Cache flag is set only once (at allocation) */
65TESTPCGFLAG(Cache, CACHE) 63TESTPCGFLAG(Cache, CACHE)
66CLEARPCGFLAG(Cache, CACHE) 64CLEARPCGFLAG(Cache, CACHE)
@@ -104,6 +102,11 @@ static inline void unlock_page_cgroup(struct page_cgroup *pc)
104 bit_spin_unlock(PCG_LOCK, &pc->flags); 102 bit_spin_unlock(PCG_LOCK, &pc->flags);
105} 103}
106 104
105static inline int page_is_cgroup_locked(struct page_cgroup *pc)
106{
107 return bit_spin_is_locked(PCG_LOCK, &pc->flags);
108}
109
107#else /* CONFIG_CGROUP_MEM_RES_CTLR */ 110#else /* CONFIG_CGROUP_MEM_RES_CTLR */
108struct page_cgroup; 111struct page_cgroup;
109 112
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
index cea0c38e7a63..9a52f72527dc 100644
--- a/include/linux/sh_clk.h
+++ b/include/linux/sh_clk.h
@@ -19,11 +19,13 @@ struct clk_mapping {
19}; 19};
20 20
21struct clk_ops { 21struct clk_ops {
22#ifdef CONFIG_SH_CLK_CPG_LEGACY
22 void (*init)(struct clk *clk); 23 void (*init)(struct clk *clk);
24#endif
23 int (*enable)(struct clk *clk); 25 int (*enable)(struct clk *clk);
24 void (*disable)(struct clk *clk); 26 void (*disable)(struct clk *clk);
25 unsigned long (*recalc)(struct clk *clk); 27 unsigned long (*recalc)(struct clk *clk);
26 int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id); 28 int (*set_rate)(struct clk *clk, unsigned long rate);
27 int (*set_parent)(struct clk *clk, struct clk *parent); 29 int (*set_parent)(struct clk *clk, struct clk *parent);
28 long (*round_rate)(struct clk *clk, unsigned long rate); 30 long (*round_rate)(struct clk *clk, unsigned long rate);
29}; 31};
@@ -67,36 +69,6 @@ int clk_register(struct clk *);
67void clk_unregister(struct clk *); 69void clk_unregister(struct clk *);
68void clk_enable_init_clocks(void); 70void clk_enable_init_clocks(void);
69 71
70/**
71 * clk_set_rate_ex - set the clock rate for a clock source, with additional parameter
72 * @clk: clock source
73 * @rate: desired clock rate in Hz
74 * @algo_id: algorithm id to be passed down to ops->set_rate
75 *
76 * Returns success (0) or negative errno.
77 */
78int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id);
79
80enum clk_sh_algo_id {
81 NO_CHANGE = 0,
82
83 IUS_N1_N1,
84 IUS_322,
85 IUS_522,
86 IUS_N11,
87
88 SB_N1,
89
90 SB3_N1,
91 SB3_32,
92 SB3_43,
93 SB3_54,
94
95 BP_N1,
96
97 IP_N1,
98};
99
100struct clk_div_mult_table { 72struct clk_div_mult_table {
101 unsigned int *divisors; 73 unsigned int *divisors;
102 unsigned int nr_divisors; 74 unsigned int nr_divisors;
diff --git a/include/video/da8xx-fb.h b/include/video/da8xx-fb.h
index 6316cdabf73f..89d43b3d4cb9 100644
--- a/include/video/da8xx-fb.h
+++ b/include/video/da8xx-fb.h
@@ -99,7 +99,6 @@ struct lcd_sync_arg {
99#define FBIPUT_COLOR _IOW('F', 6, int) 99#define FBIPUT_COLOR _IOW('F', 6, int)
100#define FBIPUT_HSYNC _IOW('F', 9, int) 100#define FBIPUT_HSYNC _IOW('F', 9, int)
101#define FBIPUT_VSYNC _IOW('F', 10, int) 101#define FBIPUT_VSYNC _IOW('F', 10, int)
102#define FBIO_WAITFORVSYNC _IOW('F', 0x20, u_int32_t)
103 102
104#endif /* ifndef DA8XX_FB_H */ 103#endif /* ifndef DA8XX_FB_H */
105 104