Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2178511pxb; Mon, 11 Jan 2021 03:07:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJ1rcvV8KIzG2QwGlx1kBcFT64Bh+IHzr9hjoAGS/0BStYtdnNlKyxJQ8XJpVqp8XiUDxJ X-Received: by 2002:a05:6402:17cb:: with SMTP id s11mr13317298edy.119.1610363246736; Mon, 11 Jan 2021 03:07:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610363246; cv=none; d=google.com; s=arc-20160816; b=k0LYw/b6mu57zFN2r2cOd54M+D7dWjIT1CDKrwRxmmvwhYQFQ704F8plI47At/RYda DZfJmGYA/93bXGC6RD1w6jFEcPwyeJLr1KN3MfCiIWDctLb8t79Il4gXmWZeIO91ViVq DNQ2ILvYYfs+S/AFRXSk4uNSLM2pM6L7aW9OUzg99200+96CyabBn7oi6OWppzowGY6Z nirndT6sO4yhVivGKG8tGrg2M3QkCjt8bSH3h7G+E3l7sdtexWCYjgttkU9QzMp6US25 UfkTT361Goggrm0GN1Ty0YzDxbtS4u4IdKkgxKwG4/+JDNpeuuBlj100ITnNGsgsjIkT BW+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=L+GBxSxQTI4Xb+fBuV7rsaceskolDWPmYIZDlSCrKEA=; b=mep0IoAb9akHg8MjZBQiDdl9UcAJ0UusluGfiMRVFfJ4Sj8n0eiDmq5A09JddIk/0k Ehr0b+PBotFbuvoacgDoAWwF3wkFjxr3IYpRS1Ei8quycw92H2Xa0IrB5XVtktUw3nMA aybSSSNh3v1He9W3bGUl+4bMgURSaMPy3/ywX2ltlARbENQfQuuxoB8SlQhvzvFjKN/v 7sH1lDdGZoJVQ9JBJA1Y42BU73VGERNENMeSaXDy/6uu6LrAqleTnw6Sd6TXfqZu/w78 Xv4/5ajDgimrQ6VkOW3x8NlGB7/7baogqfYxJIcXH/ud7mY9EglcdvVpebNeNuinwfZs 02kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=Sb6+uLCn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g10si6636699ejf.698.2021.01.11.03.07.02; Mon, 11 Jan 2021 03:07:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=Sb6+uLCn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729553AbhAKLFD (ORCPT + 99 others); Mon, 11 Jan 2021 06:05:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728387AbhAKLFD (ORCPT ); Mon, 11 Jan 2021 06:05:03 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB1A5C061786; Mon, 11 Jan 2021 03:04:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=L+GBxSxQTI4Xb+fBuV7rsaceskolDWPmYIZDlSCrKEA=; b=Sb6+uLCnIDe9NNSGTDhKzutUR 3XCa5whm7rOxRR2NqRXfjjnuMhKhz2ginjFbvJi/KOEwMYKQnkby0iYFFyVCayFxgrXbSoMdYUeV6 tmD562vzE6D9MZp/yRnWkbzGbjHzv90Haeejy9+IRa/plE6JHMM7ZFF7ExcVtAr+Pa/F1de836+79 2pLD9tOzsHgdMbVvoxq9jydHrE/N3CMs96arbO/hEI0LLvSbHSMhJX65fS+I35XiZO05y4XTGbXFj EsUTwkmUBuZ1zWjWu8C6OUA5u/gmQ7cssfqiftQLA1J3MD2cLhpgj+7yRoxjWQSBEQ0wugwRfKcO8 TB485TmFg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:46558) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kyuzb-0006rM-1o; Mon, 11 Jan 2021 11:04:11 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1kyuzX-0005At-T2; Mon, 11 Jan 2021 11:04:07 +0000 Date: Mon, 11 Jan 2021 11:04:07 +0000 From: Russell King - ARM Linux admin To: DENG Qingfang Cc: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Rob Herring , Matthias Brugger , Sean Wang , Landen Chao , Philipp Zabel , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, =?iso-8859-1?Q?Ren=E9?= van Dorst , Frank Wunderlich Subject: Re: [PATCH net-next 2/2] drivers: net: dsa: mt7530: MT7530 optional GPIO support Message-ID: <20210111110407.GR1551@shell.armlinux.org.uk> References: <20210111054428.3273-1-dqfext@gmail.com> <20210111054428.3273-3-dqfext@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210111054428.3273-3-dqfext@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King - ARM Linux admin Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 11, 2021 at 01:44:28PM +0800, DENG Qingfang wrote: > +static int > +mt7530_gpio_direction_output(struct gpio_chip *gc, unsigned int offset, int value) > +{ > + struct mt7530_priv *priv = gpiochip_get_data(gc); > + u32 bit = mt7530_gpio_to_bit(offset); > + > + mt7530_set(priv, MT7530_LED_GPIO_DIR, bit); > + mt7530_set(priv, MT7530_LED_GPIO_OE, bit); > + mt7530_gpio_set(gc, offset, value); FYI, Documentation/driver-api/gpio/consumer.rst says: For output GPIOs, the value provided becomes the initial output value. This helps avoid signal glitching during system startup. Setting the pin to be an output, and then setting its initial value does not avoid the glitch. You may wish to investigate whether you can set the value before setting the pin as an output to avoid this issue. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!