From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932516AbcDSPPk (ORCPT ); Tue, 19 Apr 2016 11:15:40 -0400 Received: from eusmtp01.atmel.com ([212.144.249.243]:26122 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932106AbcDSPPi (ORCPT ); Tue, 19 Apr 2016 11:15:38 -0400 Subject: Re: [PATCH] pinctrl: at91-pio4: fix pull-up/down logic To: Ludovic Desroches , References: <1461074628-20224-1-git-send-email-ludovic.desroches@atmel.com> CC: , , , From: Nicolas Ferre X-Enigmail-Draft-Status: N1110 Organization: atmel Message-ID: <57164BA9.3040907@atmel.com> Date: Tue, 19 Apr 2016 17:15:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1461074628-20224-1-git-send-email-ludovic.desroches@atmel.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.161.30.18] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 19/04/2016 16:03, Ludovic Desroches a écrit : > The default configuration of a pin is often with a value in the > pull-up/down field at chip reset. So, even if the internal logic of the > controller prevents writing a configuration with pull-up and pull-down at > the same time, we must ensure explicitly this condition before writing the > register. > > This was leading to a pull-down condition not taken into account for > instance. > > Signed-off-by: Ludovic Desroches > Fixes: 776180848b57 ("pinctrl: introduce driver for Atmel PIO4 controller") > Cc: stable@vger.kernel.org #v4.4 and later Yes, and I can add: Acked-by: Nicolas Ferre and more important: On a sama5d2 Xplained board: Tested-by: Nicolas Ferre Thanks, bye. > --- > drivers/pinctrl/pinctrl-at91-pio4.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c > index 629b6fe..75093d7 100644 > --- a/drivers/pinctrl/pinctrl-at91-pio4.c > +++ b/drivers/pinctrl/pinctrl-at91-pio4.c > @@ -722,9 +722,11 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev, > break; > case PIN_CONFIG_BIAS_PULL_UP: > conf |= ATMEL_PIO_PUEN_MASK; > + conf &= (~ATMEL_PIO_PDEN_MASK); > break; > case PIN_CONFIG_BIAS_PULL_DOWN: > conf |= ATMEL_PIO_PDEN_MASK; > + conf &= (~ATMEL_PIO_PUEN_MASK); > break; > case PIN_CONFIG_DRIVE_OPEN_DRAIN: > if (arg == 0) > -- Nicolas Ferre