Lines Matching full:hd
32 static inline void heartbeat_toggle_bit(struct heartbeat_data *hd, in heartbeat_toggle_bit() argument
37 new = (1 << hd->bit_pos[bit]); in heartbeat_toggle_bit()
41 new &= hd->mask; in heartbeat_toggle_bit()
43 switch (hd->regsize) { in heartbeat_toggle_bit()
45 new |= ioread32(hd->base) & ~hd->mask; in heartbeat_toggle_bit()
46 iowrite32(new, hd->base); in heartbeat_toggle_bit()
49 new |= ioread16(hd->base) & ~hd->mask; in heartbeat_toggle_bit()
50 iowrite16(new, hd->base); in heartbeat_toggle_bit()
53 new |= ioread8(hd->base) & ~hd->mask; in heartbeat_toggle_bit()
54 iowrite8(new, hd->base); in heartbeat_toggle_bit()
61 struct heartbeat_data *hd = from_timer(hd, t, timer); in heartbeat_timer() local
64 heartbeat_toggle_bit(hd, bit, hd->flags & HEARTBEAT_INVERTED); in heartbeat_timer()
67 if ((bit == 0) || (bit == (hd->nr_bits)-1)) in heartbeat_timer()
70 mod_timer(&hd->timer, jiffies + (110 - ((300 << FSHIFT) / in heartbeat_timer()
77 struct heartbeat_data *hd; in heartbeat_drv_probe() local
92 hd = pdev->dev.platform_data; in heartbeat_drv_probe()
94 hd = kzalloc(sizeof(struct heartbeat_data), GFP_KERNEL); in heartbeat_drv_probe()
95 if (unlikely(!hd)) in heartbeat_drv_probe()
99 hd->base = ioremap(res->start, resource_size(res)); in heartbeat_drv_probe()
100 if (unlikely(!hd->base)) { in heartbeat_drv_probe()
104 kfree(hd); in heartbeat_drv_probe()
109 if (!hd->nr_bits) { in heartbeat_drv_probe()
110 hd->bit_pos = default_bit_pos; in heartbeat_drv_probe()
111 hd->nr_bits = ARRAY_SIZE(default_bit_pos); in heartbeat_drv_probe()
114 hd->mask = 0; in heartbeat_drv_probe()
115 for (i = 0; i < hd->nr_bits; i++) in heartbeat_drv_probe()
116 hd->mask |= (1 << hd->bit_pos[i]); in heartbeat_drv_probe()
118 if (!hd->regsize) { in heartbeat_drv_probe()
121 hd->regsize = 32; in heartbeat_drv_probe()
124 hd->regsize = 16; in heartbeat_drv_probe()
128 hd->regsize = 8; in heartbeat_drv_probe()
133 timer_setup(&hd->timer, heartbeat_timer, 0); in heartbeat_drv_probe()
134 platform_set_drvdata(pdev, hd); in heartbeat_drv_probe()
136 return mod_timer(&hd->timer, jiffies + 1); in heartbeat_drv_probe()