Lines Matching +full:2 +full:- +full:wire
1 // SPDX-License-Identifier: GPL-2.0
3 * sgi_w1.c - w1 master driver for one wire support in SGI ASICs
13 #include <linux/platform_data/sgi-w1.h>
20 #define MCR_PACK(pulse, sample) (((pulse) << 10) | ((sample) << 2))
41 * reset the device on the One Wire interface
49 writel(MCR_PACK(520, 65), dev->mcr); in sgi_w1_reset_bus()
50 ret = sgi_w1_wait(dev->mcr); in sgi_w1_reset_bus()
56 * this is the low level routine to read/write a bit on the One Wire
66 writel(MCR_PACK(6, 13), dev->mcr); in sgi_w1_touch_bit()
68 writel(MCR_PACK(80, 30), dev->mcr); in sgi_w1_touch_bit()
70 ret = sgi_w1_wait(dev->mcr); in sgi_w1_touch_bit()
81 sdev = devm_kzalloc(&pdev->dev, sizeof(struct sgi_w1_device), in sgi_w1_probe()
84 return -ENOMEM; in sgi_w1_probe()
86 sdev->mcr = devm_platform_ioremap_resource(pdev, 0); in sgi_w1_probe()
87 if (IS_ERR(sdev->mcr)) in sgi_w1_probe()
88 return PTR_ERR(sdev->mcr); in sgi_w1_probe()
90 sdev->bus_master.data = sdev; in sgi_w1_probe()
91 sdev->bus_master.reset_bus = sgi_w1_reset_bus; in sgi_w1_probe()
92 sdev->bus_master.touch_bit = sgi_w1_touch_bit; in sgi_w1_probe()
94 pdata = dev_get_platdata(&pdev->dev); in sgi_w1_probe()
96 strscpy(sdev->dev_id, pdata->dev_id, sizeof(sdev->dev_id)); in sgi_w1_probe()
97 sdev->bus_master.dev_id = sdev->dev_id; in sgi_w1_probe()
102 return w1_add_master_device(&sdev->bus_master); in sgi_w1_probe()
112 w1_remove_master_device(&sdev->bus_master); in sgi_w1_remove()
126 MODULE_DESCRIPTION("Driver for One-Wire IP in SGI ASICs");