Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 07B60C636D4 for ; Wed, 1 Feb 2023 20:29:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7159F85DF0; Wed, 1 Feb 2023 21:24:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="aRa/otM7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3741185D4B; Wed, 1 Feb 2023 21:23:17 +0100 (CET) Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 79F4085D7B for ; Wed, 1 Feb 2023 21:22:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2b.google.com with SMTP id y2so3847792iot.4 for ; Wed, 01 Feb 2023 12:22:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=L2ZGkL+QLuDan0p/aaB4ls1n0Tp1/ZqjJVYv1wJlCG8=; b=aRa/otM76PFL4ZDeT+gIvK6cn5OhrMneTy5f9CctECsORsd3TuZh3hV2YTNf617Af3 HjmLWOuEMy4DXjYyTYhz2HaJpcKlnZOKLuUWWs0mfOZplwAJpOpp+pk+FlsnuRumNPdZ H9Syg5yFcWLscWQqAkhfuQ0bsEnIBGLCXYTlY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L2ZGkL+QLuDan0p/aaB4ls1n0Tp1/ZqjJVYv1wJlCG8=; b=P2CBiaDtZFNamtNtWIR39CozYbLPTRph5zuXETrrNtxxMGyNLkZbTjdKfc8r5pyW9E ObQi97uhgxDN8V7XLgIjrrhitBtW0X4dg/Te5hkAvI5Hq3JbqBTWkGp0/sSuhX1dc/mq ywlME8+zurdkwY+XZwmcardOcboyIsfW3vo1pRS7v/c3+fv9SsffksfMmzKCdRhgVrum RVAxw4Px6c8dw09jG+AalxMxpLcFXVb+ulai4SgDltFSpOi9pFPhkpU3QEvj/Jy0qdb/ CNrROfRm/cldeyNKluMJyxYXjlmfyFD4HDLTZ3Rvb1GY1aIm3IA6khcDo6NO9EQYE6VO 22JQ== X-Gm-Message-State: AO0yUKW2+ylsAyDu1QxvMvg2i7IbCCCkVoiNehZWzx3gGVpKeNrSSMNJ U2QR15s3bcKFqTKgBBF0/3upsMxJjqYVAaqr X-Google-Smtp-Source: AK7set8lWMdUY3IW6hlBZSTxtieNY+WndxScf25d3kXi4DVpsim28/mFOHWTTzmG1wu5Ju9seu5Pdw== X-Received: by 2002:a05:6602:14d5:b0:6bc:d70f:8b38 with SMTP id b21-20020a05660214d500b006bcd70f8b38mr108193iow.18.1675282920421; Wed, 01 Feb 2023 12:22:00 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:1fda:cca0:9a42:148c]) by smtp.gmail.com with ESMTPSA id i1-20020a6bf401000000b00704608527d1sm6166498iog.37.2023.02.01.12.21.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 12:22:00 -0800 (PST) From: Simon Glass To: u-boot@lists.denx.de Cc: Tom Rini , Simon Glass Subject: [PATCH v3 45/76] gpio: Drop unused pca9698 driver Date: Wed, 1 Feb 2023 13:19:56 -0700 Message-Id: <20230201202027.1943031-46-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog In-Reply-To: <20230201202027.1943031-1-sjg@chromium.org> References: <20230201202027.1943031-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This is not used. Drop the driver and Kconfig option. Signed-off-by: Simon Glass --- (no changes since v1) arch/mips/mach-octeon/octeon_fdt.c | 43 +--------- board/gdsys/a38x/hre.c | 1 - drivers/gpio/Makefile | 1 - drivers/gpio/pca9698.c | 127 ----------------------------- include/pca9698.h | 17 ---- 5 files changed, 1 insertion(+), 188 deletions(-) delete mode 100644 drivers/gpio/pca9698.c delete mode 100644 include/pca9698.h diff --git a/arch/mips/mach-octeon/octeon_fdt.c b/arch/mips/mach-octeon/octeon_fdt.c index 0ccfe149dcc..c74fe9d9fb8 100644 --- a/arch/mips/mach-octeon/octeon_fdt.c +++ b/arch/mips/mach-octeon/octeon_fdt.c @@ -30,9 +30,6 @@ #ifdef CONFIG_PCF857X #include #endif -#ifdef CONFIG_PCA9698 -#include -#endif #ifdef CONFIG_PCA9554 #include #endif @@ -59,13 +56,6 @@ static const char * const pca9555_gpio_list[] = { }; #endif -#ifdef CONFIG_PCA9698 -/** List of compatible strings supported by pca9698 driver */ -static const char * const pca9698_gpio_list[] = { - "nxp,pca9505", "pca9505", "nxp,pca9698", "pca9698", NULL, -}; -#endif - #ifdef CONFIG_PCA953X /** List of compatible strings supported by pca953x driver */ static const char * const pca953x_gpio_list[] = { @@ -807,19 +797,6 @@ int octeon_fdt_read_gpio(const void *fdt, int phandle, int pin) } value = (value >> pin) & 1; break; -#endif -#ifdef CONFIG_PCA9698 - case CVMX_GPIO_PIN_PCA9698: - node = fdt_node_offset_by_phandle(fdt, phandle); - if (octeon_fdt_get_i2c_bus_addr(fdt, node, &bus, &addr)) { - printf("%s: Could not get gpio bus and/or address\n", __func__); - return -1; - } - old_bus = i2c_get_bus_num(); - i2c_set_bus_num(bus); - value = pca9698_get_value(addr, pin); - i2c_set_bus_num(old_bus); - break; #endif case CVMX_GPIO_PIN_OCTEON: value = gpio_get_value(pin); @@ -880,18 +857,6 @@ int octeon_fdt_set_gpio(const void *fdt, int phandle, int pin, int val) return -1; } return pcf957x_set_val(bus, addr, 1 << pin, val << pin); -#endif -#ifdef CONFIG_PCA9698 - case CVMX_GPIO_PIN_PCA9698: - if (octeon_fdt_get_i2c_bus_addr(fdt, node, &bus, &addr)) { - printf("%s: Could not get gpio bus and/or address\n", __func__); - return -1; - } - old_bus = i2c_get_bus_num(); - i2c_set_bus_num(bus); - rc = pca9698_set_value(addr, pin, val); - i2c_set_bus_num(old_bus); - return rc; #endif case CVMX_GPIO_PIN_OCTEON: return gpio_set_value(pin, val); @@ -951,13 +916,7 @@ int octeon_fdt_get_gpio_info(int fdt_node, enum octeon_gpio_type *type, *type = GPIO_TYPE_PCA953X; } #endif -#ifdef CONFIG_PCA9698 - if (!octeon_fdt_node_check_compatible(fdt, fdt_node, pca9698_gpio_list)) { - debug("%s: Found PCA9698 compatible GPIO", __func__); - *type = GPIO_TYPE_PCA9698; - } -#endif -#if defined(CONFIG_PCA953X) || defined(CONFIG_PCA9698) || \ +#if defined(CONFIG_PCA953X) || \ defined(CONFIG_PCA9555) || defined(CONFIG_PCA9554) if (!i2c_addr || !i2c_bus) { printf("%s: Error: i2c_addr or i2c_bus is NULL\n", __func__); diff --git a/board/gdsys/a38x/hre.c b/board/gdsys/a38x/hre.c index 2f16a4d3e11..d16233ed78e 100644 --- a/board/gdsys/a38x/hre.c +++ b/board/gdsys/a38x/hre.c @@ -15,7 +15,6 @@ #include #include #include -#include #include "hre.h" diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index 889a88dc885..fcd136367ac 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -28,7 +28,6 @@ obj-$(CONFIG_MXC_GPIO) += mxc_gpio.o obj-$(CONFIG_MXS_GPIO) += mxs_gpio.o obj-$(CONFIG_NPCM_GPIO) += npcm_gpio.o obj-$(CONFIG_PCA953X) += pca953x.o -obj-$(CONFIG_PCA9698) += pca9698.o obj-$(CONFIG_ROCKCHIP_GPIO) += rk_gpio.o obj-$(CONFIG_RCAR_GPIO) += gpio-rcar.o obj-$(CONFIG_RZA1_GPIO) += gpio-rza1.o diff --git a/drivers/gpio/pca9698.c b/drivers/gpio/pca9698.c deleted file mode 100644 index 11274c78101..00000000000 --- a/drivers/gpio/pca9698.c +++ /dev/null @@ -1,127 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2011 - * Dirk Eibach, Guntermann & Drunck GmbH, dirk.eibach@gdsys.cc - */ - -/* - * Driver for NXP's pca9698 40 bit I2C gpio expander - */ - -#include -#include -#include -#include -#include - -/* - * The pca9698 registers - */ - -#define PCA9698_REG_INPUT 0x00 -#define PCA9698_REG_OUTPUT 0x08 -#define PCA9698_REG_POLARITY 0x10 -#define PCA9698_REG_CONFIG 0x18 - -#define PCA9698_BUFFER_SIZE 5 -#define PCA9698_GPIO_COUNT 40 - -static int pca9698_read40(u8 addr, u8 offset, u8 *buffer) -{ - u8 command = offset | 0x80; /* autoincrement */ - - return i2c_read(addr, command, 1, buffer, PCA9698_BUFFER_SIZE); -} - -static int pca9698_write40(u8 addr, u8 offset, u8 *buffer) -{ - u8 command = offset | 0x80; /* autoincrement */ - - return i2c_write(addr, command, 1, buffer, PCA9698_BUFFER_SIZE); -} - -static void pca9698_set_bit(unsigned gpio, u8 *buffer, unsigned value) -{ - unsigned byte = gpio / 8; - unsigned bit = gpio % 8; - - if (value) - buffer[byte] |= (1 << bit); - else - buffer[byte] &= ~(1 << bit); -} - -int pca9698_request(unsigned gpio, const char *label) -{ - if (gpio >= PCA9698_GPIO_COUNT) - return -EINVAL; - - return 0; -} - -void pca9698_free(unsigned gpio) -{ -} - -int pca9698_direction_input(u8 addr, unsigned gpio) -{ - u8 data[PCA9698_BUFFER_SIZE]; - int res; - - res = pca9698_read40(addr, PCA9698_REG_CONFIG, data); - if (res) - return res; - - pca9698_set_bit(gpio, data, 1); - - return pca9698_write40(addr, PCA9698_REG_CONFIG, data); -} - -int pca9698_direction_output(u8 addr, unsigned gpio, int value) -{ - u8 data[PCA9698_BUFFER_SIZE]; - int res; - - res = pca9698_set_value(addr, gpio, value); - if (res) - return res; - - res = pca9698_read40(addr, PCA9698_REG_CONFIG, data); - if (res) - return res; - - pca9698_set_bit(gpio, data, 0); - - return pca9698_write40(addr, PCA9698_REG_CONFIG, data); -} - -int pca9698_get_value(u8 addr, unsigned gpio) -{ - unsigned config_byte = gpio / 8; - unsigned config_bit = gpio % 8; - unsigned value; - u8 data[PCA9698_BUFFER_SIZE]; - int res; - - res = pca9698_read40(addr, PCA9698_REG_INPUT, data); - if (res) - return -1; - - value = data[config_byte] & (1 << config_bit); - - return !!value; -} - -int pca9698_set_value(u8 addr, unsigned gpio, int value) -{ - u8 data[PCA9698_BUFFER_SIZE]; - int res; - - res = pca9698_read40(addr, PCA9698_REG_OUTPUT, data); - if (res) - return res; - - pca9698_set_bit(gpio, data, value); - - return pca9698_write40(addr, PCA9698_REG_OUTPUT, data); -} diff --git a/include/pca9698.h b/include/pca9698.h deleted file mode 100644 index 48a5f756e28..00000000000 --- a/include/pca9698.h +++ /dev/null @@ -1,17 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * (C) Copyright 2011 - * Dirk Eibach, Guntermann & Drunck GmbH, dirk.eibach@gdsys.cc - */ - -#ifndef __PCA9698_H_ -#define __PCA9698_H_ - -int pca9698_request(unsigned gpio, const char *label); -void pca9698_free(unsigned gpio); -int pca9698_direction_input(u8 addr, unsigned gpio); -int pca9698_direction_output(u8 addr, unsigned gpio, int value); -int pca9698_get_value(u8 addr, unsigned gpio); -int pca9698_set_value(u8 addr, unsigned gpio, int value); - -#endif /* __PCA9698_H_ */ -- 2.39.1.456.gfc5497dd1b-goog