drm/nouveau/i2c: rename aux.c and aux.h to auxch.c and auxch.h
authorBenjamin Szőke <egyszeregy@freemail.hu>
Mon, 3 Jun 2024 09:15:58 +0000 (11:15 +0200)
committerDanilo Krummrich <dakr@kernel.org>
Thu, 3 Oct 2024 18:05:16 +0000 (20:05 +0200)
The goal is to clean-up Linux repository from AUX file names, because
the use of such file names is prohibited on other operating systems
such as Windows, so the Linux repository cannot be cloned and
edited on them.

Signed-off-by: Benjamin Szőke <egyszeregy@freemail.hu>
Reviewed-by: Ben Skeggs <bskeggs@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240603091558.35672-1-egyszeregy@freemail.hu
13 files changed:
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/anx9805.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h [deleted file]
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgf119.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/padg94.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/padgf119.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/padgm200.c

index 8197039..2c551bd 100644 (file)
@@ -25,7 +25,7 @@ nvkm-y += nvkm/subdev/i2c/busnv50.o
 nvkm-y += nvkm/subdev/i2c/busgf119.o
 nvkm-y += nvkm/subdev/i2c/bit.o
 
-nvkm-y += nvkm/subdev/i2c/aux.o
+nvkm-y += nvkm/subdev/i2c/auxch.o
 nvkm-y += nvkm/subdev/i2c/auxg94.o
 nvkm-y += nvkm/subdev/i2c/auxgf119.o
 nvkm-y += nvkm/subdev/i2c/auxgm200.o
index dd39180..6c76e5e 100644 (file)
@@ -24,7 +24,7 @@
 #define anx9805_pad(p) container_of((p), struct anx9805_pad, base)
 #define anx9805_bus(p) container_of((p), struct anx9805_bus, base)
 #define anx9805_aux(p) container_of((p), struct anx9805_aux, base)
