Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/platform/ts5500: Add support for TS-5400 boards

This patch extends the TS-5500 platform driver to support the
similar Technologic Systems TS-5400 Single Board Computer:

http://wiki.embeddedarm.com/wiki/TS-5400

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Savoir-faire Linux Inc. <kernel@savoirfairelinux.com>
Link: http://lkml.kernel.org/r/1404860269-11837-4-git-send-email-vivien.didelot@savoirfairelinux.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Vivien Didelot and committed by
Ingo Molnar
832fcc89 84e288d4

+13 -8
+13 -8
arch/x86/platform/ts5500/ts5500.c
··· 15 15 * state or available options. For further information about sysfs entries, see 16 16 * Documentation/ABI/testing/sysfs-platform-ts5500. 17 17 * 18 - * This code actually supports the TS-5500 platform, but it may be extended to 19 - * support similar Technologic Systems x86-based platforms, such as the TS-5600. 18 + * This code may be extended to support similar x86-based platforms. 19 + * Actually, the TS-5500 and TS-5400 are supported. 20 20 */ 21 21 22 22 #include <linux/delay.h> ··· 32 32 /* Product code register */ 33 33 #define TS5500_PRODUCT_CODE_ADDR 0x74 34 34 #define TS5500_PRODUCT_CODE 0x60 /* TS-5500 product code */ 35 + #define TS5400_PRODUCT_CODE 0x40 /* TS-5400 product code */ 35 36 36 37 /* SRAM/RS-485/ADC options, and RS-485 RTS/Automatic RS-485 flags register */ 37 38 #define TS5500_SRAM_RS485_ADC_ADDR 0x75 ··· 128 127 sbc->id = inb(TS5500_PRODUCT_CODE_ADDR); 129 128 if (sbc->id == TS5500_PRODUCT_CODE) { 130 129 sbc->name = "TS-5500"; 130 + } else if (sbc->id == TS5400_PRODUCT_CODE) { 131 + sbc->name = "TS-5400"; 131 132 } else { 132 133 pr_err("ts5500: unknown product code 0x%x\n", sbc->id); 133 134 ret = -ENODEV; ··· 321 318 if (err) 322 319 goto error; 323 320 324 - ts5500_dio1_pdev.dev.parent = &pdev->dev; 325 - if (platform_device_register(&ts5500_dio1_pdev)) 326 - dev_warn(&pdev->dev, "DIO1 block registration failed\n"); 327 - ts5500_dio2_pdev.dev.parent = &pdev->dev; 328 - if (platform_device_register(&ts5500_dio2_pdev)) 329 - dev_warn(&pdev->dev, "DIO2 block registration failed\n"); 321 + if (sbc->id == TS5500_PRODUCT_CODE) { 322 + ts5500_dio1_pdev.dev.parent = &pdev->dev; 323 + if (platform_device_register(&ts5500_dio1_pdev)) 324 + dev_warn(&pdev->dev, "DIO1 block registration failed\n"); 325 + ts5500_dio2_pdev.dev.parent = &pdev->dev; 326 + if (platform_device_register(&ts5500_dio2_pdev)) 327 + dev_warn(&pdev->dev, "DIO2 block registration failed\n"); 328 + } 330 329 331 330 if (led_classdev_register(&pdev->dev, &ts5500_led_cdev)) 332 331 dev_warn(&pdev->dev, "LED registration failed\n");