2022-05-24 13:53:29

by Viktor Barna

[permalink] [raw]
Subject: [RFC v2 67/96] cl8k: add rfic.h

From: Viktor Barna <[email protected]>

(Part of the split. Please, take a look at the cover letter for more
details).

Signed-off-by: Viktor Barna <[email protected]>
---
drivers/net/wireless/celeno/cl8k/rfic.h | 29 +++++++++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100644 drivers/net/wireless/celeno/cl8k/rfic.h

diff --git a/drivers/net/wireless/celeno/cl8k/rfic.h b/drivers/net/wireless/celeno/cl8k/rfic.h
new file mode 100644
index 000000000000..686ebd6fcd98
--- /dev/null
+++ b/drivers/net/wireless/celeno/cl8k/rfic.h
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
+/* Copyright(c) 2019-2022, Celeno Communications Ltd. */
+
+#ifndef CL_RFIC_H
+#define CL_RFIC_H
+
+#include "hw.h"
+
+#define ATHOS_A_VER 0xB1
+#define ATHOS_B_VER 0xB2
+
+enum cl_rf_overwrite_cmd {
+ OVERWRITE_DONE,
+ SPI_RD_CMD,
+ SPI_WR_CMD,
+ GCU_WR_CMD,
+ RIU_WR_CMD,
+ UDELAY_CMD,
+ GEN_WR_CMD,
+ RF_OVERWRITE_CMD_MAX = OVERWRITE_DONE
+};
+
+int cl_spi_driver_read_byte(struct cl_hw *cl_hw, u8 page, u8 addr, u8 *val);
+int cl_spi_read(struct cl_hw *cl_hw, u8 page, u8 addr, u8 *val);
+int cl_rfic_read_overwrite_file(struct cl_hw *cl_hw,
+ struct cl_rf_reg_overwrite_info *info,
+ bool init);
+void cl_chip_set_rfic_version(struct cl_hw *cl_hw);
+#endif /* CL_RFIC_H */
--
2.36.1



2022-06-03 17:44:07

by Jeff Johnson

[permalink] [raw]
Subject: Re: [RFC v2 67/96] cl8k: add rfic.h

On 5/24/2022 4:34 AM, [email protected] wrote:
> From: Viktor Barna <[email protected]>
>
> (Part of the split. Please, take a look at the cover letter for more
> details).
>
> Signed-off-by: Viktor Barna <[email protected]>
> ---
> drivers/net/wireless/celeno/cl8k/rfic.h | 29 +++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
> create mode 100644 drivers/net/wireless/celeno/cl8k/rfic.h
>
> diff --git a/drivers/net/wireless/celeno/cl8k/rfic.h b/drivers/net/wireless/celeno/cl8k/rfic.h
> new file mode 100644
> index 000000000000..686ebd6fcd98
> --- /dev/null
> +++ b/drivers/net/wireless/celeno/cl8k/rfic.h
> @@ -0,0 +1,29 @@
> +/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
> +/* Copyright(c) 2019-2022, Celeno Communications Ltd. */
> +
> +#ifndef CL_RFIC_H
> +#define CL_RFIC_H
> +
> +#include "hw.h"
> +
> +#define ATHOS_A_VER 0xB1
> +#define ATHOS_B_VER 0xB2
> +
> +enum cl_rf_overwrite_cmd {
> + OVERWRITE_DONE,
> + SPI_RD_CMD,
> + SPI_WR_CMD,
> + GCU_WR_CMD,
> + RIU_WR_CMD,
> + UDELAY_CMD,
> + GEN_WR_CMD,
> + RF_OVERWRITE_CMD_MAX = OVERWRITE_DONE

consider adding CL_ prefix to the enumerators to avoid namespace collision.

why is OVERWRITE_DONE the max command? that doesn't seem to make sense
since other enumerators are defined after it.

> +};
> +
> +int cl_spi_driver_read_byte(struct cl_hw *cl_hw, u8 page, u8 addr, u8 *val);
> +int cl_spi_read(struct cl_hw *cl_hw, u8 page, u8 addr, u8 *val);
> +int cl_rfic_read_overwrite_file(struct cl_hw *cl_hw,
> + struct cl_rf_reg_overwrite_info *info,
> + bool init);
> +void cl_chip_set_rfic_version(struct cl_hw *cl_hw);
> +#endif /* CL_RFIC_H */

2022-07-11 23:31:07

by Viktor Barna

[permalink] [raw]
Subject: Re: [RFC v2 67/96] cl8k: add rfic.h

On Thu, 2 Jun 2022 13:40:23 -0700, [email protected] wrote:
> consider adding CL_ prefix to the enumerators to avoid namespace collision.

Yes, thanks.

> why is OVERWRITE_DONE the max command? that doesn't seem to make sense
> since other enumerators are defined after it.

Agree, that is an odd place. We likely will remove that in the next version of
the code.

Best regards,
Viktor Barna