• Home
  • Raw
  • Download

Lines Matching +full:6 +full:- +full:wire

2  * Copyright 2005-2008 Freescale Semiconductor, Inc. All Rights Reserved.
30 # define MXC_W1_CONTROL_WR(x) BIT(5 - (x))
31 # define MXC_W1_CONTROL_PST BIT(6)
45 * reset the device on the One Wire interface
53 writeb(MXC_W1_CONTROL_RPP, dev->regs + MXC_W1_CONTROL); in mxc_w1_ds2_reset_bus()
61 u8 ctrl = readb(dev->regs + MXC_W1_CONTROL); in mxc_w1_ds2_reset_bus()
63 /* PST bit is valid after the RPP bit is self-cleared */ in mxc_w1_ds2_reset_bus()
72 * this is the low level routine to read/write a bit on the One Wire
81 writeb(MXC_W1_CONTROL_WR(bit), dev->regs + MXC_W1_CONTROL); in mxc_w1_ds2_touch_bit()
89 u8 ctrl = readb(dev->regs + MXC_W1_CONTROL); in mxc_w1_ds2_touch_bit()
91 /* RDST bit is valid after the WR1/RD bit is self-cleared */ in mxc_w1_ds2_touch_bit()
107 mdev = devm_kzalloc(&pdev->dev, sizeof(struct mxc_w1_device), in mxc_w1_probe()
110 return -ENOMEM; in mxc_w1_probe()
112 mdev->clk = devm_clk_get(&pdev->dev, NULL); in mxc_w1_probe()
113 if (IS_ERR(mdev->clk)) in mxc_w1_probe()
114 return PTR_ERR(mdev->clk); in mxc_w1_probe()
116 err = clk_prepare_enable(mdev->clk); in mxc_w1_probe()
120 clkrate = clk_get_rate(mdev->clk); in mxc_w1_probe()
122 dev_warn(&pdev->dev, in mxc_w1_probe()
128 dev_warn(&pdev->dev, in mxc_w1_probe()
132 mdev->regs = devm_ioremap_resource(&pdev->dev, res); in mxc_w1_probe()
133 if (IS_ERR(mdev->regs)) { in mxc_w1_probe()
134 err = PTR_ERR(mdev->regs); in mxc_w1_probe()
138 /* Software reset 1-Wire module */ in mxc_w1_probe()
139 writeb(MXC_W1_RESET_RST, mdev->regs + MXC_W1_RESET); in mxc_w1_probe()
140 writeb(0, mdev->regs + MXC_W1_RESET); in mxc_w1_probe()
142 writeb(clkdiv - 1, mdev->regs + MXC_W1_TIME_DIVIDER); in mxc_w1_probe()
144 mdev->bus_master.data = mdev; in mxc_w1_probe()
145 mdev->bus_master.reset_bus = mxc_w1_ds2_reset_bus; in mxc_w1_probe()
146 mdev->bus_master.touch_bit = mxc_w1_ds2_touch_bit; in mxc_w1_probe()
150 err = w1_add_master_device(&mdev->bus_master); in mxc_w1_probe()
157 clk_disable_unprepare(mdev->clk); in mxc_w1_probe()
168 w1_remove_master_device(&mdev->bus_master); in mxc_w1_remove()
170 clk_disable_unprepare(mdev->clk); in mxc_w1_remove()
176 { .compatible = "fsl,imx21-owire" },
193 MODULE_DESCRIPTION("Driver for One-Wire on MXC");