mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-27 23:20:26 +09:00
button: adc: fix treshold typo
Fix the treshold typo in code by threshold.
Fixes: c0165c85c3
("button: add a simple Analog to Digital Converter device based button driver")
Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
This commit is contained in:
parent
e4dba4ba6f
commit
efe1f06496
@ -55,7 +55,7 @@ static int button_adc_of_to_plat(struct udevice *dev)
|
|||||||
struct button_uc_plat *uc_plat = dev_get_uclass_plat(dev);
|
struct button_uc_plat *uc_plat = dev_get_uclass_plat(dev);
|
||||||
struct button_adc_priv *priv = dev_get_priv(dev);
|
struct button_adc_priv *priv = dev_get_priv(dev);
|
||||||
struct ofnode_phandle_args args;
|
struct ofnode_phandle_args args;
|
||||||
u32 treshold, up_treshold, t;
|
u32 threshold, up_threshold, t;
|
||||||
ofnode node;
|
ofnode node;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -73,12 +73,12 @@ static int button_adc_of_to_plat(struct udevice *dev)
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = ofnode_read_u32(dev_ofnode(dev->parent),
|
ret = ofnode_read_u32(dev_ofnode(dev->parent),
|
||||||
"keyup-threshold-microvolt", &up_treshold);
|
"keyup-threshold-microvolt", &up_threshold);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = ofnode_read_u32(dev_ofnode(dev), "press-threshold-microvolt",
|
ret = ofnode_read_u32(dev_ofnode(dev), "press-threshold-microvolt",
|
||||||
&treshold);
|
&threshold);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -87,13 +87,13 @@ static int button_adc_of_to_plat(struct udevice *dev)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (t > treshold)
|
if (t > threshold)
|
||||||
up_treshold = t;
|
up_threshold = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->channel = args.args[0];
|
priv->channel = args.args[0];
|
||||||
priv->min = treshold;
|
priv->min = threshold;
|
||||||
priv->max = up_treshold;
|
priv->max = up_threshold;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user