From: Pavel Machek <pavel@ucw.cz>
To: Fengping Yu <fengping.yu@mediatek.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Yingjoe Chen <yingjoe.chen@mediatek.com>,
Jacek Anaszewski <jacek.anaszewski@gmail.com>,
linux-input@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v1 2/3] drivers: input: misc: Add mtk vibrator driver
Date: Tue, 16 Jun 2020 13:02:16 +0200 [thread overview]
Message-ID: <20200616110216.GK1718@bug> (raw)
In-Reply-To: <20200615114203.116656-3-fengping.yu@mediatek.com>
Hi!
> +static int mt_vibra_parse_dt(struct device *dev,
> + struct reg_vibr_config *vibr_conf)
> +{
> + int ret;
> +
> + if (device_property_read_u32(dev, "min-limit",
> + &vibr_conf->min_limit))
> + vibr_conf->min_limit = DEFAULT_MIN_LIMIT;
> + vibr_conf->min_limit = max_t(unsigned int,
> + vibr_conf->min_limit, DEFAULT_MIN_LIMIT);
> +
> + if (device_property_read_u32(dev, "max-limit",
> + &vibr_conf->max_limit))
> + vibr_conf->max_limit = 0;
Is max_limit useful? Do you enforce it in useful way?
> + if (!vibr_conf->max_limit &&
> + vibr_conf->max_limit < vibr_conf->min_limit) {
> + dev_err(dev, "error load dts: get error limitation(min > max)\n");
> + return -EINVAL;
> + }
Condition looks wrong.
> +static struct attribute *sysfs_attrs[] = { + &dev_attr_activate.attr, +
> &dev_attr_state.attr, + &dev_attr_duration.attr, + NULL, +}; + +static struct
> attribute_group vibr_group = { + .attrs = sysfs_attrs, +}; + +static int
> regulator_oc_event(struct notifier_block *nb, + unsigned long event, void *data) +{ +
Do you need custom attributes? Why? Where is their documentation?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
WARNING: multiple messages have this Message-ID (diff)
From: Pavel Machek <pavel@ucw.cz>
To: Fengping Yu <fengping.yu@mediatek.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-mediatek@lists.infradead.org,
Jacek Anaszewski <jacek.anaszewski@gmail.com>,
linux-input@vger.kernel.org,
Matthias Brugger <matthias.bgg@gmail.com>,
Yingjoe Chen <yingjoe.chen@mediatek.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v1 2/3] drivers: input: misc: Add mtk vibrator driver
Date: Tue, 16 Jun 2020 13:02:16 +0200 [thread overview]
Message-ID: <20200616110216.GK1718@bug> (raw)
In-Reply-To: <20200615114203.116656-3-fengping.yu@mediatek.com>
Hi!
> +static int mt_vibra_parse_dt(struct device *dev,
> + struct reg_vibr_config *vibr_conf)
> +{
> + int ret;
> +
> + if (device_property_read_u32(dev, "min-limit",
> + &vibr_conf->min_limit))
> + vibr_conf->min_limit = DEFAULT_MIN_LIMIT;
> + vibr_conf->min_limit = max_t(unsigned int,
> + vibr_conf->min_limit, DEFAULT_MIN_LIMIT);
> +
> + if (device_property_read_u32(dev, "max-limit",
> + &vibr_conf->max_limit))
> + vibr_conf->max_limit = 0;
Is max_limit useful? Do you enforce it in useful way?
> + if (!vibr_conf->max_limit &&
> + vibr_conf->max_limit < vibr_conf->min_limit) {
> + dev_err(dev, "error load dts: get error limitation(min > max)\n");
> + return -EINVAL;
> + }
Condition looks wrong.
> +static struct attribute *sysfs_attrs[] = { + &dev_attr_activate.attr, +
> &dev_attr_state.attr, + &dev_attr_duration.attr, + NULL, +}; + +static struct
> attribute_group vibr_group = { + .attrs = sysfs_attrs, +}; + +static int
> regulator_oc_event(struct notifier_block *nb, + unsigned long event, void *data) +{ +
Do you need custom attributes? Why? Where is their documentation?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
WARNING: multiple messages have this Message-ID (diff)
From: Pavel Machek <pavel@ucw.cz>
To: Fengping Yu <fengping.yu@mediatek.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-mediatek@lists.infradead.org,
Jacek Anaszewski <jacek.anaszewski@gmail.com>,
linux-input@vger.kernel.org,
Matthias Brugger <matthias.bgg@gmail.com>,
Yingjoe Chen <yingjoe.chen@mediatek.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v1 2/3] drivers: input: misc: Add mtk vibrator driver
Date: Tue, 16 Jun 2020 13:02:16 +0200 [thread overview]
Message-ID: <20200616110216.GK1718@bug> (raw)
In-Reply-To: <20200615114203.116656-3-fengping.yu@mediatek.com>
Hi!
> +static int mt_vibra_parse_dt(struct device *dev,
> + struct reg_vibr_config *vibr_conf)
> +{
> + int ret;
> +
> + if (device_property_read_u32(dev, "min-limit",
> + &vibr_conf->min_limit))
> + vibr_conf->min_limit = DEFAULT_MIN_LIMIT;
> + vibr_conf->min_limit = max_t(unsigned int,
> + vibr_conf->min_limit, DEFAULT_MIN_LIMIT);
> +
> + if (device_property_read_u32(dev, "max-limit",
> + &vibr_conf->max_limit))
> + vibr_conf->max_limit = 0;
Is max_limit useful? Do you enforce it in useful way?
> + if (!vibr_conf->max_limit &&
> + vibr_conf->max_limit < vibr_conf->min_limit) {
> + dev_err(dev, "error load dts: get error limitation(min > max)\n");
> + return -EINVAL;
> + }
Condition looks wrong.
> +static struct attribute *sysfs_attrs[] = { + &dev_attr_activate.attr, +
> &dev_attr_state.attr, + &dev_attr_duration.attr, + NULL, +}; + +static struct
> attribute_group vibr_group = { + .attrs = sysfs_attrs, +}; + +static int
> regulator_oc_event(struct notifier_block *nb, + unsigned long event, void *data) +{ +
Do you need custom attributes? Why? Where is their documentation?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-06-16 11:02 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-15 11:42 [PATCH v1] Add vibrator driver support for Mediatek SoCs Fengping Yu
2020-06-15 11:42 ` Fengping Yu
2020-06-15 11:42 ` Fengping Yu
2020-06-15 11:42 ` [PATCH v1 1/3] dt-bindings:Add vibrator devicetree documentation Fengping Yu
2020-06-15 11:42 ` Fengping Yu
2020-06-16 10:58 ` Pavel Machek
2020-06-16 10:58 ` Pavel Machek
2020-06-16 10:58 ` Pavel Machek
2020-06-15 11:42 ` [PATCH v1 2/3] drivers: input: misc: Add mtk vibrator driver Fengping Yu
2020-06-15 11:42 ` Fengping Yu
2020-06-15 15:07 ` kernel test robot
2020-06-15 15:07 ` kernel test robot
2020-06-15 15:07 ` kernel test robot
2020-06-15 15:07 ` kernel test robot
2020-06-15 15:51 ` kernel test robot
2020-06-15 15:51 ` kernel test robot
2020-06-16 11:02 ` Pavel Machek [this message]
2020-06-16 11:02 ` Pavel Machek
2020-06-16 11:02 ` Pavel Machek
2020-06-16 11:03 ` Pavel Machek
2020-06-16 11:03 ` Pavel Machek
2020-06-16 11:03 ` Pavel Machek
2020-06-15 11:42 ` [PATCH v1 3/3] defconfig: Add CONFIG_INPUT_REGULATOR_VIBRATOR=m Fengping Yu
2020-06-15 11:42 ` Fengping Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200616110216.GK1718@bug \
--to=pavel@ucw.cz \
--cc=catalin.marinas@arm.com \
--cc=dmitry.torokhov@gmail.com \
--cc=fengping.yu@mediatek.com \
--cc=jacek.anaszewski@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=yingjoe.chen@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.