Merge tag 'dt-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-2.6-microblaze.git] / drivers / counter / microchip-tcb-capture.c
index 51b8af8..1aa70b9 100644 (file)
@@ -37,9 +37,9 @@ enum mchp_tc_count_function {
        MCHP_TC_FUNCTION_QUADRATURE,
 };
 
-static const enum counter_count_function mchp_tc_count_functions[] = {
-       [MCHP_TC_FUNCTION_INCREASE] = COUNTER_COUNT_FUNCTION_INCREASE,
-       [MCHP_TC_FUNCTION_QUADRATURE] = COUNTER_COUNT_FUNCTION_QUADRATURE_X4,
+static const enum counter_function mchp_tc_count_functions[] = {
+       [MCHP_TC_FUNCTION_INCREASE] = COUNTER_FUNCTION_INCREASE,
+       [MCHP_TC_FUNCTION_QUADRATURE] = COUNTER_FUNCTION_QUADRATURE_X4,
 };
 
 enum mchp_tc_synapse_action {
@@ -133,6 +133,9 @@ static int mchp_tc_count_function_set(struct counter_device *counter,
                bmr |= ATMEL_TC_QDEN | ATMEL_TC_POSEN;
                cmr |= ATMEL_TC_ETRGEDG_RISING | ATMEL_TC_ABETRG | ATMEL_TC_XC0;
                break;
+       default:
+               /* should never reach this path */
+               return -EINVAL;
        }
 
        regmap_write(priv->regmap, ATMEL_TC_BMR, bmr);
@@ -155,7 +158,7 @@ static int mchp_tc_count_function_set(struct counter_device *counter,
 
 static int mchp_tc_count_signal_read(struct counter_device *counter,
                                     struct counter_signal *signal,
-                                    enum counter_signal_value *val)
+                                    enum counter_signal_level *lvl)
 {
        struct mchp_tc_data *const priv = counter->priv;
        bool sigstatus;
@@ -168,7 +171,7 @@ static int mchp_tc_count_signal_read(struct counter_device *counter,
        else
                sigstatus = (sr & ATMEL_TC_MTIOA);
 
-       *val = sigstatus ? COUNTER_SIGNAL_HIGH : COUNTER_SIGNAL_LOW;
+       *lvl = sigstatus ? COUNTER_SIGNAL_LEVEL_HIGH : COUNTER_SIGNAL_LEVEL_LOW;
 
        return 0;
 }
@@ -226,6 +229,9 @@ static int mchp_tc_count_action_set(struct counter_device *counter,
        case MCHP_TC_SYNAPSE_ACTION_BOTH_EDGE:
                edge = ATMEL_TC_ETRGEDG_BOTH;
                break;
+       default:
+               /* should never reach this path */
+               return -EINVAL;
        }
 
        return regmap_write_bits(priv->regmap,