vsp-lib: Add set control support
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 27 May 2016 12:58:16 +0000 (15:58 +0300)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sun, 19 Jun 2016 12:26:01 +0000 (15:26 +0300)
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
scripts/vsp-lib.sh

index f6fd342..c587d5e 100755 (executable)
@@ -68,6 +68,18 @@ vsp1_has_control() {
        $yavta --no-query -l $subdev | grep -q -- "$control_name"
 }
 
+vsp1_set_control() {
+       entity=$1
+       control_name=$(echo $2 | tr '+' ' ')
+       value=$3
+
+       subdev=$(vsp1_entity_subdev $entity)
+       control=$($yavta --no-query -l $subdev | grep -- "$control_name" | cut -d ' ' -f 2)
+
+       echo "Setting control $control_name ($control) to $value" | ./logger.sh "$entity" >> $logfile
+       $yavta --no-query -w "$control $value" $subdev | ./logger.sh "$entity" >> $logfile
+}
+
 # -----------------------------------------------------------------------------
 # Referance frame generation
 #