/* Performs the touch-bit function, which writes a 0 or 1 and reads the level. */
static u8 ds2482_w1_touch_bit(void *data, u8 bit)
/* Performs the touch-bit function, which writes a 0 or 1 and reads the level. */
static u8 ds2482_w1_touch_bit(void *data, u8 bit)
{
	struct ds2482_w1_chan *pchan = data;
	struct ds2482_data    *pdev = pchan->pdev;
	int status = -1;
	mutex_lock(&pdev->access_lock);
	ds2482_wait_1wire_idle(pdev);
	if (pdev->w1_count > 1)
		ds2482_set_channel(pdev, pchan->channel);
	if (!ds2482_send_cmd_data(pdev, DS2482_CMD_1WIRE_SINGLE_BIT,
				  bit ? 0xFF : 0))
		status = ds2482_wait_1wire_idle(pdev);
	mutex_unlock(&pdev->access_lock);
	return (status & DS2482_REG_STS_SBR) ? 1 : 0;
}