unsigned long val1, val2, mask;
        struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent);
        struct etmv4_config *config = &drvdata->config;
+       int nr_inputs;
 
        /*
         * Don't use contextID tracing if coming from a PID namespace.  See
         */
        if (!drvdata->ctxid_size || !drvdata->numcidc)
                return -EINVAL;
-       if (sscanf(buf, "%lx %lx", &val1, &val2) != 2)
+       /* one mask if <= 4 comparators, two for up to 8 */
+       nr_inputs = sscanf(buf, "%lx %lx", &val1, &val2);
+       if ((drvdata->numcidc > 4) && (nr_inputs != 2))
                return -EINVAL;
 
        spin_lock(&drvdata->spinlock);
        unsigned long val1, val2, mask;
        struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent);
        struct etmv4_config *config = &drvdata->config;
+       int nr_inputs;
 
        /*
         * only implemented when vmid tracing is enabled, i.e. at least one
         */
        if (!drvdata->vmid_size || !drvdata->numvmidc)
                return -EINVAL;
-       if (sscanf(buf, "%lx %lx", &val1, &val2) != 2)
+       /* one mask if <= 4 comparators, two for up to 8 */
+       nr_inputs = sscanf(buf, "%lx %lx", &val1, &val2);
+       if ((drvdata->numvmidc > 4) && (nr_inputs != 2))
                return -EINVAL;
 
        spin_lock(&drvdata->spinlock);