Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2033676ybb; Sat, 11 Apr 2020 18:37:07 -0700 (PDT) X-Google-Smtp-Source: APiQypKRQQNzitDRSfFIDQPCFb1YapxjR3td/cy0VOMyTE7zaAkAYU6bKkIXKgrBcKHt+moG7m4m X-Received: by 2002:a05:620a:2016:: with SMTP id c22mr10291297qka.334.1586655427800; Sat, 11 Apr 2020 18:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586655427; cv=none; d=google.com; s=arc-20160816; b=EQmWFvSscGG5JeDBtOPHo2lXV+tfF0+zkCtmEvoGpI9S7jn6Q3hPGryieSfzEeXC89 l66zQzAhroI0uk/FYNjwDcOEq5OZ1oYuBcNhVbkdLN1fJeb+iqRbMB4989Sq7g8kiMrS nnkbEztvF7dTOVccR8NyXSSUQ48vVxmw2gJnEqQVGiSCNAvdHwiZypeJ3EZ+3gD5qw75 8+HnPvHNcG4fazMqlDa9lz7IwkI/Vjfqb/NjSWfF7H3hZdR3paHKUB9STXtHJZKdFE+O GusWusuATgqRm6hbhY6bccFv/lJO3sPvwzgZO1zFt0WSWMHknpfhogCiL59ehnI6J2bw reOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=J22mB3NQXWC/CST6MY0ECTvn5DksxAQMXIJYanPvBBM=; b=h5gWLjG00E9glbBVQJ1CffDgcB/J+2eXaLt3SJQGXLDBBoDazRj1AH99Jwq+buIxn9 328F2I4rAIoIj3TpVFPJw9sj+G0meQ6yNTSw832WIlocv9oZ38jM+46qpunTl8U14M36 P3pQ+syoY/9zFc98oT0ympXmt5rGIdBlXX2R25Y6rxM5B8XoGpNy8daEu1s+EiRR6OK4 a/L/14j2asFN34Hs3tT+CzW0DdO+e0mo4ZTUdtvbKO6ICfV9gYbMv417aXbPTSwj/08C 57Ub+upwKdK5eSU/Bkj3mhiFR+WZHERGEJS9O2Pl14T+MwB2f1j4CK3Uf3ZFUrgt/I1Y iVSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eB2mHLKx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si3504844qtd.41.2020.04.11.18.36.53; Sat, 11 Apr 2020 18:37:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eB2mHLKx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbgDLBeC (ORCPT + 99 others); Sat, 11 Apr 2020 21:34:02 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:43284 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726155AbgDLBeC (ORCPT ); Sat, 11 Apr 2020 21:34:02 -0400 Received: by mail-qt1-f195.google.com with SMTP id z90so4585529qtd.10; Sat, 11 Apr 2020 18:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J22mB3NQXWC/CST6MY0ECTvn5DksxAQMXIJYanPvBBM=; b=eB2mHLKxf3oeEvkGJbhlLEyFKxlCPsZXzd2uBK0OA9ZINs+MSzb/oSX+VjeD3Vyf0i EgkoLIXo08RM21vB+qTqS6gEIF2UnoXURiwbyGnOsX/JGitRes9Y5UnhMZ5D1S4ELa8P lnXYWeWxX6L0JtibzGU8hRR7wuWW8SXp/tuTZ8wKaCLaeNHqpJ0+Vi022TQ9Z6OlSjZf eTyouX1ArE25fIMFa2qGH6VOTvBl8jce/avfwr68YaY+sNVtQ1PK+ysc/fWUeYYlu6AB +EU3PZcZa/4PHvLjs1zdwhtkPBM7HtilPyBc+RNq8hQKxPDd5osHbXpGb5iG4K3/mAkz c9Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J22mB3NQXWC/CST6MY0ECTvn5DksxAQMXIJYanPvBBM=; b=YyZyz2b1O5Eh3woxDOnrLDRfOJSyXNiatqvuqctUCAL8ACwFYqf9Z5jmZGQJHrINjh Mc3ilZM7RkrlObq6Ek0dA/BaT97/Yi9yIts1hI3A8oqz4NJL3IBHVTQWmH90M0TPDc0X sawgXEs9XXNWDDBix+MO6mw8RwoEgCoa8sOTJNgIiyHn1IOYqrE8j+gtrFk7t77MAimY JcBR+1TNJwmLow0RaZVKs9P7jBNboEiYEpjtCRYquDOZRT5mp/7QGC0rd1GYx+BzUwOy bY5nTUyaOfDA76stK/d4B5CNFOSwfj7nae+B02ZRw6Ii+8GBBTQC6QZqg9OXBPo/7HuM QFwQ== X-Gm-Message-State: AGi0PubWam/vAYqRQvJz3m/xQHF/VR1sfRHCutJvOxzavugQhNUi2A6y abB1GQpGeRFcUI7QhfLhZauOL6OMjLw= X-Received: by 2002:ac8:65cc:: with SMTP id t12mr5627735qto.310.1586655241329; Sat, 11 Apr 2020 18:34:01 -0700 (PDT) Received: from localhost.localdomain (c-73-37-219-234.hsd1.mn.comcast.net. [73.37.219.234]) by smtp.gmail.com with ESMTPSA id n92sm4965192qtd.68.2020.04.11.18.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Apr 2020 18:34:00 -0700 (PDT) From: Adam Ford To: linux-gpio@vger.kernel.org Cc: aford@beaconembedded.com, Adam Ford , Linus Walleij , Bartosz Golaszewski , Thomas Petazzoni , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] gpio: pca953x: Fix pca953x_gpio_set_config Date: Sat, 11 Apr 2020 20:33:52 -0500 Message-Id: <20200412013352.674506-2-aford173@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200412013352.674506-1-aford173@gmail.com> References: <20200412013352.674506-1-aford173@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pca953x_gpio_set_config is setup to support pull-up/down bias. Currently the driver uses a variable called 'config' to determine which options to use. Unfortunately, this is incorrect. This patch uses function pinconf_to_config_param(config), which converts this 'config' parameter back to pinconfig to determine which option to use. Fixes: 15add06841a3 ("gpio: pca953x: add ->set_config implementation") Signed-off-by: Adam Ford diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 5638b4e5355f..4269ea9a817e 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -531,7 +531,7 @@ static int pca953x_gpio_set_config(struct gpio_chip *gc, unsigned int offset, { struct pca953x_chip *chip = gpiochip_get_data(gc); - switch (config) { + switch (pinconf_to_config_param(config)) { case PIN_CONFIG_BIAS_PULL_UP: case PIN_CONFIG_BIAS_PULL_DOWN: return pca953x_gpio_set_pull_up_down(chip, offset, config); -- 2.25.1