Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10056238rwp; Thu, 20 Jul 2023 13:59:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlGjxEjcmdR97wGvHfH98u6fbYR3x41xPgDCF+jucM6FqEphC/TitEzGF0Be39THxBRYWnqg X-Received: by 2002:a05:6358:318a:b0:12f:2563:292c with SMTP id q10-20020a056358318a00b0012f2563292cmr3413873rwd.27.1689886741210; Thu, 20 Jul 2023 13:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689886741; cv=none; d=google.com; s=arc-20160816; b=FUPkckdEfrHnYX8SSG6Vm/0VVuwirvk/2vzOdO+IXTL4nO/b70S0bqrOiD95N7qaLi 24l9YaKkyAn+bTdCeQgU2QnXC0ayjV7vdtqFGHn3qk4BIZjlp5JhxfzrpVp8Pm+bjUUn vIB1zyN2o6vQdeDnPRLb0CJvbJHFT8E6YCg2URyyABHuWtXrY9z2YSSe/TmPP/pXKDQc QaWFhqzvf3wbaWUVQvveOwjT13z+X25ANxpwQao7ELzgFL+UOE721byt1fNxGZh0AdKO SyABPX9TnkcOZShLN5tXA6eYjVdQ7Q6WgnDBuiBKeOSZ1CG2au0+eMRvJO6jJN3P8vM3 VWCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from; bh=5TerCPqM/p1v6KnvFhEJPs+U2Im1oWZWGMY400H1LfE=; fh=SnIkWpyk3JHyy9w78KiFmetjL07+6qEsDaECxbDjCSw=; b=QCL/QxwPxezTvd+nW6qljaFgO2gQEZnAxkM6MpE6/UPfLJMuIQWRF7W4XAMSQ9UJyK /i/XtqMaZYdlt02RCPxhi4G/HDhlJ9iE0hU4+m4OInlNSsYvRy5TrHBcVmm2oCzE8d/B rtt7ec1PU7V2XmwFY/dHml0FLl8XBw2Toxy9aXfbOOH8V5swdqVcyLYzuietSaDYQNbv yvV4kzS4oUQh1ELuVWkfeqmABCptwdjNSaOsb41jBzVZ0Gk+pgroNsYBXNA9kh/qg6qs HT3/uMwnj9WBUnVv6CtfvaTvcwXe4D8Rw3O2sWXmlaPkSmvzm9oM3kkaoC/zJJfUArbN fPuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k184-20020a6384c1000000b0055b7661cd21si1505002pgd.376.2023.07.20.13.58.49; Thu, 20 Jul 2023 13:59:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229663AbjGTUKf (ORCPT + 99 others); Thu, 20 Jul 2023 16:10:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjGTUKd (ORCPT ); Thu, 20 Jul 2023 16:10:33 -0400 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2901526AC for ; Thu, 20 Jul 2023 13:10:29 -0700 (PDT) Received: from localhost (88-113-24-87.elisa-laajakaista.fi [88.113.24.87]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 73e5902b-2739-11ee-b972-005056bdfda7; Thu, 20 Jul 2023 23:10:20 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Thu, 20 Jul 2023 23:10:20 +0300 To: Naresh Solanki Cc: Patrick Rudolph , Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] pinctrl: cy8c95x0: Add reset support Message-ID: References: <20230714081902.2621771-1-Naresh.Solanki@9elements.com> <20230714081902.2621771-2-Naresh.Solanki@9elements.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230714081902.2621771-2-Naresh.Solanki@9elements.com> X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fri, Jul 14, 2023 at 10:19:01AM +0200, Naresh Solanki kirjoitti: > From: Patrick Rudolph > > This patch adds support for an optional "reset" GPIO pin in the cy8c95x0 Find "This patch" in the Submitting Patches documentation and modify this accordingly. > pinctrl driver. On probe, the reset pin is pulled low to bring chip out > of reset. The reset pin has an internal pull-down and can be left > floating if not required. > > The datasheet doesn't mention any timing related to the reset pin. > > Based on empirical tests, it was found that the chip requires a > delay of 250 milliseconds before accepting I2C transfers after driving > the reset pin low. Therefore, a delay of 250ms is added before > proceeding with I2C transfers. ... > + /* bring the chip out of reset if reset pin is provided */ > + chip->gpio_reset = devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_HIGH); &client->dev > + if (IS_ERR(chip->gpio_reset)) { > + ret = dev_err_probe(chip->dev, PTR_ERR(chip->gpio_reset), chip->dev Why inconsistent? > + "Failed to get GPIO 'reset'\n"); > + goto err_exit; I haven't looked at the context, but this seems like a smoke, we usually don't have such in devm-enabled drivers. > + } else if (chip->gpio_reset) { > + usleep_range(1000, 2000); > + gpiod_set_value_cansleep(chip->gpio_reset, 0); > + usleep_range(250000, 300000); This is incorrect use of usleep_range(). Please, read documentation Documentation/timers/timers-howto.rst on the topic. The fix can be switching to fsleep() in both branches. > + gpiod_set_consumer_name(chip->gpio_reset, "CY8C95X0 RESET"); This can be done uncoditionally before toggling the reset. > + } ... This change wasn't Cc'ed to me, however I was contributing a lot into this driver. I would recommend to use my "smart" script [1] to send patches. It has some heuristics which works well in 98% of the cases for me. [1]: https://github.com/andy-shev/home-bin-tools/blob/master/ge2maintainer.sh -- With Best Regards, Andy Shevchenko