diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/console.h | 13 | ||||
| -rw-r--r-- | include/linux/fb.h | 13 | ||||
| -rw-r--r-- | include/linux/fsl-diu-fb.h | 223 | ||||
| -rw-r--r-- | include/linux/io-mapping.h | 16 | ||||
| -rw-r--r-- | include/linux/kdb.h | 4 | ||||
| -rw-r--r-- | include/linux/kgdb.h | 15 | ||||
| -rw-r--r-- | include/linux/of.h | 10 | ||||
| -rw-r--r-- | include/linux/of_address.h | 44 | ||||
| -rw-r--r-- | include/linux/of_device.h | 61 | ||||
| -rw-r--r-- | include/linux/of_gpio.h | 35 | ||||
| -rw-r--r-- | include/linux/of_i2c.h | 13 | ||||
| -rw-r--r-- | include/linux/of_irq.h | 70 | ||||
| -rw-r--r-- | include/linux/of_platform.h | 53 | ||||
| -rw-r--r-- | include/linux/of_spi.h | 11 | ||||
| -rw-r--r-- | include/linux/pci_ids.h | 4 | ||||
| -rw-r--r-- | include/linux/power/jz4740-battery.h | 24 | ||||
| -rw-r--r-- | include/linux/serial_core.h | 3 | ||||
| -rw-r--r-- | include/linux/sh_clk.h | 23 | ||||
| -rw-r--r-- | include/linux/wm97xx_batt.h | 16 |
19 files changed, 561 insertions, 90 deletions
diff --git a/include/linux/console.h b/include/linux/console.h index dcca5339ceb3..f76fc297322d 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
| @@ -55,6 +55,16 @@ struct consw { | |||
| 55 | void (*con_invert_region)(struct vc_data *, u16 *, int); | 55 | void (*con_invert_region)(struct vc_data *, u16 *, int); |
| 56 | u16 *(*con_screen_pos)(struct vc_data *, int); | 56 | u16 *(*con_screen_pos)(struct vc_data *, int); |
| 57 | unsigned long (*con_getxy)(struct vc_data *, unsigned long, int *, int *); | 57 | unsigned long (*con_getxy)(struct vc_data *, unsigned long, int *, int *); |
| 58 | /* | ||
| 59 | * Prepare the console for the debugger. This includes, but is not | ||
| 60 | * limited to, unblanking the console, loading an appropriate | ||
| 61 | * palette, and allowing debugger generated output. | ||
| 62 | */ | ||
| 63 | int (*con_debug_enter)(struct vc_data *); | ||
| 64 | /* | ||
| 65 | * Restore the console to its pre-debug state as closely as possible. | ||
| 66 | */ | ||
| 67 | int (*con_debug_leave)(struct vc_data *); | ||
| 58 | }; | 68 | }; |
| 59 | 69 | ||
| 60 | extern const struct consw *conswitchp; | 70 | extern const struct consw *conswitchp; |
| @@ -69,6 +79,9 @@ int register_con_driver(const struct consw *csw, int first, int last); | |||
| 69 | int unregister_con_driver(const struct consw *csw); | 79 | int unregister_con_driver(const struct consw *csw); |
| 70 | int take_over_console(const struct consw *sw, int first, int last, int deflt); | 80 | int take_over_console(const struct consw *sw, int first, int last, int deflt); |
| 71 | void give_up_console(const struct consw *sw); | 81 | void give_up_console(const struct consw *sw); |
| 82 | int con_debug_enter(struct vc_data *vc); | ||
| 83 | int con_debug_leave(void); | ||
| 84 | |||
| 72 | /* scroll */ | 85 | /* scroll */ |
| 73 | #define SM_UP (1) | 86 | #define SM_UP (1) |
| 74 | #define SM_DOWN (2) | 87 | #define SM_DOWN (2) |
diff --git a/include/linux/fb.h b/include/linux/fb.h index e7445df44d6c..0c5659c41b01 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/i2c.h> | 5 | #include <linux/i2c.h> |
| 6 | #ifdef __KERNEL__ | ||
| 7 | #include <linux/kgdb.h> | ||
| 8 | #endif /* __KERNEL__ */ | ||
| 6 | 9 | ||
| 7 | /* Definitions of frame buffers */ | 10 | /* Definitions of frame buffers */ |
| 8 | 11 | ||
| @@ -607,6 +610,12 @@ struct fb_deferred_io { | |||
| 607 | * LOCKING NOTE: those functions must _ALL_ be called with the console | 610 | * LOCKING NOTE: those functions must _ALL_ be called with the console |
| 608 | * semaphore held, this is the only suitable locking mechanism we have | 611 | * semaphore held, this is the only suitable locking mechanism we have |
| 609 | * in 2.6. Some may be called at interrupt time at this point though. | 612 | * in 2.6. Some may be called at interrupt time at this point though. |
| 613 | * | ||
| 614 | * The exception to this is the debug related hooks. Putting the fb | ||
| 615 | * into a debug state (e.g. flipping to the kernel console) and restoring | ||
| 616 | * it must be done in a lock-free manner, so low level drivers should | ||
| 617 | * keep track of the initial console (if applicable) and may need to | ||
| 618 | * perform direct, unlocked hardware writes in these hooks. | ||
| 610 | */ | 619 | */ |
| 611 | 620 | ||
| 612 | struct fb_ops { | 621 | struct fb_ops { |
| @@ -676,6 +685,10 @@ struct fb_ops { | |||
| 676 | 685 | ||
| 677 | /* teardown any resources to do with this framebuffer */ | 686 | /* teardown any resources to do with this framebuffer */ |
| 678 | void (*fb_destroy)(struct fb_info *info); | 687 | void (*fb_destroy)(struct fb_info *info); |
| 688 | |||
| 689 | /* called at KDB enter and leave time to prepare the console */ | ||
| 690 | int (*fb_debug_enter)(struct fb_info *info); | ||
| 691 | int (*fb_debug_leave)(struct fb_info *info); | ||
| 679 | }; | 692 | }; |
| 680 | 693 | ||
| 681 | #ifdef CONFIG_FB_TILEBLITTING | 694 | #ifdef CONFIG_FB_TILEBLITTING |
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h new file mode 100644 index 000000000000..fc295d7ea463 --- /dev/null +++ b/include/linux/fsl-diu-fb.h | |||
| @@ -0,0 +1,223 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * Freescale DIU Frame Buffer device driver | ||
| 5 | * | ||
| 6 | * Authors: Hongjun Chen <hong-jun.chen@freescale.com> | ||
| 7 | * Paul Widmer <paul.widmer@freescale.com> | ||
| 8 | * Srikanth Srinivasan <srikanth.srinivasan@freescale.com> | ||
| 9 | * York Sun <yorksun@freescale.com> | ||
| 10 | * | ||
| 11 | * Based on imxfb.c Copyright (C) 2004 S.Hauer, Pengutronix | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify it | ||
| 14 | * under the terms of the GNU General Public License as published by the | ||
| 15 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 16 | * option) any later version. | ||
| 17 | * | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __FSL_DIU_FB_H__ | ||
| 21 | #define __FSL_DIU_FB_H__ | ||
| 22 | |||
| 23 | /* Arbitrary threshold to determine the allocation method | ||
| 24 | * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory() | ||
| 25 | */ | ||
| 26 | #define MEM_ALLOC_THRESHOLD (1024*768*4+32) | ||
| 27 | /* Minimum value that the pixel clock can be set to in pico seconds | ||
| 28 | * This is determined by platform clock/3 where the minimum platform | ||
| 29 | * clock is 533MHz. This gives 5629 pico seconds. | ||
| 30 | */ | ||
| 31 | #define MIN_PIX_CLK 5629 | ||
| 32 | #define MAX_PIX_CLK 96096 | ||
| 33 | |||
| 34 | #include <linux/types.h> | ||
| 35 | |||
| 36 | struct mfb_alpha { | ||
| 37 | int enable; | ||
| 38 | int alpha; | ||
| 39 | }; | ||
| 40 | |||
| 41 | struct mfb_chroma_key { | ||
| 42 | int enable; | ||
| 43 | __u8 red_max; | ||
| 44 | __u8 green_max; | ||
| 45 | __u8 blue_max; | ||
| 46 | __u8 red_min; | ||
| 47 | __u8 green_min; | ||
| 48 | __u8 blue_min; | ||
| 49 | }; | ||
| 50 | |||
| 51 | struct aoi_display_offset { | ||
| 52 | int x_aoi_d; | ||
| 53 | int y_aoi_d; | ||
| 54 | }; | ||
| 55 | |||
| 56 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) | ||
| 57 | #define MFB_WAIT_FOR_VSYNC _IOW('F', 0x20, u_int32_t) | ||
| 58 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) | ||
| 59 | |||
| 60 | #define MFB_SET_ALPHA 0x80014d00 | ||
| 61 | #define MFB_GET_ALPHA 0x40014d00 | ||
| 62 | #define MFB_SET_AOID 0x80084d04 | ||
| 63 | #define MFB_GET_AOID 0x40084d04 | ||
| 64 | #define MFB_SET_PIXFMT 0x80014d08 | ||
| 65 | #define MFB_GET_PIXFMT 0x40014d08 | ||
| 66 | |||
| 67 | #define FBIOGET_GWINFO 0x46E0 | ||
| 68 | #define FBIOPUT_GWINFO 0x46E1 | ||
| 69 | |||
| 70 | #ifdef __KERNEL__ | ||
| 71 | #include <linux/spinlock.h> | ||
| 72 | |||
| 73 | /* | ||
| 74 | * These are the fields of area descriptor(in DDR memory) for every plane | ||
| 75 | */ | ||
| 76 | struct diu_ad { | ||
| 77 | /* Word 0(32-bit) in DDR memory */ | ||
| 78 | /* __u16 comp; */ | ||
| 79 | /* __u16 pixel_s:2; */ | ||
| 80 | /* __u16 pallete:1; */ | ||
| 81 | /* __u16 red_c:2; */ | ||
| 82 | /* __u16 green_c:2; */ | ||
| 83 | /* __u16 blue_c:2; */ | ||
| 84 | /* __u16 alpha_c:3; */ | ||
| 85 | /* __u16 byte_f:1; */ | ||
| 86 | /* __u16 res0:3; */ | ||
| 87 | |||
| 88 | __be32 pix_fmt; /* hard coding pixel format */ | ||
| 89 | |||
| 90 | /* Word 1(32-bit) in DDR memory */ | ||
| 91 | __le32 addr; | ||
| 92 | |||
| 93 | /* Word 2(32-bit) in DDR memory */ | ||
| 94 | /* __u32 delta_xs:11; */ | ||
| 95 | /* __u32 res1:1; */ | ||
| 96 | /* __u32 delta_ys:11; */ | ||
| 97 | /* __u32 res2:1; */ | ||
| 98 | /* __u32 g_alpha:8; */ | ||
| 99 | __le32 src_size_g_alpha; | ||
| 100 | |||
| 101 | /* Word 3(32-bit) in DDR memory */ | ||
| 102 | /* __u32 delta_xi:11; */ | ||
| 103 | /* __u32 res3:5; */ | ||
| 104 | /* __u32 delta_yi:11; */ | ||
| 105 | /* __u32 res4:3; */ | ||
| 106 | /* __u32 flip:2; */ | ||
| 107 | __le32 aoi_size; | ||
| 108 | |||
| 109 | /* Word 4(32-bit) in DDR memory */ | ||
| 110 | /*__u32 offset_xi:11; | ||
| 111 | __u32 res5:5; | ||
| 112 | __u32 offset_yi:11; | ||
| 113 | __u32 res6:5; | ||
| 114 | */ | ||
| 115 | __le32 offset_xyi; | ||
| 116 | |||
| 117 | /* Word 5(32-bit) in DDR memory */ | ||
| 118 | /*__u32 offset_xd:11; | ||
| 119 | __u32 res7:5; | ||
| 120 | __u32 offset_yd:11; | ||
| 121 | __u32 res8:5; */ | ||
| 122 | __le32 offset_xyd; | ||
| 123 | |||
| 124 | |||
| 125 | /* Word 6(32-bit) in DDR memory */ | ||
| 126 | __u8 ckmax_r; | ||
| 127 | __u8 ckmax_g; | ||
| 128 | __u8 ckmax_b; | ||
| 129 | __u8 res9; | ||
| 130 | |||
| 131 | /* Word 7(32-bit) in DDR memory */ | ||
| 132 | __u8 ckmin_r; | ||
| 133 | __u8 ckmin_g; | ||
| 134 | __u8 ckmin_b; | ||
| 135 | __u8 res10; | ||
| 136 | /* __u32 res10:8; */ | ||
| 137 | |||
| 138 | /* Word 8(32-bit) in DDR memory */ | ||
| 139 | __le32 next_ad; | ||
| 140 | |||
| 141 | /* Word 9(32-bit) in DDR memory, just for 64-bit aligned */ | ||
| 142 | __u32 paddr; | ||
| 143 | } __attribute__ ((packed)); | ||
| 144 | |||
| 145 | /* DIU register map */ | ||
| 146 | struct diu { | ||
| 147 | __be32 desc[3]; | ||
| 148 | __be32 gamma; | ||
| 149 | __be32 pallete; | ||
| 150 | __be32 cursor; | ||
| 151 | __be32 curs_pos; | ||
| 152 | __be32 diu_mode; | ||
| 153 | __be32 bgnd; | ||
| 154 | __be32 bgnd_wb; | ||
| 155 | __be32 disp_size; | ||
| 156 | __be32 wb_size; | ||
| 157 | __be32 wb_mem_addr; | ||
| 158 | __be32 hsyn_para; | ||
| 159 | __be32 vsyn_para; | ||
| 160 | __be32 syn_pol; | ||
| 161 | __be32 thresholds; | ||
| 162 | __be32 int_status; | ||
| 163 | __be32 int_mask; | ||
| 164 | __be32 colorbar[8]; | ||
| 165 | __be32 filling; | ||
| 166 | __be32 plut; | ||
| 167 | } __attribute__ ((packed)); | ||
| 168 | |||
| 169 | struct diu_hw { | ||
| 170 | struct diu *diu_reg; | ||
| 171 | spinlock_t reg_lock; | ||
| 172 | |||
| 173 | __u32 mode; /* DIU operation mode */ | ||
| 174 | }; | ||
| 175 | |||
| 176 | struct diu_addr { | ||
| 177 | __u8 __iomem *vaddr; /* Virtual address */ | ||
| 178 | dma_addr_t paddr; /* Physical address */ | ||
| 179 | __u32 offset; | ||
| 180 | }; | ||
| 181 | |||
| 182 | struct diu_pool { | ||
| 183 | struct diu_addr ad; | ||
| 184 | struct diu_addr gamma; | ||
| 185 | struct diu_addr pallete; | ||
| 186 | struct diu_addr cursor; | ||
| 187 | }; | ||
| 188 | |||
| 189 | #define FSL_DIU_BASE_OFFSET 0x2C000 /* Offset of DIU */ | ||
| 190 | #define INT_LCDC 64 /* DIU interrupt number */ | ||
| 191 | |||
| 192 | #define FSL_AOI_NUM 6 /* 5 AOIs and one dummy AOI */ | ||
| 193 | /* 1 for plane 0, 2 for plane 1&2 each */ | ||
| 194 | |||
| 195 | /* Minimum X and Y resolutions */ | ||
| 196 | #define MIN_XRES 64 | ||
| 197 | #define MIN_YRES 64 | ||
| 198 | |||
| 199 | /* HW cursor parameters */ | ||
| 200 | #define MAX_CURS 32 | ||
| 201 | |||
| 202 | /* Modes of operation of DIU */ | ||
| 203 | #define MFB_MODE0 0 /* DIU off */ | ||
| 204 | #define MFB_MODE1 1 /* All three planes output to display */ | ||
| 205 | #define MFB_MODE2 2 /* Plane 1 to display, planes 2+3 written back*/ | ||
| 206 | #define MFB_MODE3 3 /* All three planes written back to memory */ | ||
| 207 | #define MFB_MODE4 4 /* Color bar generation */ | ||
| 208 | |||
| 209 | /* INT_STATUS/INT_MASK field descriptions */ | ||
| 210 | #define INT_VSYNC 0x01 /* Vsync interrupt */ | ||
| 211 | #define INT_VSYNC_WB 0x02 /* Vsync interrupt for write back operation */ | ||
| 212 | #define INT_UNDRUN 0x04 /* Under run exception interrupt */ | ||
| 213 | #define INT_PARERR 0x08 /* Display parameters error interrupt */ | ||
| 214 | #define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */ | ||
| 215 | |||
| 216 | /* Panels'operation modes */ | ||
| 217 | #define MFB_TYPE_OUTPUT 0 /* Panel output to display */ | ||
| 218 | #define MFB_TYPE_OFF 1 /* Panel off */ | ||
| 219 | #define MFB_TYPE_WB 2 /* Panel written back to memory */ | ||
| 220 | #define MFB_TYPE_TEST 3 /* Panel generate color bar */ | ||
| 221 | |||
| 222 | #endif /* __KERNEL__ */ | ||
| 223 | #endif /* __FSL_DIU_FB_H__ */ | ||
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index 25085ddd955f..e0ea40f6c515 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h | |||
| @@ -79,7 +79,9 @@ io_mapping_free(struct io_mapping *mapping) | |||
| 79 | 79 | ||
| 80 | /* Atomic map/unmap */ | 80 | /* Atomic map/unmap */ |
| 81 | static inline void * | 81 | static inline void * |
| 82 | io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | 82 | io_mapping_map_atomic_wc(struct io_mapping *mapping, |
| 83 | unsigned long offset, | ||
| 84 | int slot) | ||
| 83 | { | 85 | { |
| 84 | resource_size_t phys_addr; | 86 | resource_size_t phys_addr; |
| 85 | unsigned long pfn; | 87 | unsigned long pfn; |
| @@ -87,13 +89,13 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | |||
| 87 | BUG_ON(offset >= mapping->size); | 89 | BUG_ON(offset >= mapping->size); |
| 88 | phys_addr = mapping->base + offset; | 90 | phys_addr = mapping->base + offset; |
| 89 | pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); | 91 | pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); |
| 90 | return iomap_atomic_prot_pfn(pfn, KM_USER0, mapping->prot); | 92 | return iomap_atomic_prot_pfn(pfn, slot, mapping->prot); |
| 91 | } | 93 | } |
| 92 | 94 | ||
| 93 | static inline void | 95 | static inline void |
| 94 | io_mapping_unmap_atomic(void *vaddr) | 96 | io_mapping_unmap_atomic(void *vaddr, int slot) |
| 95 | { | 97 | { |
| 96 | iounmap_atomic(vaddr, KM_USER0); | 98 | iounmap_atomic(vaddr, slot); |
| 97 | } | 99 | } |
| 98 | 100 | ||
| 99 | static inline void * | 101 | static inline void * |
| @@ -133,13 +135,15 @@ io_mapping_free(struct io_mapping *mapping) | |||
| 133 | 135 | ||
| 134 | /* Atomic map/unmap */ | 136 | /* Atomic map/unmap */ |
| 135 | static inline void * | 137 | static inline void * |
| 136 | io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | 138 | io_mapping_map_atomic_wc(struct io_mapping *mapping, |
| 139 | unsigned long offset, | ||
| 140 | int slot) | ||
| 137 | { | 141 | { |
| 138 | return ((char *) mapping) + offset; | 142 | return ((char *) mapping) + offset; |
| 139 | } | 143 | } |
| 140 | 144 | ||
| 141 | static inline void | 145 | static inline void |
| 142 | io_mapping_unmap_atomic(void *vaddr) | 146 | io_mapping_unmap_atomic(void *vaddr, int slot) |
| 143 | { | 147 | { |
| 144 | } | 148 | } |
| 145 | 149 | ||
diff --git a/include/linux/kdb.h b/include/linux/kdb.h index ccb2b3ec0fe8..ea6e5244ed3f 100644 --- a/include/linux/kdb.h +++ b/include/linux/kdb.h | |||
| @@ -114,4 +114,8 @@ enum { | |||
| 114 | KDB_INIT_EARLY, | 114 | KDB_INIT_EARLY, |
| 115 | KDB_INIT_FULL, | 115 | KDB_INIT_FULL, |
| 116 | }; | 116 | }; |
| 117 | |||
| 118 | extern int kdbgetintenv(const char *, int *); | ||
| 119 | extern int kdb_set(int, const char **); | ||
| 120 | |||
| 117 | #endif /* !_KDB_H */ | 121 | #endif /* !_KDB_H */ |
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index 9340f34d1bb5..cc96f0f23e04 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
| @@ -90,6 +90,19 @@ struct kgdb_bkpt { | |||
| 90 | enum kgdb_bpstate state; | 90 | enum kgdb_bpstate state; |
| 91 | }; | 91 | }; |
| 92 | 92 | ||
| 93 | struct dbg_reg_def_t { | ||
| 94 | char *name; | ||
| 95 | int size; | ||
| 96 | int offset; | ||
| 97 | }; | ||
| 98 | |||
| 99 | #ifndef DBG_MAX_REG_NUM | ||
| 100 | #define DBG_MAX_REG_NUM 0 | ||
| 101 | #else | ||
| 102 | extern struct dbg_reg_def_t dbg_reg_def[]; | ||
| 103 | extern char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs); | ||
| 104 | extern int dbg_set_reg(int regno, void *mem, struct pt_regs *regs); | ||
| 105 | #endif | ||
| 93 | #ifndef KGDB_MAX_BREAKPOINTS | 106 | #ifndef KGDB_MAX_BREAKPOINTS |
| 94 | # define KGDB_MAX_BREAKPOINTS 1000 | 107 | # define KGDB_MAX_BREAKPOINTS 1000 |
| 95 | #endif | 108 | #endif |
| @@ -281,7 +294,7 @@ extern void kgdb_unregister_io_module(struct kgdb_io *local_kgdb_io_ops); | |||
| 281 | extern struct kgdb_io *dbg_io_ops; | 294 | extern struct kgdb_io *dbg_io_ops; |
| 282 | 295 | ||
| 283 | extern int kgdb_hex2long(char **ptr, unsigned long *long_val); | 296 | extern int kgdb_hex2long(char **ptr, unsigned long *long_val); |
| 284 | extern int kgdb_mem2hex(char *mem, char *buf, int count); | 297 | extern char *kgdb_mem2hex(char *mem, char *buf, int count); |
| 285 | extern int kgdb_hex2mem(char *buf, char *mem, int count); | 298 | extern int kgdb_hex2mem(char *buf, char *mem, int count); |
| 286 | 299 | ||
| 287 | extern int kgdb_isremovedbreak(unsigned long addr); | 300 | extern int kgdb_isremovedbreak(unsigned long addr); |
diff --git a/include/linux/of.h b/include/linux/of.h index a367e19bb3af..cad7cf0ab278 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -70,6 +70,11 @@ extern struct device_node *allnodes; | |||
| 70 | extern struct device_node *of_chosen; | 70 | extern struct device_node *of_chosen; |
| 71 | extern rwlock_t devtree_lock; | 71 | extern rwlock_t devtree_lock; |
| 72 | 72 | ||
| 73 | static inline bool of_node_is_root(const struct device_node *node) | ||
| 74 | { | ||
| 75 | return node && (node->parent == NULL); | ||
| 76 | } | ||
| 77 | |||
| 73 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) | 78 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) |
| 74 | { | 79 | { |
| 75 | return test_bit(flag, &n->_flags); | 80 | return test_bit(flag, &n->_flags); |
| @@ -141,6 +146,11 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size) | |||
| 141 | 146 | ||
| 142 | #define OF_BAD_ADDR ((u64)-1) | 147 | #define OF_BAD_ADDR ((u64)-1) |
| 143 | 148 | ||
| 149 | #ifndef of_node_to_nid | ||
| 150 | static inline int of_node_to_nid(struct device_node *np) { return -1; } | ||
| 151 | #define of_node_to_nid of_node_to_nid | ||
| 152 | #endif | ||
| 153 | |||
| 144 | extern struct device_node *of_find_node_by_name(struct device_node *from, | 154 | extern struct device_node *of_find_node_by_name(struct device_node *from, |
| 145 | const char *name); | 155 | const char *name); |
| 146 | #define for_each_node_by_name(dn, name) \ | 156 | #define for_each_node_by_name(dn, name) \ |
diff --git a/include/linux/of_address.h b/include/linux/of_address.h new file mode 100644 index 000000000000..8aea06f0564c --- /dev/null +++ b/include/linux/of_address.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #ifndef __OF_ADDRESS_H | ||
| 2 | #define __OF_ADDRESS_H | ||
| 3 | #include <linux/ioport.h> | ||
| 4 | #include <linux/of.h> | ||
| 5 | |||
| 6 | extern u64 of_translate_address(struct device_node *np, const u32 *addr); | ||
| 7 | extern int of_address_to_resource(struct device_node *dev, int index, | ||
| 8 | struct resource *r); | ||
| 9 | extern void __iomem *of_iomap(struct device_node *device, int index); | ||
| 10 | |||
| 11 | /* Extract an address from a device, returns the region size and | ||
| 12 | * the address space flags too. The PCI version uses a BAR number | ||
| 13 | * instead of an absolute index | ||
| 14 | */ | ||
| 15 | extern const u32 *of_get_address(struct device_node *dev, int index, | ||
| 16 | u64 *size, unsigned int *flags); | ||
| 17 | |||
| 18 | #ifndef pci_address_to_pio | ||
| 19 | static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; } | ||
| 20 | #define pci_address_to_pio pci_address_to_pio | ||
| 21 | #endif | ||
| 22 | |||
| 23 | #ifdef CONFIG_PCI | ||
| 24 | extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no, | ||
| 25 | u64 *size, unsigned int *flags); | ||
| 26 | extern int of_pci_address_to_resource(struct device_node *dev, int bar, | ||
| 27 | struct resource *r); | ||
| 28 | #else /* CONFIG_PCI */ | ||
| 29 | static inline int of_pci_address_to_resource(struct device_node *dev, int bar, | ||
| 30 | struct resource *r) | ||
| 31 | { | ||
| 32 | return -ENOSYS; | ||
| 33 | } | ||
| 34 | |||
| 35 | static inline const u32 *of_get_pci_address(struct device_node *dev, | ||
| 36 | int bar_no, u64 *size, unsigned int *flags) | ||
| 37 | { | ||
| 38 | return NULL; | ||
| 39 | } | ||
| 40 | #endif /* CONFIG_PCI */ | ||
| 41 | |||
| 42 | |||
| 43 | #endif /* __OF_ADDRESS_H */ | ||
| 44 | |||
diff --git a/include/linux/of_device.h b/include/linux/of_device.h index 11651facc5f1..35aa44ad9f2c 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h | |||
| @@ -1,32 +1,77 @@ | |||
| 1 | #ifndef _LINUX_OF_DEVICE_H | 1 | #ifndef _LINUX_OF_DEVICE_H |
| 2 | #define _LINUX_OF_DEVICE_H | 2 | #define _LINUX_OF_DEVICE_H |
| 3 | 3 | ||
| 4 | /* | ||
| 5 | * The of_device *was* a kind of "base class" that was a superset of | ||
| 6 | * struct device for use by devices attached to an OF node and probed | ||
| 7 | * using OF properties. However, the important bit of OF-style | ||
| 8 | * probing, namely the device node pointer, has been moved into the | ||
| 9 | * common struct device when CONFIG_OF is set to make OF-style probing | ||
| 10 | * available to all bus types. So now, just make of_device and | ||
| 11 | * platform_device equivalent so that current of_platform bus users | ||
| 12 | * can be transparently migrated over to using the platform bus. | ||
| 13 | * | ||
| 14 | * This line will go away once all references to of_device are removed | ||
| 15 | * from the kernel. | ||
| 16 | */ | ||
| 17 | #define of_device platform_device | ||
| 18 | #include <linux/platform_device.h> | ||
| 19 | #include <linux/of_platform.h> /* temporary until merge */ | ||
| 20 | |||
| 4 | #ifdef CONFIG_OF_DEVICE | 21 | #ifdef CONFIG_OF_DEVICE |
| 5 | #include <linux/device.h> | 22 | #include <linux/device.h> |
| 6 | #include <linux/of.h> | 23 | #include <linux/of.h> |
| 7 | #include <linux/mod_devicetable.h> | 24 | #include <linux/mod_devicetable.h> |
| 8 | 25 | ||
| 9 | #include <asm/of_device.h> | ||
| 10 | |||
| 11 | #define to_of_device(d) container_of(d, struct of_device, dev) | 26 | #define to_of_device(d) container_of(d, struct of_device, dev) |
| 12 | 27 | ||
| 13 | extern const struct of_device_id *of_match_device( | 28 | extern const struct of_device_id *of_match_device( |
| 14 | const struct of_device_id *matches, const struct device *dev); | 29 | const struct of_device_id *matches, const struct device *dev); |
| 30 | extern void of_device_make_bus_id(struct device *dev); | ||
| 31 | |||
| 32 | /** | ||
| 33 | * of_driver_match_device - Tell if a driver's of_match_table matches a device. | ||
| 34 | * @drv: the device_driver structure to test | ||
| 35 | * @dev: the device structure to match against | ||
| 36 | */ | ||
| 37 | static inline int of_driver_match_device(const struct device *dev, | ||
| 38 | const struct device_driver *drv) | ||
| 39 | { | ||
| 40 | return of_match_device(drv->of_match_table, dev) != NULL; | ||
| 41 | } | ||
| 15 | 42 | ||
| 16 | extern struct of_device *of_dev_get(struct of_device *dev); | 43 | extern struct platform_device *of_dev_get(struct platform_device *dev); |
| 17 | extern void of_dev_put(struct of_device *dev); | 44 | extern void of_dev_put(struct platform_device *dev); |
| 18 | 45 | ||
| 19 | extern int of_device_register(struct of_device *ofdev); | 46 | extern int of_device_register(struct platform_device *ofdev); |
| 20 | extern void of_device_unregister(struct of_device *ofdev); | 47 | extern void of_device_unregister(struct platform_device *ofdev); |
| 21 | extern void of_release_dev(struct device *dev); | 48 | extern void of_release_dev(struct device *dev); |
| 22 | 49 | ||
| 23 | static inline void of_device_free(struct of_device *dev) | 50 | static inline void of_device_free(struct platform_device *dev) |
| 24 | { | 51 | { |
| 25 | of_release_dev(&dev->dev); | 52 | of_release_dev(&dev->dev); |
| 26 | } | 53 | } |
| 27 | 54 | ||
| 28 | extern ssize_t of_device_get_modalias(struct of_device *ofdev, | 55 | extern ssize_t of_device_get_modalias(struct device *dev, |
| 29 | char *str, ssize_t len); | 56 | char *str, ssize_t len); |
| 57 | |||
| 58 | extern int of_device_uevent(struct device *dev, struct kobj_uevent_env *env); | ||
| 59 | |||
| 60 | |||
| 61 | #else /* CONFIG_OF_DEVICE */ | ||
| 62 | |||
| 63 | static inline int of_driver_match_device(struct device *dev, | ||
| 64 | struct device_driver *drv) | ||
| 65 | { | ||
| 66 | return 0; | ||
| 67 | } | ||
| 68 | |||
| 69 | static inline int of_device_uevent(struct device *dev, | ||
| 70 | struct kobj_uevent_env *env) | ||
| 71 | { | ||
| 72 | return -ENODEV; | ||
| 73 | } | ||
| 74 | |||
| 30 | #endif /* CONFIG_OF_DEVICE */ | 75 | #endif /* CONFIG_OF_DEVICE */ |
| 31 | 76 | ||
| 32 | #endif /* _LINUX_OF_DEVICE_H */ | 77 | #endif /* _LINUX_OF_DEVICE_H */ |
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index fc2472c3c254..6598c04dab01 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h | |||
| @@ -33,34 +33,17 @@ enum of_gpio_flags { | |||
| 33 | #ifdef CONFIG_OF_GPIO | 33 | #ifdef CONFIG_OF_GPIO |
| 34 | 34 | ||
| 35 | /* | 35 | /* |
| 36 | * Generic OF GPIO chip | ||
| 37 | */ | ||
| 38 | struct of_gpio_chip { | ||
| 39 | struct gpio_chip gc; | ||
| 40 | int gpio_cells; | ||
| 41 | int (*xlate)(struct of_gpio_chip *of_gc, struct device_node *np, | ||
| 42 | const void *gpio_spec, enum of_gpio_flags *flags); | ||
| 43 | }; | ||
| 44 | |||
| 45 | static inline struct of_gpio_chip *to_of_gpio_chip(struct gpio_chip *gc) | ||
| 46 | { | ||
| 47 | return container_of(gc, struct of_gpio_chip, gc); | ||
| 48 | } | ||
| 49 | |||
| 50 | /* | ||
| 51 | * OF GPIO chip for memory mapped banks | 36 | * OF GPIO chip for memory mapped banks |
| 52 | */ | 37 | */ |
| 53 | struct of_mm_gpio_chip { | 38 | struct of_mm_gpio_chip { |
| 54 | struct of_gpio_chip of_gc; | 39 | struct gpio_chip gc; |
| 55 | void (*save_regs)(struct of_mm_gpio_chip *mm_gc); | 40 | void (*save_regs)(struct of_mm_gpio_chip *mm_gc); |
| 56 | void __iomem *regs; | 41 | void __iomem *regs; |
| 57 | }; | 42 | }; |
| 58 | 43 | ||
| 59 | static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) | 44 | static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) |
| 60 | { | 45 | { |
| 61 | struct of_gpio_chip *of_gc = to_of_gpio_chip(gc); | 46 | return container_of(gc, struct of_mm_gpio_chip, gc); |
| 62 | |||
| 63 | return container_of(of_gc, struct of_mm_gpio_chip, of_gc); | ||
| 64 | } | 47 | } |
| 65 | 48 | ||
| 66 | extern int of_get_gpio_flags(struct device_node *np, int index, | 49 | extern int of_get_gpio_flags(struct device_node *np, int index, |
| @@ -69,11 +52,12 @@ extern unsigned int of_gpio_count(struct device_node *np); | |||
| 69 | 52 | ||
| 70 | extern int of_mm_gpiochip_add(struct device_node *np, | 53 | extern int of_mm_gpiochip_add(struct device_node *np, |
| 71 | struct of_mm_gpio_chip *mm_gc); | 54 | struct of_mm_gpio_chip *mm_gc); |
| 72 | extern int of_gpio_simple_xlate(struct of_gpio_chip *of_gc, | 55 | |
| 73 | struct device_node *np, | 56 | extern void of_gpiochip_add(struct gpio_chip *gc); |
| 74 | const void *gpio_spec, | 57 | extern void of_gpiochip_remove(struct gpio_chip *gc); |
| 75 | enum of_gpio_flags *flags); | 58 | extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np); |
| 76 | #else | 59 | |
| 60 | #else /* CONFIG_OF_GPIO */ | ||
| 77 | 61 | ||
| 78 | /* Drivers may not strictly depend on the GPIO support, so let them link. */ | 62 | /* Drivers may not strictly depend on the GPIO support, so let them link. */ |
| 79 | static inline int of_get_gpio_flags(struct device_node *np, int index, | 63 | static inline int of_get_gpio_flags(struct device_node *np, int index, |
| @@ -87,6 +71,9 @@ static inline unsigned int of_gpio_count(struct device_node *np) | |||
| 87 | return 0; | 71 | return 0; |
| 88 | } | 72 | } |
| 89 | 73 | ||
| 74 | static inline void of_gpiochip_add(struct gpio_chip *gc) { } | ||
| 75 | static inline void of_gpiochip_remove(struct gpio_chip *gc) { } | ||
| 76 | |||
| 90 | #endif /* CONFIG_OF_GPIO */ | 77 | #endif /* CONFIG_OF_GPIO */ |
| 91 | 78 | ||
| 92 | /** | 79 | /** |
diff --git a/include/linux/of_i2c.h b/include/linux/of_i2c.h index 34974b5a76f7..0efe8d465f55 100644 --- a/include/linux/of_i2c.h +++ b/include/linux/of_i2c.h | |||
| @@ -12,12 +12,19 @@ | |||
| 12 | #ifndef __LINUX_OF_I2C_H | 12 | #ifndef __LINUX_OF_I2C_H |
| 13 | #define __LINUX_OF_I2C_H | 13 | #define __LINUX_OF_I2C_H |
| 14 | 14 | ||
| 15 | #if defined(CONFIG_OF_I2C) || defined(CONFIG_OF_I2C_MODULE) | ||
| 15 | #include <linux/i2c.h> | 16 | #include <linux/i2c.h> |
| 16 | 17 | ||
| 17 | void of_register_i2c_devices(struct i2c_adapter *adap, | 18 | extern void of_i2c_register_devices(struct i2c_adapter *adap); |
| 18 | struct device_node *adap_node); | ||
| 19 | 19 | ||
| 20 | /* must call put_device() when done with returned i2c_client device */ | 20 | /* must call put_device() when done with returned i2c_client device */ |
| 21 | struct i2c_client *of_find_i2c_device_by_node(struct device_node *node); | 21 | extern struct i2c_client *of_find_i2c_device_by_node(struct device_node *node); |
| 22 | |||
| 23 | #else | ||
| 24 | static inline void of_i2c_register_devices(struct i2c_adapter *adap) | ||
| 25 | { | ||
| 26 | return; | ||
| 27 | } | ||
| 28 | #endif /* CONFIG_OF_I2C */ | ||
| 22 | 29 | ||
| 23 | #endif /* __LINUX_OF_I2C_H */ | 30 | #endif /* __LINUX_OF_I2C_H */ |
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h new file mode 100644 index 000000000000..5929781c104d --- /dev/null +++ b/include/linux/of_irq.h | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | #ifndef __OF_IRQ_H | ||
| 2 | #define __OF_IRQ_H | ||
| 3 | |||
| 4 | #if defined(CONFIG_OF) | ||
| 5 | struct of_irq; | ||
| 6 | #include <linux/types.h> | ||
| 7 | #include <linux/errno.h> | ||
| 8 | #include <linux/ioport.h> | ||
| 9 | #include <linux/of.h> | ||
| 10 | |||
| 11 | /* | ||
| 12 | * irq_of_parse_and_map() is used ba all OF enabled platforms; but SPARC | ||
| 13 | * implements it differently. However, the prototype is the same for all, | ||
| 14 | * so declare it here regardless of the CONFIG_OF_IRQ setting. | ||
| 15 | */ | ||
| 16 | extern unsigned int irq_of_parse_and_map(struct device_node *node, int index); | ||
| 17 | |||
| 18 | #if defined(CONFIG_OF_IRQ) | ||
| 19 | /** | ||
| 20 | * of_irq - container for device_node/irq_specifier pair for an irq controller | ||
| 21 | * @controller: pointer to interrupt controller device tree node | ||
| 22 | * @size: size of interrupt specifier | ||
| 23 | * @specifier: array of cells @size long specifing the specific interrupt | ||
| 24 | * | ||
| 25 | * This structure is returned when an interrupt is mapped. The controller | ||
| 26 | * field needs to be put() after use | ||
| 27 | */ | ||
| 28 | #define OF_MAX_IRQ_SPEC 4 /* We handle specifiers of at most 4 cells */ | ||
| 29 | struct of_irq { | ||
| 30 | struct device_node *controller; /* Interrupt controller node */ | ||
| 31 | u32 size; /* Specifier size */ | ||
| 32 | u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ | ||
| 33 | }; | ||
| 34 | |||
| 35 | /* | ||
| 36 | * Workarounds only applied to 32bit powermac machines | ||
| 37 | */ | ||
| 38 | #define OF_IMAP_OLDWORLD_MAC 0x00000001 | ||
| 39 | #define OF_IMAP_NO_PHANDLE 0x00000002 | ||
| 40 | |||
| 41 | #if defined(CONFIG_PPC32) && defined(CONFIG_PPC_PMAC) | ||
| 42 | extern unsigned int of_irq_workarounds; | ||
| 43 | extern struct device_node *of_irq_dflt_pic; | ||
| 44 | extern int of_irq_map_oldworld(struct device_node *device, int index, | ||
| 45 | struct of_irq *out_irq); | ||
| 46 | #else /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ | ||
| 47 | #define of_irq_workarounds (0) | ||
| 48 | #define of_irq_dflt_pic (NULL) | ||
| 49 | static inline int of_irq_map_oldworld(struct device_node *device, int index, | ||
| 50 | struct of_irq *out_irq) | ||
| 51 | { | ||
| 52 | return -EINVAL; | ||
| 53 | } | ||
| 54 | #endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ | ||
| 55 | |||
| 56 | |||
| 57 | extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec, | ||
| 58 | u32 ointsize, const u32 *addr, | ||
| 59 | struct of_irq *out_irq); | ||
| 60 | extern int of_irq_map_one(struct device_node *device, int index, | ||
| 61 | struct of_irq *out_irq); | ||
| 62 | extern unsigned int irq_create_of_mapping(struct device_node *controller, | ||
| 63 | const u32 *intspec, | ||
| 64 | unsigned int intsize); | ||
| 65 | extern int of_irq_to_resource(struct device_node *dev, int index, | ||
| 66 | struct resource *r); | ||
| 67 | |||
| 68 | #endif /* CONFIG_OF_IRQ */ | ||
| 69 | #endif /* CONFIG_OF */ | ||
| 70 | #endif /* __OF_IRQ_H */ | ||
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 1643d3761eb4..4e6d989c06df 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h | |||
| @@ -17,29 +17,24 @@ | |||
| 17 | #include <linux/mod_devicetable.h> | 17 | #include <linux/mod_devicetable.h> |
| 18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
| 19 | #include <linux/of_device.h> | 19 | #include <linux/of_device.h> |
| 20 | 20 | #include <linux/platform_device.h> | |
| 21 | /* | ||
| 22 | * The of_platform_bus_type is a bus type used by drivers that do not | ||
| 23 | * attach to a macio or similar bus but still use OF probing | ||
| 24 | * mechanism | ||
| 25 | */ | ||
| 26 | extern struct bus_type of_platform_bus_type; | ||
| 27 | 21 | ||
| 28 | /* | 22 | /* |
| 29 | * An of_platform_driver driver is attached to a basic of_device on | 23 | * An of_platform_driver driver is attached to a basic of_device on |
| 30 | * the "platform bus" (of_platform_bus_type). | 24 | * the "platform bus" (platform_bus_type). |
| 31 | */ | 25 | */ |
| 32 | struct of_platform_driver | 26 | struct of_platform_driver |
| 33 | { | 27 | { |
| 34 | int (*probe)(struct of_device* dev, | 28 | int (*probe)(struct platform_device* dev, |
| 35 | const struct of_device_id *match); | 29 | const struct of_device_id *match); |
| 36 | int (*remove)(struct of_device* dev); | 30 | int (*remove)(struct platform_device* dev); |
| 37 | 31 | ||
| 38 | int (*suspend)(struct of_device* dev, pm_message_t state); | 32 | int (*suspend)(struct platform_device* dev, pm_message_t state); |
| 39 | int (*resume)(struct of_device* dev); | 33 | int (*resume)(struct platform_device* dev); |
| 40 | int (*shutdown)(struct of_device* dev); | 34 | int (*shutdown)(struct platform_device* dev); |
| 41 | 35 | ||
| 42 | struct device_driver driver; | 36 | struct device_driver driver; |
| 37 | struct platform_driver platform_driver; | ||
| 43 | }; | 38 | }; |
| 44 | #define to_of_platform_driver(drv) \ | 39 | #define to_of_platform_driver(drv) \ |
| 45 | container_of(drv,struct of_platform_driver, driver) | 40 | container_of(drv,struct of_platform_driver, driver) |
| @@ -49,20 +44,30 @@ extern int of_register_driver(struct of_platform_driver *drv, | |||
| 49 | extern void of_unregister_driver(struct of_platform_driver *drv); | 44 | extern void of_unregister_driver(struct of_platform_driver *drv); |
| 50 | 45 | ||
| 51 | /* Platform drivers register/unregister */ | 46 | /* Platform drivers register/unregister */ |
| 52 | static inline int of_register_platform_driver(struct of_platform_driver *drv) | 47 | extern int of_register_platform_driver(struct of_platform_driver *drv); |
| 53 | { | 48 | extern void of_unregister_platform_driver(struct of_platform_driver *drv); |
| 54 | return of_register_driver(drv, &of_platform_bus_type); | ||
| 55 | } | ||
| 56 | static inline void of_unregister_platform_driver(struct of_platform_driver *drv) | ||
| 57 | { | ||
| 58 | of_unregister_driver(drv); | ||
| 59 | } | ||
| 60 | 49 | ||
| 61 | #include <asm/of_platform.h> | 50 | extern struct platform_device *of_device_alloc(struct device_node *np, |
| 62 | 51 | const char *bus_id, | |
| 63 | extern struct of_device *of_find_device_by_node(struct device_node *np); | 52 | struct device *parent); |
| 53 | extern struct platform_device *of_find_device_by_node(struct device_node *np); | ||
| 64 | 54 | ||
| 65 | extern int of_bus_type_init(struct bus_type *bus, const char *name); | 55 | extern int of_bus_type_init(struct bus_type *bus, const char *name); |
| 56 | |||
| 57 | #if !defined(CONFIG_SPARC) /* SPARC has its own device registration method */ | ||
| 58 | /* Platform devices and busses creation */ | ||
| 59 | extern struct platform_device *of_platform_device_create(struct device_node *np, | ||
| 60 | const char *bus_id, | ||
| 61 | struct device *parent); | ||
| 62 | |||
| 63 | /* pseudo "matches" value to not do deep probe */ | ||
| 64 | #define OF_NO_DEEP_PROBE ((struct of_device_id *)-1) | ||
| 65 | |||
| 66 | extern int of_platform_bus_probe(struct device_node *root, | ||
| 67 | const struct of_device_id *matches, | ||
| 68 | struct device *parent); | ||
| 69 | #endif /* !CONFIG_SPARC */ | ||
| 70 | |||
| 66 | #endif /* CONFIG_OF_DEVICE */ | 71 | #endif /* CONFIG_OF_DEVICE */ |
| 67 | 72 | ||
| 68 | #endif /* _LINUX_OF_PLATFORM_H */ | 73 | #endif /* _LINUX_OF_PLATFORM_H */ |
diff --git a/include/linux/of_spi.h b/include/linux/of_spi.h index 5f71ee8c0868..9e3e70f78ae6 100644 --- a/include/linux/of_spi.h +++ b/include/linux/of_spi.h | |||
| @@ -9,10 +9,15 @@ | |||
| 9 | #ifndef __LINUX_OF_SPI_H | 9 | #ifndef __LINUX_OF_SPI_H |
| 10 | #define __LINUX_OF_SPI_H | 10 | #define __LINUX_OF_SPI_H |
| 11 | 11 | ||
| 12 | #include <linux/of.h> | ||
| 13 | #include <linux/spi/spi.h> | 12 | #include <linux/spi/spi.h> |
| 14 | 13 | ||
| 15 | extern void of_register_spi_devices(struct spi_master *master, | 14 | #if defined(CONFIG_OF_SPI) || defined(CONFIG_OF_SPI_MODULE) |
| 16 | struct device_node *np); | 15 | extern void of_register_spi_devices(struct spi_master *master); |
| 16 | #else | ||
| 17 | static inline void of_register_spi_devices(struct spi_master *master) | ||
| 18 | { | ||
| 19 | return; | ||
| 20 | } | ||
| 21 | #endif /* CONFIG_OF_SPI */ | ||
| 17 | 22 | ||
| 18 | #endif /* __LINUX_OF_SPI */ | 23 | #endif /* __LINUX_OF_SPI */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index e69612cace61..40c804d484ca 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2264,6 +2264,7 @@ | |||
| 2264 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 | 2264 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 |
| 2265 | 2265 | ||
| 2266 | #define PCI_VENDOR_ID_FREESCALE 0x1957 | 2266 | #define PCI_VENDOR_ID_FREESCALE 0x1957 |
| 2267 | #define PCI_DEVICE_ID_MPC8308 0xc006 | ||
| 2267 | #define PCI_DEVICE_ID_MPC8315E 0x00b4 | 2268 | #define PCI_DEVICE_ID_MPC8315E 0x00b4 |
| 2268 | #define PCI_DEVICE_ID_MPC8315 0x00b5 | 2269 | #define PCI_DEVICE_ID_MPC8315 0x00b5 |
| 2269 | #define PCI_DEVICE_ID_MPC8314E 0x00b6 | 2270 | #define PCI_DEVICE_ID_MPC8314E 0x00b6 |
| @@ -2772,3 +2773,6 @@ | |||
| 2772 | #define PCI_DEVICE_ID_RME_DIGI32 0x9896 | 2773 | #define PCI_DEVICE_ID_RME_DIGI32 0x9896 |
| 2773 | #define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 | 2774 | #define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 |
| 2774 | #define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 | 2775 | #define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 |
| 2776 | |||
| 2777 | #define PCI_VENDOR_ID_XEN 0x5853 | ||
| 2778 | #define PCI_DEVICE_ID_XEN_PLATFORM 0x0001 | ||
diff --git a/include/linux/power/jz4740-battery.h b/include/linux/power/jz4740-battery.h new file mode 100644 index 000000000000..19c9610c720a --- /dev/null +++ b/include/linux/power/jz4740-battery.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2009, Jiejing Zhang <kzjeef@gmail.com> | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify it | ||
| 5 | * under the terms of the GNU General Public License as published by the | ||
| 6 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 7 | * option) any later version. | ||
| 8 | * | ||
| 9 | * You should have received a copy of the GNU General Public License along | ||
| 10 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 11 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __JZ4740_BATTERY_H | ||
| 16 | #define __JZ4740_BATTERY_H | ||
| 17 | |||
| 18 | struct jz_battery_platform_data { | ||
| 19 | struct power_supply_info info; | ||
| 20 | int gpio_charge; /* GPIO port of Charger state */ | ||
| 21 | int gpio_charge_active_low; | ||
| 22 | }; | ||
| 23 | |||
| 24 | #endif | ||
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index f10db6e5f3b5..522832023a69 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
| @@ -186,6 +186,9 @@ | |||
| 186 | #define PORT_ALTERA_JTAGUART 91 | 186 | #define PORT_ALTERA_JTAGUART 91 |
| 187 | #define PORT_ALTERA_UART 92 | 187 | #define PORT_ALTERA_UART 92 |
| 188 | 188 | ||
| 189 | /* SH-SCI */ | ||
| 190 | #define PORT_SCIFB 93 | ||
| 191 | |||
| 189 | #ifdef __KERNEL__ | 192 | #ifdef __KERNEL__ |
| 190 | 193 | ||
| 191 | #include <linux/compiler.h> | 194 | #include <linux/compiler.h> |
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h index 1636d1e2a5f1..875ce50719a9 100644 --- a/include/linux/sh_clk.h +++ b/include/linux/sh_clk.h | |||
| @@ -25,6 +25,10 @@ struct clk { | |||
| 25 | int id; | 25 | int id; |
| 26 | 26 | ||
| 27 | struct clk *parent; | 27 | struct clk *parent; |
| 28 | struct clk **parent_table; /* list of parents to */ | ||
| 29 | unsigned short parent_num; /* choose between */ | ||
| 30 | unsigned char src_shift; /* source clock field in the */ | ||
| 31 | unsigned char src_width; /* configuration register */ | ||
| 28 | struct clk_ops *ops; | 32 | struct clk_ops *ops; |
| 29 | 33 | ||
| 30 | struct list_head children; | 34 | struct list_head children; |
| @@ -138,13 +142,22 @@ int sh_clk_div4_enable_register(struct clk *clks, int nr, | |||
| 138 | int sh_clk_div4_reparent_register(struct clk *clks, int nr, | 142 | int sh_clk_div4_reparent_register(struct clk *clks, int nr, |
| 139 | struct clk_div4_table *table); | 143 | struct clk_div4_table *table); |
| 140 | 144 | ||
| 141 | #define SH_CLK_DIV6(_parent, _reg, _flags) \ | 145 | #define SH_CLK_DIV6_EXT(_parent, _reg, _flags, _parents, \ |
| 142 | { \ | 146 | _num_parents, _src_shift, _src_width) \ |
| 143 | .parent = _parent, \ | 147 | { \ |
| 144 | .enable_reg = (void __iomem *)_reg, \ | 148 | .parent = _parent, \ |
| 145 | .flags = _flags, \ | 149 | .enable_reg = (void __iomem *)_reg, \ |
| 150 | .flags = _flags, \ | ||
| 151 | .parent_table = _parents, \ | ||
| 152 | .parent_num = _num_parents, \ | ||
| 153 | .src_shift = _src_shift, \ | ||
| 154 | .src_width = _src_width, \ | ||
| 146 | } | 155 | } |
| 147 | 156 | ||
| 157 | #define SH_CLK_DIV6(_parent, _reg, _flags) \ | ||
| 158 | SH_CLK_DIV6_EXT(_parent, _reg, _flags, NULL, 0, 0, 0) | ||
| 159 | |||
| 148 | int sh_clk_div6_register(struct clk *clks, int nr); | 160 | int sh_clk_div6_register(struct clk *clks, int nr); |
| 161 | int sh_clk_div6_reparent_register(struct clk *clks, int nr); | ||
| 149 | 162 | ||
| 150 | #endif /* __SH_CLOCK_H */ | 163 | #endif /* __SH_CLOCK_H */ |
diff --git a/include/linux/wm97xx_batt.h b/include/linux/wm97xx_batt.h deleted file mode 100644 index a1d6419c2ff8..000000000000 --- a/include/linux/wm97xx_batt.h +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | #ifndef _LINUX_WM97XX_BAT_H | ||
| 2 | #define _LINUX_WM97XX_BAT_H | ||
| 3 | |||
| 4 | #include <linux/wm97xx.h> | ||
| 5 | |||
| 6 | #warning This file will be removed soon, use wm97xx.h instead! | ||
| 7 | |||
| 8 | #define wm97xx_batt_info wm97xx_batt_pdata | ||
| 9 | |||
| 10 | #ifdef CONFIG_BATTERY_WM97XX | ||
| 11 | void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data); | ||
| 12 | #else | ||
| 13 | static inline void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data) {} | ||
| 14 | #endif | ||
| 15 | |||
| 16 | #endif | ||
