Linux 5.7.7
[linux/fpc-iii.git] / arch / arm / mach-imx / devices / platform-mxc_w1.c
blobab42c6b0542c7cd42a326b1b263048ca279f06be
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Copyright (C) 2010 Pengutronix
4 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
5 */
6 #include "../hardware.h"
7 #include "devices-common.h"
9 #define imx_mxc_w1_data_entry_single(soc) \
10 { \
11 .iobase = soc ## _OWIRE_BASE_ADDR, \
14 #ifdef CONFIG_SOC_IMX21
15 const struct imx_mxc_w1_data imx21_mxc_w1_data __initconst =
16 imx_mxc_w1_data_entry_single(MX21);
17 #endif /* ifdef CONFIG_SOC_IMX21 */
19 #ifdef CONFIG_SOC_IMX27
20 const struct imx_mxc_w1_data imx27_mxc_w1_data __initconst =
21 imx_mxc_w1_data_entry_single(MX27);
22 #endif /* ifdef CONFIG_SOC_IMX27 */
24 #ifdef CONFIG_SOC_IMX31
25 const struct imx_mxc_w1_data imx31_mxc_w1_data __initconst =
26 imx_mxc_w1_data_entry_single(MX31);
27 #endif /* ifdef CONFIG_SOC_IMX31 */
29 #ifdef CONFIG_SOC_IMX35
30 const struct imx_mxc_w1_data imx35_mxc_w1_data __initconst =
31 imx_mxc_w1_data_entry_single(MX35);
32 #endif /* ifdef CONFIG_SOC_IMX35 */
34 struct platform_device *__init imx_add_mxc_w1(
35 const struct imx_mxc_w1_data *data)
37 struct resource res[] = {
39 .start = data->iobase,
40 .end = data->iobase + SZ_4K - 1,
41 .flags = IORESOURCE_MEM,
45 return imx_add_platform_device("mxc_w1", 0,
46 res, ARRAY_SIZE(res), NULL, 0);