20 #include <linux/module.h>
24 #include <linux/slab.h>
29 #include "../w1_int.h"
30 #include "../w1_log.h"
34 #define MXC_W1_RESET_TIMEOUT 500
39 #define MXC_W1_CONTROL 0x00
40 #define MXC_W1_TIME_DIVIDER 0x02
41 #define MXC_W1_RESET 0x04
42 #define MXC_W1_COMMAND 0x06
43 #define MXC_W1_TXRX 0x08
44 #define MXC_W1_INTERRUPT 0x0A
45 #define MXC_W1_INTERRUPT_EN 0x0C
59 static u8 mxc_w1_ds2_reset_bus(
void *
data)
62 unsigned int timeout_cnt = 0;
70 if (((reg_val >> 7) & 0x1) == 0 ||
78 return (reg_val >> 7) & 0x1;
86 static u8 mxc_w1_ds2_touch_bit(
void *data,
u8 bit)
90 unsigned int timeout_cnt = 400;
96 while (timeout_cnt--) {
141 clk_prepare_enable(mdev->
clk);
145 mdev->
bus_master.reset_bus = mxc_w1_ds2_reset_bus;
146 mdev->
bus_master.touch_bit = mxc_w1_ds2_touch_bit;
153 platform_set_drvdata(pdev, mdev);
181 clk_disable_unprepare(mdev->
clk);
184 platform_set_drvdata(pdev,
NULL);
193 .probe = mxc_w1_probe,
194 .remove = mxc_w1_remove,
197 static int __init mxc_w1_init(
void)
202 static void mxc_w1_exit(
void)