From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chanwoo Choi Subject: Re: [PATCH v3 2/2] extcon: add optional input-debounce attribute Date: Thu, 19 Oct 2017 19:18:03 +0900 Message-ID: <59E87BDB.2090104@samsung.com> References: <1508406773-887-1-git-send-email-raveendra.padasalagi@broadcom.com> <1508406773-887-2-git-send-email-raveendra.padasalagi@broadcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Return-path: In-reply-to: <1508406773-887-2-git-send-email-raveendra.padasalagi-dY08KVG/lbpWk0Htik3J/w@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Raveendra Padasalagi , MyungJoo Ham , Rob Herring , Mark Rutland , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org List-Id: devicetree@vger.kernel.org Hi, On 2017년 10월 19일 18:52, Raveendra Padasalagi wrote: > Add changes to capture optional dt attribute "input-debounce" > provided in extcon node and used the same value if provided otherwise > default value of 20000 usecs is used for id and vbus gpios debounce time. > > Signed-off-by: Raveendra Padasalagi > Reviewed-by: Ray Jui > Reviewed-by: Srinath Mannam > --- > > Changes in v3: > - Changed USB_GPIO_DEBOUNCE_MS to USB_GPIO_DEBOUNCE_USEC > - Changed msecs_to_jiffies() to usecs_to_jiffies() > > Changes in v2: > Rename gpio_debounce_timeout_ms to debounce_usecs > > drivers/extcon/extcon-usb-gpio.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) Looks good to me. Acked-by: Chanwoo Choi After completing the review of patch1 from DT maintainer, I'll merge these patch sets. > > diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c > index 9c925b0..69149e2 100644 > --- a/drivers/extcon/extcon-usb-gpio.c > +++ b/drivers/extcon/extcon-usb-gpio.c > @@ -28,7 +28,7 @@ > #include > #include > > -#define USB_GPIO_DEBOUNCE_MS 20 /* ms */ > +#define USB_GPIO_DEBOUNCE_USEC 20000 /* us */ > > struct usb_extcon_info { > struct device *dev; > @@ -41,6 +41,7 @@ struct usb_extcon_info { > > unsigned long debounce_jiffies; > struct delayed_work wq_detcable; > + unsigned int debounce_usecs; > }; > > static const unsigned int usb_extcon_cable[] = { > @@ -133,6 +134,11 @@ static int usb_extcon_probe(struct platform_device *pdev) > if (IS_ERR(info->vbus_gpiod)) > return PTR_ERR(info->vbus_gpiod); > > + ret = of_property_read_u32(np, "input-debounce", > + &info->debounce_usecs); > + if (ret) > + info->debounce_usecs = USB_GPIO_DEBOUNCE_USEC; > + > info->edev = devm_extcon_dev_allocate(dev, usb_extcon_cable); > if (IS_ERR(info->edev)) { > dev_err(dev, "failed to allocate extcon device\n"); > @@ -147,13 +153,13 @@ static int usb_extcon_probe(struct platform_device *pdev) > > if (info->id_gpiod) > ret = gpiod_set_debounce(info->id_gpiod, > - USB_GPIO_DEBOUNCE_MS * 1000); > + info->debounce_usecs); > if (!ret && info->vbus_gpiod) > ret = gpiod_set_debounce(info->vbus_gpiod, > - USB_GPIO_DEBOUNCE_MS * 1000); > + info->debounce_usecs); > > if (ret < 0) > - info->debounce_jiffies = msecs_to_jiffies(USB_GPIO_DEBOUNCE_MS); > + info->debounce_jiffies = usecs_to_jiffies(info->debounce_usecs); > > INIT_DELAYED_WORK(&info->wq_detcable, usb_extcon_detect_cable); > > -- Best Regards, Chanwoo Choi Samsung Electronics -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752145AbdJSKSG (ORCPT ); Thu, 19 Oct 2017 06:18:06 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:48359 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751311AbdJSKSE (ORCPT ); Thu, 19 Oct 2017 06:18:04 -0400 X-AuditID: b6c32a39-a6fff7000000109f-2b-59e87bd9c21f MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset="UTF-8" Message-id: <59E87BDB.2090104@samsung.com> Date: Thu, 19 Oct 2017 19:18:03 +0900 From: Chanwoo Choi Organization: Samsung Electronics User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: Raveendra Padasalagi , MyungJoo Ham , Rob Herring , Mark Rutland , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: bcm-kernel-feedback-list@broadcom.com Subject: Re: [PATCH v3 2/2] extcon: add optional input-debounce attribute In-reply-to: <1508406773-887-2-git-send-email-raveendra.padasalagi@broadcom.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDKsWRmVeSWpSXmKPExsWy7bCmge7N6heRBrvXm1is7T3KYjH/yDlW i8u75rBZLL1+kcniduMKNotv7Y9YLVr3HmF3YPdYM28No8es+2fZPDat6mTz6NuyitHj8ya5 ANaoVJuM1MSU1CKF1Lzk/JTMvHRbJe/geOd4UzMDQ11DSwtzJYW8xNxUWyUXnwBdt8wcoDOU FMoSc0qBQgGJxcVK+nY2RfmlJakKGfnFJbZK0YaGRnqGBuZ6RkZGeibGsVZGpkAlCakZ/dM2 Mhe0i1Uc7P3J1sD4R7CLkZNDQsBE4vuNL2xdjFwcQgI7GCXWPfnLBOF8Z5Q4tOwlI0zVrPf/ mCESGxgl5jzrZAdJ8AoISvyYfI+li5GDg1lAXuLIpWyQMLOApsTW3evZIervMUr8+7aWCaJe S6JrRwsziM0ioCpx+fAzVhCbDSi+/8UNNhCbX0BR4uqPx2CLRQUiJHbO/wY2SETgDaPEyxft rDAbfs9rBTtCWMBT4smL/WALOAUCJLat7wb7R0LgDJvE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W XJl7iFGCg1lJhDc/4EWkEG9KYmVValF+fFFpTmrxIUZpDhYlcd7beccihQTSE0tSs1NTC1KL YLJMHJxSDYxyUukeDrPfXKgxqz2xuYB7TvEq5sisNd2ZmvWlWXv56n2WfxKcuLvvhJElc7Ln QwOjLl612L3P5S5MtnUz5Qr+Ktv/bfGKfP7kz2LHUsoMpl0QO6o2aWPEJf53S2x/HWBXfNU1 T3XNyeW8zh8EyhOn1Lr6lkZG3cjsrMh3WJz2c32J1p+2NiWW4oxEQy3mouJEAJr3uf5yAgAA X-CMS-MailID: 20171019101801epcas1p49ca0839467667a6a299d63a771d5528d X-Msg-Generator: CA X-Sender-IP: 182.195.42.142 X-Local-Sender: =?UTF-8?B?7LWc7LCs7JqwG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbU2VuaW9yIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?Q2hhbndvbyBDaG9pG1RpemVuIFBsYXRmb3JtIExhYi4bU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtTZW5pb3IgRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG1RFTEUbQzEwVjgxMTE=?= CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20171019095315epcas1p1da40aef7397c561c5fe970309a97b762 X-RootMTR: 20171019095315epcas1p1da40aef7397c561c5fe970309a97b762 References: <1508406773-887-1-git-send-email-raveendra.padasalagi@broadcom.com> <1508406773-887-2-git-send-email-raveendra.padasalagi@broadcom.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2017년 10월 19일 18:52, Raveendra Padasalagi wrote: > Add changes to capture optional dt attribute "input-debounce" > provided in extcon node and used the same value if provided otherwise > default value of 20000 usecs is used for id and vbus gpios debounce time. > > Signed-off-by: Raveendra Padasalagi > Reviewed-by: Ray Jui > Reviewed-by: Srinath Mannam > --- > > Changes in v3: > - Changed USB_GPIO_DEBOUNCE_MS to USB_GPIO_DEBOUNCE_USEC > - Changed msecs_to_jiffies() to usecs_to_jiffies() > > Changes in v2: > Rename gpio_debounce_timeout_ms to debounce_usecs > > drivers/extcon/extcon-usb-gpio.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) Looks good to me. Acked-by: Chanwoo Choi After completing the review of patch1 from DT maintainer, I'll merge these patch sets. > > diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c > index 9c925b0..69149e2 100644 > --- a/drivers/extcon/extcon-usb-gpio.c > +++ b/drivers/extcon/extcon-usb-gpio.c > @@ -28,7 +28,7 @@ > #include > #include > > -#define USB_GPIO_DEBOUNCE_MS 20 /* ms */ > +#define USB_GPIO_DEBOUNCE_USEC 20000 /* us */ > > struct usb_extcon_info { > struct device *dev; > @@ -41,6 +41,7 @@ struct usb_extcon_info { > > unsigned long debounce_jiffies; > struct delayed_work wq_detcable; > + unsigned int debounce_usecs; > }; > > static const unsigned int usb_extcon_cable[] = { > @@ -133,6 +134,11 @@ static int usb_extcon_probe(struct platform_device *pdev) > if (IS_ERR(info->vbus_gpiod)) > return PTR_ERR(info->vbus_gpiod); > > + ret = of_property_read_u32(np, "input-debounce", > + &info->debounce_usecs); > + if (ret) > + info->debounce_usecs = USB_GPIO_DEBOUNCE_USEC; > + > info->edev = devm_extcon_dev_allocate(dev, usb_extcon_cable); > if (IS_ERR(info->edev)) { > dev_err(dev, "failed to allocate extcon device\n"); > @@ -147,13 +153,13 @@ static int usb_extcon_probe(struct platform_device *pdev) > > if (info->id_gpiod) > ret = gpiod_set_debounce(info->id_gpiod, > - USB_GPIO_DEBOUNCE_MS * 1000); > + info->debounce_usecs); > if (!ret && info->vbus_gpiod) > ret = gpiod_set_debounce(info->vbus_gpiod, > - USB_GPIO_DEBOUNCE_MS * 1000); > + info->debounce_usecs); > > if (ret < 0) > - info->debounce_jiffies = msecs_to_jiffies(USB_GPIO_DEBOUNCE_MS); > + info->debounce_jiffies = usecs_to_jiffies(info->debounce_usecs); > > INIT_DELAYED_WORK(&info->wq_detcable, usb_extcon_detect_cable); > > -- Best Regards, Chanwoo Choi Samsung Electronics