aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/samsung-laptop.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86/samsung-laptop.c')
-rw-r--r--drivers/platform/x86/samsung-laptop.c42
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
308struct samsung_laptop; 309struct 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
1212error_debugfs: 1224error_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
1274static 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
1262static int __init samsung_sabi_init(struct samsung_laptop *samsung) 1302static 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];