diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2014-07-08 18:57:49 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-07-16 15:17:42 -0400 |
commit | 832fcc899a90cce54eb5e47c7fd099eacc0130da (patch) | |
tree | 96dc60bafc533fd9662f74826e337d0051fdc66d /arch/x86/platform/ts5500 | |
parent | 84e288d41871cfb7a21cb7e6dee9e3884b59b25f (diff) |
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>
Diffstat (limited to 'arch/x86/platform/ts5500')
-rw-r--r-- | arch/x86/platform/ts5500/ts5500.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/arch/x86/platform/ts5500/ts5500.c b/arch/x86/platform/ts5500/ts5500.c index 4eb8eea07dab..baf16e72e668 100644 --- a/arch/x86/platform/ts5500/ts5500.c +++ b/arch/x86/platform/ts5500/ts5500.c | |||
@@ -15,8 +15,8 @@ | |||
15 | * state or available options. For further information about sysfs entries, see | 15 | * state or available options. For further information about sysfs entries, see |
16 | * Documentation/ABI/testing/sysfs-platform-ts5500. | 16 | * Documentation/ABI/testing/sysfs-platform-ts5500. |
17 | * | 17 | * |
18 | * This code actually supports the TS-5500 platform, but it may be extended to | 18 | * This code may be extended to support similar x86-based platforms. |
19 | * support similar Technologic Systems x86-based platforms, such as the TS-5600. | 19 | * Actually, the TS-5500 and TS-5400 are supported. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
@@ -32,6 +32,7 @@ | |||
32 | /* Product code register */ | 32 | /* Product code register */ |
33 | #define TS5500_PRODUCT_CODE_ADDR 0x74 | 33 | #define TS5500_PRODUCT_CODE_ADDR 0x74 |
34 | #define TS5500_PRODUCT_CODE 0x60 /* TS-5500 product code */ | 34 | #define TS5500_PRODUCT_CODE 0x60 /* TS-5500 product code */ |
35 | #define TS5400_PRODUCT_CODE 0x40 /* TS-5400 product code */ | ||
35 | 36 | ||
36 | /* SRAM/RS-485/ADC options, and RS-485 RTS/Automatic RS-485 flags register */ | 37 | /* SRAM/RS-485/ADC options, and RS-485 RTS/Automatic RS-485 flags register */ |
37 | #define TS5500_SRAM_RS485_ADC_ADDR 0x75 | 38 | #define TS5500_SRAM_RS485_ADC_ADDR 0x75 |
@@ -127,6 +128,8 @@ static int __init ts5500_detect_config(struct ts5500_sbc *sbc) | |||
127 | sbc->id = inb(TS5500_PRODUCT_CODE_ADDR); | 128 | sbc->id = inb(TS5500_PRODUCT_CODE_ADDR); |
128 | if (sbc->id == TS5500_PRODUCT_CODE) { | 129 | if (sbc->id == TS5500_PRODUCT_CODE) { |
129 | sbc->name = "TS-5500"; | 130 | sbc->name = "TS-5500"; |
131 | } else if (sbc->id == TS5400_PRODUCT_CODE) { | ||
132 | sbc->name = "TS-5400"; | ||
130 | } else { | 133 | } else { |
131 | pr_err("ts5500: unknown product code 0x%x\n", sbc->id); | 134 | pr_err("ts5500: unknown product code 0x%x\n", sbc->id); |
132 | ret = -ENODEV; | 135 | ret = -ENODEV; |
@@ -318,12 +321,14 @@ static int __init ts5500_init(void) | |||
318 | if (err) | 321 | if (err) |
319 | goto error; | 322 | goto error; |
320 | 323 | ||
321 | ts5500_dio1_pdev.dev.parent = &pdev->dev; | 324 | if (sbc->id == TS5500_PRODUCT_CODE) { |
322 | if (platform_device_register(&ts5500_dio1_pdev)) | 325 | ts5500_dio1_pdev.dev.parent = &pdev->dev; |
323 | dev_warn(&pdev->dev, "DIO1 block registration failed\n"); | 326 | if (platform_device_register(&ts5500_dio1_pdev)) |
324 | ts5500_dio2_pdev.dev.parent = &pdev->dev; | 327 | dev_warn(&pdev->dev, "DIO1 block registration failed\n"); |
325 | if (platform_device_register(&ts5500_dio2_pdev)) | 328 | ts5500_dio2_pdev.dev.parent = &pdev->dev; |
326 | dev_warn(&pdev->dev, "DIO2 block registration failed\n"); | 329 | if (platform_device_register(&ts5500_dio2_pdev)) |
330 | dev_warn(&pdev->dev, "DIO2 block registration failed\n"); | ||
331 | } | ||
327 | 332 | ||
328 | if (led_classdev_register(&pdev->dev, &ts5500_led_cdev)) | 333 | if (led_classdev_register(&pdev->dev, &ts5500_led_cdev)) |
329 | dev_warn(&pdev->dev, "LED registration failed\n"); | 334 | dev_warn(&pdev->dev, "LED registration failed\n"); |