lkml.org 
[lkml]   [2023]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] counter: 104-quad-8: Utilize helper functions to handle PR, FLAG and PSC
On Sat, Mar 18, 2023 at 10:59:51AM -0400, William Breathitt Gray wrote:
> The Preset Register (PR), Flag Register (FLAG), and Filter Clock
> Prescaler (PSC) have common usage patterns. Wrap up such usage into
> dedicated functions to improve code clarity.

...

> +static void quad8_preset_register_set(struct quad8 *const priv, const size_t id,
> + const unsigned long preset)
> +{
> + struct channel_reg __iomem *const chan = priv->reg->channel + id;
> + int i;
> +
> + /* Reset Byte Pointer */
> + iowrite8(SELECT_RLD | RESET_BP, &chan->control);
> +
> + /* Set Preset Register */
> + for (i = 0; i < 3; i++)
> + iowrite8(preset >> (8 * i), &chan->data);
> +}

May we add generic __iowrite8_copy() / __ioread8_copy() instead?

It seems that even current __ioread32_copy() and __iowrite32_copy() has to
be amended to support IO.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2023-03-27 01:08    [W:0.073 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site