Re: [PATCH v2 1/5] reset: add reset-simple to unify socfpga, stm32, sunxi, and zx2967
From: Philipp Zabel
Date: Fri Aug 11 2017 - 11:57:34 EST
On Fri, 2017-08-11 at 23:51 +0800, Chen-Yu Tsai wrote:
> On Fri, Aug 11, 2017 at 9:06 PM, Philipp Zabel <p.zabel@xxxxxxxxxxxxxx> wrote:
> > +static int reset_simple_probe(struct platform_device *pdev)
> > +{
> > +ÂÂÂÂÂÂÂstruct device *dev = &pdev->dev;
> > +ÂÂÂÂÂÂÂconst struct of_device_id *of_id =
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂof_match_device(of_match_ptr(reset_simple_dt_ids), dev);
> > +ÂÂÂÂÂÂÂconst struct reset_simple_devdata *devdata = of_id->data;
>
> Just use of_device_get_match_data().
Will do that, thanks.
> > +struct reset_simple_data {
> > +ÂÂÂÂÂÂÂspinlock_tÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂlock;
> > +ÂÂÂÂÂÂÂvoid __iomemÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ*membase;
> > +ÂÂÂÂÂÂÂstruct reset_controller_devÂÂÂÂÂrcdev;
> > +ÂÂÂÂÂÂÂboolÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂinverted;
>
> You should document this option. "Inverted" by itself does not
> say a whole lot, as there is no mention about what the normal
> or non-inverted behavior is. Is the reset active low (assert
> reset when bit is cleared)? Or active high (assert reset when
> bit is set)?
You are right. Also, maybe I should rename this to
"bool active_low;" to avoid confusion where it is used.
regards
Philipp