-#include "aux.h"
+#include "auxch.h"
 #include "bus.h"
 
 struct anx9805_pad {
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c
deleted file mode 100644 (file)
index d063d0d..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright 2009 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: Ben Skeggs
- */
-
-#include <linux/string_helpers.h>
-
-#include "aux.h"
-#include "pad.h"
-
-static int
-nvkm_i2c_aux_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
-{
-       struct nvkm_i2c_aux *aux = container_of(adap, typeof(*aux), i2c);
-       struct i2c_msg *msg = msgs;
-       int ret, mcnt = num;
-
-       ret = nvkm_i2c_aux_acquire(aux);
-       if (ret)
-               return ret;
-
-       while (mcnt--) {
-               u8 remaining = msg->len;
-               u8 *ptr = msg->buf;
-
-               while (remaining) {
-                       u8 cnt, retries, cmd;
-
-                       if (msg->flags & I2C_M_RD)
-                               cmd = 1;
-                       else
-                               cmd = 0;
-
-                       if (mcnt || remaining > 16)
-                               cmd |= 4; /* MOT */
-
-                       for (retries = 0, cnt = 0;
-                            retries < 32 && !cnt;
-                            retries++) {
-                               cnt = min_t(u8, remaining, 16);
-                               ret = aux->func->xfer(aux, true, cmd,
-                                                     msg->addr, ptr, &cnt);
-                               if (ret < 0)
-                                       goto out;
-                       }
-                       if (!cnt) {
-                               AUX_TRACE(aux, "no data after 32 retries");
-                               ret = -EIO;
-                               goto out;
-                       }
-
-                       ptr += cnt;
-                       remaining -= cnt;
-               }
-
-               msg++;
-       }
-
-       ret = num;
-out:
-       nvkm_i2c_aux_release(aux);
-       return ret;
-}
-
-static u32
-nvkm_i2c_aux_i2c_func(struct i2c_adapter *adap)
-{
-       return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
-}
-
-static const struct i2c_algorithm
-nvkm_i2c_aux_i2c_algo = {
-       .master_xfer = nvkm_i2c_aux_i2c_xfer,
-       .functionality = nvkm_i2c_aux_i2c_func
-};
-
-void
-nvkm_i2c_aux_monitor(struct nvkm_i2c_aux *aux, bool monitor)
-{
-       struct nvkm_i2c_pad *pad = aux->pad;
-       AUX_TRACE(aux, "monitor: %s", str_yes_no(monitor));
-       if (monitor)
-               nvkm_i2c_pad_mode(pad, NVKM_I2C_PAD_AUX);
-       else
-               nvkm_i2c_pad_mode(pad, NVKM_I2C_PAD_OFF);
-}
-
-void
-nvkm_i2c_aux_release(struct nvkm_i2c_aux *aux)
-{
-       struct nvkm_i2c_pad *pad = aux->pad;
-       AUX_TRACE(aux, "release");
-       nvkm_i2c_pad_release(pad);
-       mutex_unlock(&aux->mutex);
-}
-
-int
-nvkm_i2c_aux_acquire(struct nvkm_i2c_aux *aux)
-{
-       struct nvkm_i2c_pad *pad = aux->pad;
-       int ret;
-
-       AUX_TRACE(aux, "acquire");
-       mutex_lock(&aux->mutex);
-
-       if (aux->enabled)
-               ret = nvkm_i2c_pad_acquire(pad, NVKM_I2C_PAD_AUX);
-       else
-               ret = -EIO;
-
-       if (ret)
-               mutex_unlock(&aux->mutex);
-       return ret;
-}
-
-int
-nvkm_i2c_aux_xfer(struct nvkm_i2c_aux *aux, bool retry, u8 type,
-                 u32 addr, u8 *data, u8 *size)
-{
-       if (!*size && !aux->func->address_only) {
-               AUX_ERR(aux, "address-only transaction dropped");
-               return -ENOSYS;
-       }
-       return aux->func->xfer(aux, retry, type, addr, data, size);
-}
-
-int
-nvkm_i2c_aux_lnk_ctl(struct nvkm_i2c_aux *aux, int nr, int bw, bool ef)
-{
-       if (aux->func->lnk_ctl)
-               return aux->func->lnk_ctl(aux, nr, bw, ef);
-       return -ENODEV;
-}
-
-void
-nvkm_i2c_aux_del(struct nvkm_i2c_aux **paux)
-{
-       struct nvkm_i2c_aux *aux = *paux;
-       if (aux && !WARN_ON(!aux->func)) {
-               AUX_TRACE(aux, "dtor");
-               list_del(&aux->head);
-               i2c_del_adapter(&aux->i2c);
-               kfree(*paux);
-               *paux = NULL;
-       }
-}
-
-void
-nvkm_i2c_aux_init(struct nvkm_i2c_aux *aux)
-{
-       AUX_TRACE(aux, "init");
-       mutex_lock(&aux->mutex);
-       aux->enabled = true;
-       mutex_unlock(&aux->mutex);
-}
-
-void
-nvkm_i2c_aux_fini(struct nvkm_i2c_aux *aux)
-{
-       AUX_TRACE(aux, "fini");
-       mutex_lock(&aux->mutex);
-       aux->enabled = false;
-       mutex_unlock(&aux->mutex);
-}
-
-int
-nvkm_i2c_aux_ctor(const struct nvkm_i2c_aux_func *func,
-                 struct nvkm_i2c_pad *pad, int id,
-                 struct nvkm_i2c_aux *aux)
-{
-       struct nvkm_device *device = pad->i2c->subdev.device;
-
-       aux->func = func;
-       aux->pad = pad;
-       aux->id = id;
-       mutex_init(&aux->mutex);
-       list_add_tail(&aux->head, &pad->i2c->aux);
-       AUX_TRACE(aux, "ctor");
-
-       snprintf(aux->i2c.name, sizeof(aux->i2c.name), "nvkm-%s-aux-%04x",
-                dev_name(device->dev), id);
-       aux->i2c.owner = THIS_MODULE;
-       aux->i2c.dev.parent = device->dev;
-       aux->i2c.algo = &nvkm_i2c_aux_i2c_algo;
-       return i2c_add_adapter(&aux->i2c);
-}
-
-int
-nvkm_i2c_aux_new_(const struct nvkm_i2c_aux_func *func,
-                 struct nvkm_i2c_pad *pad, int id,
-                 struct nvkm_i2c_aux **paux)
-{
-       if (!(*paux = kzalloc(sizeof(**paux), GFP_KERNEL)))
-               return -ENOMEM;
-       return nvkm_i2c_aux_ctor(func, pad, id, *paux);
-}
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h
deleted file mode 100644 (file)
index f920eab..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-#ifndef __NVKM_I2C_AUX_H__
-#define __NVKM_I2C_AUX_H__
-#include "pad.h"
-
-static inline void
-nvkm_i2c_aux_autodpcd(struct nvkm_i2c *i2c, int aux, bool enable)
-{
-       if (i2c->func->aux_autodpcd)
-               i2c->func->aux_autodpcd(i2c, aux, false);
-}
-
-struct nvkm_i2c_aux_func {
-       bool address_only;
-       int  (*xfer)(struct nvkm_i2c_aux *, bool retry, u8 type,
-                    u32 addr, u8 *data, u8 *size);
-       int  (*lnk_ctl)(struct nvkm_i2c_aux *, int link_nr, int link_bw,
-                       bool enhanced_framing);
-};
-
-int nvkm_i2c_aux_ctor(const struct nvkm_i2c_aux_func *, struct nvkm_i2c_pad *,
-                     int id, struct nvkm_i2c_aux *);
-int nvkm_i2c_aux_new_(const struct nvkm_i2c_aux_func *, struct nvkm_i2c_pad *,
-                     int id, struct nvkm_i2c_aux **);
-void nvkm_i2c_aux_del(struct nvkm_i2c_aux **);
-void nvkm_i2c_aux_init(struct nvkm_i2c_aux *);
-void nvkm_i2c_aux_fini(struct nvkm_i2c_aux *);
-int nvkm_i2c_aux_xfer(struct nvkm_i2c_aux *, bool retry, u8 type,
-                     u32 addr, u8 *data, u8 *size);
-
-int g94_i2c_aux_new_(const struct nvkm_i2c_aux_func *, struct nvkm_i2c_pad *,
-                    int, u8, struct nvkm_i2c_aux **);
-
-int g94_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
-int g94_i2c_aux_xfer(struct nvkm_i2c_aux *, bool, u8, u32, u8 *, u8 *);
-int gf119_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
-int gm200_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
-
-#define AUX_MSG(b,l,f,a...) do {                                               \
-       struct nvkm_i2c_aux *_aux = (b);                                       \
-       nvkm_##l(&_aux->pad->i2c->subdev, "aux %04x: "f"\n", _aux->id, ##a);   \
-} while(0)
-#define AUX_ERR(b,f,a...) AUX_MSG((b), error, f, ##a)
-#define AUX_DBG(b,f,a...) AUX_MSG((b), debug, f, ##a)
-#define AUX_TRACE(b,f,a...) AUX_MSG((b), trace, f, ##a)
-#endif
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c
new file mode 100644 (file)
index 0000000..fafc634
--- /dev/null
@@ -0,0 +1,215 @@
+/*
+ * Copyright 2009 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Ben Skeggs
+ */
+
+#include <linux/string_helpers.h>
+
+#include "auxch.h"
+#include "pad.h"
+
+static int
+nvkm_i2c_aux_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+{
+       struct nvkm_i2c_aux *aux = container_of(adap, typeof(*aux), i2c);
+       struct i2c_msg *msg = msgs;
+       int ret, mcnt = num;
+
+       ret = nvkm_i2c_aux_acquire(aux);
+       if (ret)
+               return ret;
+
+       while (mcnt--) {
+               u8 remaining = msg->len;
+               u8 *ptr = msg->buf;
+
+               while (remaining) {
+                       u8 cnt, retries, cmd;
+
+                       if (msg->flags & I2C_M_RD)
+                               cmd = 1;
+                       else
+                               cmd = 0;
+
+                       if (mcnt || remaining > 16)
+                               cmd |= 4; /* MOT */
+
+                       for (retries = 0, cnt = 0;
+                            retries < 32 && !cnt;
+                            retries++) {
+                               cnt = min_t(u8, remaining, 16);
+                               ret = aux->func->xfer(aux, true, cmd,
+                                                     msg->addr, ptr, &cnt);
+                               if (ret < 0)
+                                       goto out;
+                       }
+                       if (!cnt) {
+                               AUX_TRACE(aux, "no data after 32 retries");
+                               ret = -EIO;
+                               goto out;
+                       }
+
+                       ptr += cnt;
+                       remaining -= cnt;
+               }
+
+               msg++;
+       }
+
+       ret = num;
+out:
+       nvkm_i2c_aux_release(aux);
+       return ret;
+}
+
+static u32
+nvkm_i2c_aux_i2c_func(struct i2c_adapter *adap)
+{
+       return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+}
+
+static const struct i2c_algorithm
+nvkm_i2c_aux_i2c_algo = {
+       .master_xfer = nvkm_i2c_aux_i2c_xfer,
+       .functionality = nvkm_i2c_aux_i2c_func
+};
+
+void
+nvkm_i2c_aux_monitor(struct nvkm_i2c_aux *aux, bool monitor)
+{
+       struct nvkm_i2c_pad *pad = aux->pad;
+       AUX_TRACE(aux, "monitor: %s", str_yes_no(monitor));
+       if (monitor)
+               nvkm_i2c_pad_mode(pad, NVKM_I2C_PAD_AUX);
+       else
+               nvkm_i2c_pad_mode(pad, NVKM_I2C_PAD_OFF);
+}
+
+void
+nvkm_i2c_aux_release(struct nvkm_i2c_aux *aux)
+{
+       struct nvkm_i2c_pad *pad = aux->pad;
+       AUX_TRACE(aux, "release");
+       nvkm_i2c_pad_release(pad);
+       mutex_unlock(&aux->mutex);
+}
+
+int
+nvkm_i2c_aux_acquire(struct nvkm_i2c_aux *aux)
+{
+       struct nvkm_i2c_pad *pad = aux->pad;
+       int ret;
+
+       AUX_TRACE(aux, "acquire");
+       mutex_lock(&aux->mutex);
+
+       if (aux->enabled)
+               ret = nvkm_i2c_pad_acquire(pad, NVKM_I2C_PAD_AUX);
+       else
+               ret = -EIO;
+
+       if (ret)
+               mutex_unlock(&aux->mutex);
+       return ret;
+}
+
+int
+nvkm_i2c_aux_xfer(struct nvkm_i2c_aux *aux, bool retry, u8 type,
+                 u32 addr, u8 *data, u8 *size)
+{
+       if (!*size && !aux->func->address_only) {
+               AUX_ERR(aux, "address-only transaction dropped");
+               return -ENOSYS;
+       }
+       return aux->func->xfer(aux, retry, type, addr, data, size);
+}
+
+int
+nvkm_i2c_aux_lnk_ctl(struct nvkm_i2c_aux *aux, int nr, int bw, bool ef)
+{
+       if (aux->func->lnk_ctl)
+               return aux->func->lnk_ctl(aux, nr, bw, ef);
+       return -ENODEV;
+}
+
+void
+nvkm_i2c_aux_del(struct nvkm_i2c_aux **paux)
+{
+       struct nvkm_i2c_aux *aux = *paux;
+       if (aux && !WARN_ON(!aux->func)) {
+               AUX_TRACE(aux, "dtor");
+               list_del(&aux->head);
+               i2c_del_adapter(&aux->i2c);
+               kfree(*paux);
+               *paux = NULL;
+       }
+}
+
+void
+nvkm_i2c_aux_init(struct nvkm_i2c_aux *aux)
+{
+       AUX_TRACE(aux, "init");
+       mutex_lock(&aux->mutex);
+       aux->enabled = true;
+       mutex_unlock(&aux->mutex);
+}
+
+void
+nvkm_i2c_aux_fini(struct nvkm_i2c_aux *aux)
+{
+       AUX_TRACE(aux, "fini");
+       mutex_lock(&aux->mutex);
+       aux->enabled = false;
+       mutex_unlock(&aux->mutex);
+}
+
+int
+nvkm_i2c_aux_ctor(const struct nvkm_i2c_aux_func *func,
+                 struct nvkm_i2c_pad *pad, int id,
+                 struct nvkm_i2c_aux *aux)
+{
+       struct nvkm_device *device = pad->i2c->subdev.device;
+
+       aux->func = func;
+       aux->pad = pad;
+       aux->id = id;
+       mutex_init(&aux->mutex);
+       list_add_tail(&aux->head, &pad->i2c->aux);
+       AUX_TRACE(aux, "ctor");
+
+       snprintf(aux->i2c.name, sizeof(aux->i2c.name), "nvkm-%s-aux-%04x",
+                dev_name(device->dev), id);
+       aux->i2c.owner = THIS_MODULE;
+       aux->i2c.dev.parent = device->dev;
+       aux->i2c.algo = &nvkm_i2c_aux_i2c_algo;
+       return i2c_add_adapter(&aux->i2c);
+}
+
+int
+nvkm_i2c_aux_new_(const struct nvkm_i2c_aux_func *func,
+                 struct nvkm_i2c_pad *pad, int id,
+                 struct nvkm_i2c_aux **paux)
+{
+       if (!(*paux = kzalloc(sizeof(**paux), GFP_KERNEL)))
+               return -ENOMEM;
+       return nvkm_i2c_aux_ctor(func, pad, id, *paux);
+}
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.h b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.h
new file mode 100644 (file)
index 0000000..f920eab
--- /dev/null
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: MIT */
+#ifndef __NVKM_I2C_AUX_H__
+#define __NVKM_I2C_AUX_H__
+#include "pad.h"
+
+static inline void
+nvkm_i2c_aux_autodpcd(struct nvkm_i2c *i2c, int aux, bool enable)
+{
+       if (i2c->func->aux_autodpcd)
+               i2c->func->aux_autodpcd(i2c, aux, false);
+}
+
+struct nvkm_i2c_aux_func {
+       bool address_only;
+       int  (*xfer)(struct nvkm_i2c_aux *, bool retry, u8 type,
+                    u32 addr, u8 *data, u8 *size);
+       int  (*lnk_ctl)(struct nvkm_i2c_aux *, int link_nr, int link_bw,
+                       bool enhanced_framing);
+};
+
+int nvkm_i2c_aux_ctor(const struct nvkm_i2c_aux_func *, struct nvkm_i2c_pad *,
+                     int id, struct nvkm_i2c_aux *);
+int nvkm_i2c_aux_new_(const struct nvkm_i2c_aux_func *, struct nvkm_i2c_pad *,
+                     int id, struct nvkm_i2c_aux **);
+void nvkm_i2c_aux_del(struct nvkm_i2c_aux **);
+void nvkm_i2c_aux_init(struct nvkm_i2c_aux *);
+void nvkm_i2c_aux_fini(struct nvkm_i2c_aux *);
+int nvkm_i2c_aux_xfer(struct nvkm_i2c_aux *, bool retry, u8 type,
+                     u32 addr, u8 *data, u8 *size);
+
+int g94_i2c_aux_new_(const struct nvkm_i2c_aux_func *, struct nvkm_i2c_pad *,
+                    int, u8, struct nvkm_i2c_aux **);
+
+int g94_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
+int g94_i2c_aux_xfer(struct nvkm_i2c_aux *, bool, u8, u32, u8 *, u8 *);
+int gf119_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
+int gm200_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
+
+#define AUX_MSG(b,l,f,a...) do {                                               \
+       struct nvkm_i2c_aux *_aux = (b);                                       \
+       nvkm_##l(&_aux->pad->i2c->subdev, "aux %04x: "f"\n", _aux->id, ##a);   \
+} while(0)
+#define AUX_ERR(b,f,a...) AUX_MSG((b), error, f, ##a)
+#define AUX_DBG(b,f,a...) AUX_MSG((b), debug, f, ##a)
+#define AUX_TRACE(b,f,a...) AUX_MSG((b), trace, f, ##a)
+#endif
index 47068f6..854bb4b 100644 (file)
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs <bskeggs@redhat.com>
  */
 #define g94_i2c_aux(p) container_of((p), struct g94_i2c_aux, base)
