Navigation Menu

Skip to content

Commit

Permalink
Added a "continue" interface to /sys.
Browse files Browse the repository at this point in the history
This is useful for the WAIT opcode, where we need to re-trigger the pulseblaster
without an implicit stop-reset first.
(arm + continue) is equivalent to start.
  • Loading branch information
Richard Neill committed Jan 8, 2011
1 parent 391ba8c commit cbf2a10
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions kernel/pulseblaster.c
Expand Up @@ -299,6 +299,22 @@ static int pb_arm(struct pulseblaster *pb)
return 0;
}

/**
* Continue program
*
* @pb: Pulseblaster device
*/
static int pb_continue(struct pulseblaster *pb)
{
int rc;

rc = pb_cmd_start(pb);
if (rc)
return rc;

return 0;
}

/**
* Start program
*
Expand Down Expand Up @@ -527,6 +543,21 @@ static ssize_t pb_attr_arm_write(struct device *dev,
return pb_attr_button_write(dev, attr, buf, len, pb_arm);
}

/**
* Write to continue attribute
*
* @dev: Device
* @attr: Attribute
* @buf: Data buffer
* @len: Length of data buffer
*/
static ssize_t pb_attr_continue_write(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t len)
{
return pb_attr_button_write(dev, attr, buf, len, pb_continue);
}

/**
* Write to program attribute
*
Expand All @@ -549,6 +580,7 @@ static struct device_attribute pb_dev_attrs[] = {
__ATTR(start, S_IWUSR, NULL, pb_attr_start_write),
__ATTR(stop, S_IWUSR, NULL, pb_attr_stop_write),
__ATTR(arm, S_IWUSR, NULL, pb_attr_arm_write),
__ATTR(continue, S_IWUSR, NULL, pb_attr_continue_write),
};

/** Pulseblaster program attribute */
Expand Down

0 comments on commit cbf2a10

Please sign in to comment.