mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-21 13:24:15 +08:00
counter: microchip-tcb-capture: Convert to counter_priv() wrapper
This is a straight forward conversion to the new counter_priv() wrapper. Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20211230150300.72196-8-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
63f0e2b6c0
commit
a49ede8208
@ -72,7 +72,7 @@ static int mchp_tc_count_function_read(struct counter_device *counter,
|
||||
struct counter_count *count,
|
||||
enum counter_function *function)
|
||||
{
|
||||
struct mchp_tc_data *const priv = counter->priv;
|
||||
struct mchp_tc_data *const priv = counter_priv(counter);
|
||||
|
||||
if (priv->qdec_mode)
|
||||
*function = COUNTER_FUNCTION_QUADRATURE_X4;
|
||||
@ -86,7 +86,7 @@ static int mchp_tc_count_function_write(struct counter_device *counter,
|
||||
struct counter_count *count,
|
||||
enum counter_function function)
|
||||
{
|
||||
struct mchp_tc_data *const priv = counter->priv;
|
||||
struct mchp_tc_data *const priv = counter_priv(counter);
|
||||
u32 bmr, cmr;
|
||||
|
||||
regmap_read(priv->regmap, ATMEL_TC_BMR, &bmr);
|
||||
@ -148,7 +148,7 @@ static int mchp_tc_count_signal_read(struct counter_device *counter,
|
||||
struct counter_signal *signal,
|
||||
enum counter_signal_level *lvl)
|
||||
{
|
||||
struct mchp_tc_data *const priv = counter->priv;
|
||||
struct mchp_tc_data *const priv = counter_priv(counter);
|
||||
bool sigstatus;
|
||||
u32 sr;
|
||||
|
||||
@ -169,7 +169,7 @@ static int mchp_tc_count_action_read(struct counter_device *counter,
|
||||
struct counter_synapse *synapse,
|
||||
enum counter_synapse_action *action)
|
||||
{
|
||||
struct mchp_tc_data *const priv = counter->priv;
|
||||
struct mchp_tc_data *const priv = counter_priv(counter);
|
||||
u32 cmr;
|
||||
|
||||
regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CMR), &cmr);
|
||||
@ -197,7 +197,7 @@ static int mchp_tc_count_action_write(struct counter_device *counter,
|
||||
struct counter_synapse *synapse,
|
||||
enum counter_synapse_action action)
|
||||
{
|
||||
struct mchp_tc_data *const priv = counter->priv;
|
||||
struct mchp_tc_data *const priv = counter_priv(counter);
|
||||
u32 edge = ATMEL_TC_ETRGEDG_NONE;
|
||||
|
||||
/* QDEC mode is rising edge only */
|
||||
@ -230,7 +230,7 @@ static int mchp_tc_count_action_write(struct counter_device *counter,
|
||||
static int mchp_tc_count_read(struct counter_device *counter,
|
||||
struct counter_count *count, u64 *val)
|
||||
{
|
||||
struct mchp_tc_data *const priv = counter->priv;
|
||||
struct mchp_tc_data *const priv = counter_priv(counter);
|
||||
u32 cnt;
|
||||
|
||||
regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CV), &cnt);
|
||||
|
Loading…
Reference in New Issue
Block a user