From: Krzysztof Kozlowski <krzk@kernel.org>
To: Michael Nemanov <michael.nemanov@ti.com>,
Kalle Valo <kvalo@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Sabeeh Khan <sabeeh-khan@ti.com>
Subject: Re: [PATCH v4 04/17] wifi: cc33xx: Add sdio.c, io.c, io.h
Date: Tue, 29 Oct 2024 18:34:18 +0100 [thread overview]
Message-ID: <9aff2bed-bca4-482b-83ea-4cd945812817@kernel.org> (raw)
In-Reply-To: <20241029172354.4027886-5-michael.nemanov@ti.com>
On 29/10/2024 18:23, Michael Nemanov wrote:
> sdio.c implements SDIO transport functions. These are bound into
> struct cc33xx_if_operations and accessed via io.h in order to abstract
> multiple transport interfaces such as SPI in the future.
> The CC33xx driver supports the SDIO in-band IRQ option so the IRQ from
> the device received here as well.
> Unlike wl1xxx products, there is no longer mapping between
> HW and SDIO / SPI address space of any kind.
> There are only 3 valid addresses for control, data and status
> transactions each with a predefined structure.
>
> Signed-off-by: Michael Nemanov <michael.nemanov@ti.com>
> ---
> drivers/net/wireless/ti/cc33xx/io.c | 129 +++++++
> drivers/net/wireless/ti/cc33xx/io.h | 26 ++
> drivers/net/wireless/ti/cc33xx/sdio.c | 530 ++++++++++++++++++++++++++
> 3 files changed, 685 insertions(+)
> create mode 100644 drivers/net/wireless/ti/cc33xx/io.c
> create mode 100644 drivers/net/wireless/ti/cc33xx/io.h
> create mode 100644 drivers/net/wireless/ti/cc33xx/sdio.c
>
> diff --git a/drivers/net/wireless/ti/cc33xx/io.c b/drivers/net/wireless/ti/cc33xx/io.c
> new file mode 100644
> index 000000000000..59696004efe9
> --- /dev/null
> +++ b/drivers/net/wireless/ti/cc33xx/io.c
> @@ -0,0 +1,129 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (C) 2022-2024 Texas Instruments Incorporated - https://www.ti.com/
> + */
> +
> +#include "cc33xx.h"
> +#include "debug.h"
> +#include "io.h"
> +#include "tx.h"
> +
> +bool cc33xx_set_block_size(struct cc33xx *cc)
> +{
> + if (cc->if_ops->set_block_size) {
> + cc->if_ops->set_block_size(cc->dev, CC33XX_BUS_BLOCK_SIZE);
> + cc33xx_debug(DEBUG_CC33xx,
> + "Set BLKsize to %d", CC33XX_BUS_BLOCK_SIZE);
> + return true;
> + }
> +
> + cc33xx_debug(DEBUG_CC33xx, "Could not set BLKsize");
> + return false;
> +}
> +
> +void cc33xx_disable_interrupts_nosync(struct cc33xx *cc)
> +{
> + cc->if_ops->disable_irq(cc->dev);
> +}
> +
> +void cc33xx_irq(void *cookie);
Why do you need forward declaration of non-static function? If you need
it, it means you had W=1 warning which you fixed incorrect way.
Regardless, be sure this code has 0 warnings on clang with W=1.
> +void cc33xx_enable_interrupts(struct cc33xx *cc)
> +{
> + cc->if_ops->enable_irq(cc->dev);
> +
> + cc33xx_irq(cc);
> +}
...
> +static const struct cc33xx_if_operations sdio_ops_inband_irq = {
> + .interface_claim = cc33xx_sdio_claim,
> + .interface_release = cc33xx_sdio_release,
> + .read = cc33xx_sdio_raw_read,
> + .write = cc33xx_sdio_raw_write,
> + .power = cc33xx_sdio_set_power,
> + .set_block_size = cc33xx_sdio_set_block_size,
> + .set_irq_handler = cc33xx_set_irq_handler,
> + .disable_irq = cc33xx_sdio_disable_irq,
> + .enable_irq = cc33xx_sdio_enable_irq,
> +};
> +
> +#ifdef CONFIG_OF
> +static const struct cc33xx_family_data cc33xx_data = {
> + .name = "cc33xx",
> + .cfg_name = "ti-connectivity/cc33xx-conf.bin",
> + .nvs_name = "ti-connectivity/cc33xx-nvs.bin",
> +};
> +
> +static const struct of_device_id cc33xx_sdio_of_match_table[] = {
> + { .compatible = "ti,cc33xx", .data = &cc33xx_data },
This is supposed to be your base variant.
> + { }
> +};
Missing MODULE_DEVICE_TABLE... or you do not autoload this based on OF
matching? That's a bit surprising, I don't remember how SDIO bus handles
it. But for other buses this is unexpected and usually not correct.
> +
...
> +
> +static struct sdio_driver cc33xx_sdio_driver = {
> + .name = "cc33xx_sdio",
> + .id_table = cc33xx_devices,
> + .probe = sdio_cc33xx_probe,
> + .remove = sdio_cc33xx_remove,
> +#ifdef CONFIG_PM
> + .drv = {
> + .pm = &cc33xx_sdio_pm_ops,
> + },
> +#endif /* CONFIG_PM */
> +};
> +
> +MODULE_DEVICE_TABLE(sdio, cc33xx_devices);
This is always next to the table.
> +
> +module_sdio_driver(cc33xx_sdio_driver);
> +
> +MODULE_LICENSE("GPL v2");
> +MODULE_DESCRIPTION("SDIO transport for Texas Instruments CC33xx WLAN driver");
> +MODULE_AUTHOR("Michael Nemanov <michael.nemanov@ti.com>");
> +MODULE_AUTHOR("Sabeeh Khan <sabeeh-khan@ti.com>");
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-10-29 17:34 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-29 17:23 [PATCH v4 00/17] wifi: cc33xx: Add driver for new TI CC33xx wireless device family Michael Nemanov
2024-10-29 17:23 ` [PATCH v4 01/17] dt-bindings: net: wireless: cc33xx: Add ti,cc33xx.yaml Michael Nemanov
2024-10-29 17:28 ` Krzysztof Kozlowski
2024-10-30 10:59 ` Nemanov, Michael
2024-10-30 11:09 ` Krzysztof Kozlowski
2024-10-30 12:14 ` Nemanov, Michael
2024-10-30 14:01 ` Krzysztof Kozlowski
2024-10-29 17:23 ` [PATCH v4 02/17] wifi: cc33xx: Add cc33xx.h, cc33xx_i.h Michael Nemanov
2024-10-29 17:23 ` [PATCH v4 03/17] wifi: cc33xx: Add debug.h Michael Nemanov
2024-10-29 17:23 ` [PATCH v4 04/17] wifi: cc33xx: Add sdio.c, io.c, io.h Michael Nemanov
2024-10-29 17:34 ` Krzysztof Kozlowski [this message]
2024-11-03 13:33 ` Nemanov, Michael
2024-10-29 17:23 ` [PATCH v4 05/17] wifi: cc33xx: Add cmd.c, cmd.h Michael Nemanov
2024-10-29 17:23 ` [PATCH v4 06/17] wifi: cc33xx: Add acx.c, acx.h Michael Nemanov
2024-10-29 17:23 ` [PATCH v4 07/17] wifi: cc33xx: Add event.c, event.h Michael Nemanov
2024-11-02 13:12 ` Simon Horman
2024-10-29 17:23 ` [PATCH v4 08/17] wifi: cc33xx: Add boot.c, boot.h Michael Nemanov
2024-10-29 17:23 ` [PATCH v4 09/17] wifi: cc33xx: Add main.c Michael Nemanov
2024-11-02 13:25 ` Simon Horman
2024-11-03 12:55 ` Nemanov, Michael
2024-10-29 17:23 ` [PATCH v4 10/17] wifi: cc33xx: Add rx.c, rx.h Michael Nemanov
2024-10-29 17:23 ` [PATCH v4 11/17] wifi: cc33xx: Add tx.c, tx.h Michael Nemanov
2024-10-29 17:23 ` [PATCH v4 12/17] wifi: cc33xx: Add init.c, init.h Michael Nemanov
2024-10-29 17:23 ` [PATCH v4 13/17] wifi: cc33xx: Add scan.c, scan.h Michael Nemanov
2024-10-29 17:23 ` [PATCH v4 14/17] wifi: cc33xx: Add conf.h Michael Nemanov
2024-10-29 17:23 ` [PATCH v4 15/17] wifi: cc33xx: Add ps.c, ps.h Michael Nemanov
2024-10-29 17:23 ` [PATCH v4 16/17] wifi: cc33xx: Add testmode.c, testmode.h Michael Nemanov
2024-10-29 17:23 ` [PATCH v4 17/17] wifi: cc33xx: Add Kconfig, Makefile Michael Nemanov
2024-10-29 17:55 ` Krzysztof Kozlowski
2024-10-30 14:11 ` kernel test robot
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=9aff2bed-bca4-482b-83ea-4cd945812817@kernel.org \
--to=krzk@kernel.org \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=michael.nemanov@ti.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=sabeeh-khan@ti.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.