diff options
author | Ben Dooks <ben-linux@fluff.org> | 2005-11-01 14:44:29 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-01 14:44:29 -0500 |
commit | 6ff8f59f13974ab54086c5c86898647642bc77dd (patch) | |
tree | 09923ec2c046bd5c9372b577783861612c55a372 /Documentation/arm/Samsung-S3C24XX | |
parent | e838ffc2e5c9afa81451cf21dcd3f3246e2adcd2 (diff) |
[ARM] 3076/1: S3C2410 - updated documentation for platfrom data init
Patch from Ben Dooks
Update the Documentation/arm/Samsung-S3C24XX to add
example platform data initialisation, and add the
linux-arm mailing list URL.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'Documentation/arm/Samsung-S3C24XX')
-rw-r--r-- | Documentation/arm/Samsung-S3C24XX/Overview.txt | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/Documentation/arm/Samsung-S3C24XX/Overview.txt b/Documentation/arm/Samsung-S3C24XX/Overview.txt index 3af4d29a8938..89aa89d526ac 100644 --- a/Documentation/arm/Samsung-S3C24XX/Overview.txt +++ b/Documentation/arm/Samsung-S3C24XX/Overview.txt | |||
@@ -81,7 +81,8 @@ Adding New Machines | |||
81 | 81 | ||
82 | Any large scale modifications, or new drivers should be discussed | 82 | Any large scale modifications, or new drivers should be discussed |
83 | on the ARM kernel mailing list (linux-arm-kernel) before being | 83 | on the ARM kernel mailing list (linux-arm-kernel) before being |
84 | attempted. | 84 | attempted. See http://www.arm.linux.org.uk/mailinglists/ for the |
85 | mailing list information. | ||
85 | 86 | ||
86 | 87 | ||
87 | NAND | 88 | NAND |
@@ -120,6 +121,43 @@ Clock Management | |||
120 | various clock units | 121 | various clock units |
121 | 122 | ||
122 | 123 | ||
124 | Platform Data | ||
125 | ------------- | ||
126 | |||
127 | Whenever a device has platform specific data that is specified | ||
128 | on a per-machine basis, care should be taken to ensure the | ||
129 | following: | ||
130 | |||
131 | 1) that default data is not left in the device to confuse the | ||
132 | driver if a machine does not set it at startup | ||
133 | |||
134 | 2) the data should (if possible) be marked as __initdata, | ||
135 | to ensure that the data is thrown away if the machine is | ||
136 | not the one currently in use. | ||
137 | |||
138 | The best way of doing this is to make a function that | ||
139 | kmalloc()s an area of memory, and copies the __initdata | ||
140 | and then sets the relevant device's platform data. Making | ||
141 | the function `__init` takes care of ensuring it is discarded | ||
142 | with the rest of the initialisation code | ||
143 | |||
144 | static __init void s3c24xx_xxx_set_platdata(struct xxx_data *pd) | ||
145 | { | ||
146 | struct s3c2410_xxx_mach_info *npd; | ||
147 | |||
148 | npd = kmalloc(sizeof(struct s3c2410_xxx_mach_info), GFP_KERNEL); | ||
149 | if (npd) { | ||
150 | memcpy(npd, pd, sizeof(struct s3c2410_xxx_mach_info)); | ||
151 | s3c_device_xxx.dev.platform_data = npd; | ||
152 | } else { | ||
153 | printk(KERN_ERR "no memory for xxx platform data\n"); | ||
154 | } | ||
155 | } | ||
156 | |||
157 | Note, since the code is marked as __init, it should not be | ||
158 | exported outside arch/arm/mach-s3c2410/, or exported to | ||
159 | modules via EXPORT_SYMBOL() and related functions. | ||
160 | |||
123 | Port Contributors | 161 | Port Contributors |
124 | ----------------- | 162 | ----------------- |
125 | 163 | ||
@@ -149,6 +187,7 @@ Document Changes | |||
149 | 06 Mar 2005 - BJD - Added Christer Weinigel | 187 | 06 Mar 2005 - BJD - Added Christer Weinigel |
150 | 08 Mar 2005 - BJD - Added LCVR to list of people, updated introduction | 188 | 08 Mar 2005 - BJD - Added LCVR to list of people, updated introduction |
151 | 08 Mar 2005 - BJD - Added section on adding machines | 189 | 08 Mar 2005 - BJD - Added section on adding machines |
190 | 09 Sep 2005 - BJD - Added section on platform data | ||
152 | 191 | ||
153 | Document Author | 192 | Document Author |
154 | --------------- | 193 | --------------- |