diff options
author | Corentin Chary <corentincj@iksaif.net> | 2011-11-26 05:00:11 -0500 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2012-03-20 12:02:12 -0400 |
commit | 6f6ae06eb30d4710cd86a1782326702afa18a8f6 (patch) | |
tree | d17510166e6bb8c8254b0ba08b98066bd63fd380 /drivers/platform | |
parent | 3be324a94df0c3f032178d04549dbfbf6cccb09a (diff) |
samsung-laptop: dump model and version informations
We still need to figure out exactly what each of different fields
represent, but they contain at least model and version informations.
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/samsung-laptop.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c index 431f7dc2f222..b41c7b4f9c71 100644 --- a/drivers/platform/x86/samsung-laptop.c +++ b/drivers/platform/x86/samsung-laptop.c | |||
@@ -303,6 +303,7 @@ struct samsung_laptop_debug { | |||
303 | 303 | ||
304 | struct debugfs_blob_wrapper f0000_wrapper; | 304 | struct debugfs_blob_wrapper f0000_wrapper; |
305 | struct debugfs_blob_wrapper data_wrapper; | 305 | struct debugfs_blob_wrapper data_wrapper; |
306 | struct debugfs_blob_wrapper sdiag_wrapper; | ||
306 | }; | 307 | }; |
307 | 308 | ||
308 | struct samsung_laptop; | 309 | struct samsung_laptop; |
@@ -337,6 +338,8 @@ struct samsung_laptop { | |||
337 | 338 | ||
338 | bool handle_backlight; | 339 | bool handle_backlight; |
339 | bool has_stepping_quirk; | 340 | bool has_stepping_quirk; |
341 | |||
342 | char sdiag[64]; | ||
340 | }; | 343 | }; |
341 | 344 | ||
342 | 345 | ||
@@ -1164,6 +1167,9 @@ static int samsung_debugfs_init(struct samsung_laptop *samsung) | |||
1164 | samsung->debug.data_wrapper.data = &samsung->debug.data; | 1167 | samsung->debug.data_wrapper.data = &samsung->debug.data; |
1165 | samsung->debug.data_wrapper.size = sizeof(samsung->debug.data); | 1168 | samsung->debug.data_wrapper.size = sizeof(samsung->debug.data); |
1166 | 1169 | ||
1170 | samsung->debug.sdiag_wrapper.data = samsung->sdiag; | ||
1171 | samsung->debug.sdiag_wrapper.size = strlen(samsung->sdiag); | ||
1172 | |||
1167 | dent = debugfs_create_u16("command", S_IRUGO | S_IWUSR, | 1173 | dent = debugfs_create_u16("command", S_IRUGO | S_IWUSR, |
1168 | samsung->debug.root, &samsung->debug.command); | 1174 | samsung->debug.root, &samsung->debug.command); |
1169 | if (!dent) | 1175 | if (!dent) |
@@ -1207,6 +1213,12 @@ static int samsung_debugfs_init(struct samsung_laptop *samsung) | |||
1207 | if (!dent) | 1213 | if (!dent) |
1208 | goto error_debugfs; | 1214 | goto error_debugfs; |
1209 | 1215 | ||
1216 | dent = debugfs_create_blob("sdiag", S_IRUGO | S_IWUSR, | ||
1217 | samsung->debug.root, | ||
1218 | &samsung->debug.sdiag_wrapper); | ||
1219 | if (!dent) | ||
1220 | goto error_debugfs; | ||
1221 | |||
1210 | return 0; | 1222 | return 0; |
1211 | 1223 | ||
1212 | error_debugfs: | 1224 | error_debugfs: |
@@ -1259,6 +1271,34 @@ static __init void samsung_sabi_infos(struct samsung_laptop *samsung, int loca, | |||
1259 | printk(KERN_DEBUG " SABI pointer = 0x%08x\n", ifaceP); | 1271 | printk(KERN_DEBUG " SABI pointer = 0x%08x\n", ifaceP); |
1260 | } | 1272 | } |
1261 | 1273 | ||
1274 | static void __init samsung_sabi_diag(struct samsung_laptop *samsung) | ||
1275 | { | ||
1276 | int loca = find_signature(samsung->f0000_segment, "SDiaG@"); | ||
1277 | int i; | ||
1278 | |||
1279 | if (loca == 0xffff) | ||
1280 | return ; | ||
1281 | |||
1282 | /* Example: | ||
1283 | * Ident: @SDiaG@686XX-N90X3A/966-SEC-07HL-S90X3A | ||
1284 | * | ||
1285 | * Product name: 90X3A | ||
1286 | * BIOS Version: 07HL | ||
1287 | */ | ||
1288 | loca += 1; | ||
1289 | for (i = 0; loca < 0xffff && i < sizeof(samsung->sdiag) - 1; loca++) { | ||
1290 | char temp = readb(samsung->f0000_segment + loca); | ||
1291 | |||
1292 | if (isalnum(temp) || temp == '/' || temp == '-') | ||
1293 | samsung->sdiag[i++] = temp; | ||
1294 | else | ||
1295 | break ; | ||
1296 | } | ||
1297 | |||
1298 | if (debug && samsung->sdiag[0]) | ||
1299 | pr_info("sdiag: %s", samsung->sdiag); | ||
1300 | } | ||
1301 | |||
1262 | static int __init samsung_sabi_init(struct samsung_laptop *samsung) | 1302 | static int __init samsung_sabi_init(struct samsung_laptop *samsung) |
1263 | { | 1303 | { |
1264 | const struct sabi_config *config = NULL; | 1304 | const struct sabi_config *config = NULL; |
@@ -1276,6 +1316,8 @@ static int __init samsung_sabi_init(struct samsung_laptop *samsung) | |||
1276 | goto exit; | 1316 | goto exit; |
1277 | } | 1317 | } |
1278 | 1318 | ||
1319 | samsung_sabi_diag(samsung); | ||
1320 | |||
1279 | /* Try to find one of the signatures in memory to find the header */ | 1321 | /* Try to find one of the signatures in memory to find the header */ |
1280 | for (i = 0; sabi_configs[i].test_string != 0; ++i) { | 1322 | for (i = 0; sabi_configs[i].test_string != 0; ++i) { |
1281 | samsung->config = &sabi_configs[i]; | 1323 | samsung->config = &sabi_configs[i]; |