-#include "aux.h"
+#include "auxch.h"
 
 struct g94_i2c_aux {
        struct nvkm_i2c_aux base;
index dab40cd..c17d564 100644 (file)
@@ -19,7 +19,7 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  */
-#include "aux.h"
+#include "auxch.h"
 
 static const struct nvkm_i2c_aux_func
 gf119_i2c_aux = {
index 8bd1d44..3c5005e 100644 (file)
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs <bskeggs@redhat.com>
  */
 #define gm200_i2c_aux(p) container_of((p), struct gm200_i2c_aux, base)
-#include "aux.h"
+#include "auxch.h"
 
 struct gm200_i2c_aux {
        struct nvkm_i2c_aux base;
index 731b2f6..7ec17e8 100644 (file)
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 #include "priv.h"
-#include "aux.h"
+#include "auxch.h"
 #include "bus.h"
 #include "pad.h"
 
index 5904bc5..cc26cd6 100644 (file)
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 #include "pad.h"
-#include "aux.h"
+#include "auxch.h"
 #include "bus.h"
 
 void
index 3bc4d03..1797c6c 100644 (file)
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 #include "pad.h"
-#include "aux.h"
+#include "auxch.h"
 #include "bus.h"
 
 static const struct nvkm_i2c_pad_func
index 7d417f6..5afc1bf 100644 (file)
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 #include "pad.h"
-#include "aux.h"
+#include "auxch.h"
 #include "bus.h"
 
 static void