From: Michael Ellerman <mpe@ellerman.id.au>
To: <linuxppc-dev@lists.ozlabs.org>
Cc: <linux-kernel@vger.kernel.org>, <geert@linux-m68k.org>, <arnd@arndb.de>
Subject: [RFC PATCH 09/10] i2c: Remove I2C_HYDRA
Date: Fri, 15 Nov 2024 00:11:12 +1100 [thread overview]
Message-ID: <20241114131114.602234-9-mpe@ellerman.id.au> (raw)
In-Reply-To: <20241114131114.602234-1-mpe@ellerman.id.au>
The i2c-hydra driver depends on PPC_CHRP which has now been removed,
remove the driver also.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
drivers/i2c/busses/Kconfig | 12 ---
drivers/i2c/busses/Makefile | 1 -
drivers/i2c/busses/i2c-hydra.c | 150 ---------------------------------
3 files changed, 163 deletions(-)
delete mode 100644 drivers/i2c/busses/i2c-hydra.c
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 6b3ba7e5723a..cbd072955e45 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -373,18 +373,6 @@ endif # ACPI
comment "Mac SMBus host controller drivers"
depends on PPC_CHRP || PPC_PMAC
-config I2C_HYDRA
- tristate "CHRP Apple Hydra Mac I/O I2C interface"
- depends on PCI && PPC_CHRP
- select I2C_ALGOBIT
- help
- This supports the use of the I2C interface in the Apple Hydra Mac
- I/O chip on some CHRP machines (e.g. the LongTrail). Say Y if you
- have such a machine.
-
- This support is also available as a module. If so, the module
- will be called i2c-hydra.
-
config I2C_POWERMAC
tristate "Powermac I2C interface"
depends on PPC_PMAC
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index ecc07c50f2a0..ab366ce6f15c 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -32,7 +32,6 @@ obj-$(CONFIG_I2C_VIAPRO) += i2c-viapro.o
obj-$(CONFIG_I2C_ZHAOXIN) += i2c-viai2c-zhaoxin.o i2c-viai2c-common.o
# Mac SMBus host controller drivers
-obj-$(CONFIG_I2C_HYDRA) += i2c-hydra.o
obj-$(CONFIG_I2C_POWERMAC) += i2c-powermac.o
# Embedded system I2C/SMBus host controller drivers
diff --git a/drivers/i2c/busses/i2c-hydra.c b/drivers/i2c/busses/i2c-hydra.c
deleted file mode 100644
index c60b73e933cf..000000000000
--- a/drivers/i2c/busses/i2c-hydra.c
+++ /dev/null
@@ -1,150 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- i2c Support for the Apple `Hydra' Mac I/O
-
- Copyright (c) 1999-2004 Geert Uytterhoeven <geert@linux-m68k.org>
-
- Based on i2c Support for Via Technologies 82C586B South Bridge
- Copyright (c) 1998, 1999 Kyösti Mälkki <kmalkki@cc.hut.fi>
-
-*/
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/pci.h>
-#include <linux/types.h>
-#include <linux/i2c.h>
-#include <linux/i2c-algo-bit.h>
-#include <linux/io.h>
-#include <asm/hydra.h>
-
-
-#define HYDRA_CPD_PD0 0x00000001 /* CachePD lines */
-#define HYDRA_CPD_PD1 0x00000002
-#define HYDRA_CPD_PD2 0x00000004
-#define HYDRA_CPD_PD3 0x00000008
-
-#define HYDRA_SCLK HYDRA_CPD_PD0
-#define HYDRA_SDAT HYDRA_CPD_PD1
-#define HYDRA_SCLK_OE 0x00000010
-#define HYDRA_SDAT_OE 0x00000020
-
-static inline void pdregw(void *data, u32 val)
-{
- struct Hydra *hydra = (struct Hydra *)data;
- writel(val, &hydra->CachePD);
-}
-
-static inline u32 pdregr(void *data)
-{
- struct Hydra *hydra = (struct Hydra *)data;
- return readl(&hydra->CachePD);
-}
-
-static void hydra_bit_setscl(void *data, int state)
-{
- u32 val = pdregr(data);
- if (state)
- val &= ~HYDRA_SCLK_OE;
- else {
- val &= ~HYDRA_SCLK;
- val |= HYDRA_SCLK_OE;
- }
- pdregw(data, val);
-}
-
-static void hydra_bit_setsda(void *data, int state)
-{
- u32 val = pdregr(data);
- if (state)
- val &= ~HYDRA_SDAT_OE;
- else {
- val &= ~HYDRA_SDAT;
- val |= HYDRA_SDAT_OE;
- }
- pdregw(data, val);
-}
-
-static int hydra_bit_getscl(void *data)
-{
- return (pdregr(data) & HYDRA_SCLK) != 0;
-}
-
-static int hydra_bit_getsda(void *data)
-{
- return (pdregr(data) & HYDRA_SDAT) != 0;
-}
-
-/* ------------------------------------------------------------------------ */
-
-static struct i2c_algo_bit_data hydra_bit_data = {
- .setsda = hydra_bit_setsda,
- .setscl = hydra_bit_setscl,
- .getsda = hydra_bit_getsda,
- .getscl = hydra_bit_getscl,
- .udelay = 5,
- .timeout = HZ
-};
-
-static struct i2c_adapter hydra_adap = {
- .owner = THIS_MODULE,
- .name = "Hydra i2c",
- .algo_data = &hydra_bit_data,
-};
-
-static const struct pci_device_id hydra_ids[] = {
- { PCI_DEVICE(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_HYDRA) },
- { 0, }
-};
-
-MODULE_DEVICE_TABLE (pci, hydra_ids);
-
-static int hydra_probe(struct pci_dev *dev,
- const struct pci_device_id *id)
-{
- unsigned long base = pci_resource_start(dev, 0);
- int res;
-
- if (!request_mem_region(base+offsetof(struct Hydra, CachePD), 4,
- hydra_adap.name))
- return -EBUSY;
-
- hydra_bit_data.data = pci_ioremap_bar(dev, 0);
- if (hydra_bit_data.data == NULL) {
- release_mem_region(base+offsetof(struct Hydra, CachePD), 4);
- return -ENODEV;
- }
-
- pdregw(hydra_bit_data.data, 0); /* clear SCLK_OE and SDAT_OE */
- hydra_adap.dev.parent = &dev->dev;
- res = i2c_bit_add_bus(&hydra_adap);
- if (res < 0) {
- iounmap(hydra_bit_data.data);
- release_mem_region(base+offsetof(struct Hydra, CachePD), 4);
- return res;
- }
- return 0;
-}
-
-static void hydra_remove(struct pci_dev *dev)
-{
- pdregw(hydra_bit_data.data, 0); /* clear SCLK_OE and SDAT_OE */
- i2c_del_adapter(&hydra_adap);
- iounmap(hydra_bit_data.data);
- release_mem_region(pci_resource_start(dev, 0)+
- offsetof(struct Hydra, CachePD), 4);
-}
-
-
-static struct pci_driver hydra_driver = {
- .name = "hydra_smbus",
- .id_table = hydra_ids,
- .probe = hydra_probe,
- .remove = hydra_remove,
-};
-
-module_pci_driver(hydra_driver);
-
-MODULE_AUTHOR("Geert Uytterhoeven <geert@linux-m68k.org>");
-MODULE_DESCRIPTION("i2c for Apple Hydra Mac I/O");
-MODULE_LICENSE("GPL");
--
2.47.0
next prev parent reply other threads:[~2024-11-14 13:11 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-14 13:11 [RFC PATCH 01/10] powerpc/chrp: Remove CHRP support Michael Ellerman
2024-11-14 13:11 ` [RFC PATCH 02/10] powerpc/chrp: Remove various dead code Michael Ellerman
2024-11-16 16:15 ` Christophe Leroy
2024-11-19 3:27 ` Michael Ellerman
2024-11-14 13:11 ` [RFC PATCH 03/10] powerpc/chrp: Remove PPC_CHRP from defconfigs Michael Ellerman
2024-11-14 13:11 ` [RFC PATCH 04/10] powerpc/powermac: Remove machine_is(chrp) test Michael Ellerman
2024-11-14 13:11 ` [RFC PATCH 05/10] powerpc/rtasd: Remove machine_is(chrp) tests Michael Ellerman
2024-11-14 13:11 ` [RFC PATCH 06/10] powerpc: Remove prom_init longtrail work arounds Michael Ellerman
2024-11-14 14:33 ` Geert Uytterhoeven
2024-11-14 13:11 ` [RFC PATCH 07/10] powerpc: Remove CONFIG_ISA Michael Ellerman
2024-11-14 14:34 ` Geert Uytterhoeven
2024-11-14 13:11 ` [RFC PATCH 08/10] macintosh: Remove ADB_MACIO Michael Ellerman
2024-11-14 14:35 ` Geert Uytterhoeven
2024-11-14 15:42 ` Arnd Bergmann
2024-11-14 16:35 ` Geert Uytterhoeven
2024-11-16 16:00 ` Christophe Leroy
2024-11-17 11:29 ` Michael Ellerman
2024-11-14 13:11 ` Michael Ellerman [this message]
2024-11-14 14:37 ` [RFC PATCH 09/10] i2c: Remove I2C_HYDRA Geert Uytterhoeven
2024-11-14 14:57 ` Wolfram Sang
2024-11-14 14:47 ` Geert Uytterhoeven
2024-11-19 23:11 ` Michael Ellerman
2024-11-14 13:11 ` [RFC PATCH 10/10] i2c: Drop reference to PPC_CHRP Michael Ellerman
2024-11-14 14:31 ` [RFC PATCH 01/10] powerpc/chrp: Remove CHRP support Geert Uytterhoeven
2024-11-14 15:43 ` Arnd Bergmann
2024-11-14 21:04 ` Segher Boessenkool
2024-11-26 3:49 ` Michael Ellerman
2024-11-27 20:10 ` Segher Boessenkool
2024-11-17 20:36 ` Gerhard Pircher
2024-11-18 6:07 ` Michael Ellerman
2024-11-21 8:41 ` John Paul Adrian Glaubitz
2024-11-22 18:31 ` Segher Boessenkool
2024-11-21 8:38 ` John Paul Adrian Glaubitz
2024-11-26 3:27 ` Michael Ellerman
2024-11-26 13:27 ` John Paul Adrian Glaubitz
2024-12-12 9:50 ` John Paul Adrian Glaubitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241114131114.602234-9-mpe@ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=arnd@arndb.de \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®