drivers/nfc/nfcmrvl/uart.c
Source file repositories/reference/linux-study-clean/drivers/nfc/nfcmrvl/uart.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/nfc/nfcmrvl/uart.c- Extension
.c- Size
- 5433 bytes
- Lines
- 216
- Domain
- Driver Families
- Bucket
- drivers/nfc
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/device.hlinux/err.hlinux/gpio/consumer.hlinux/module.hlinux/of.hlinux/printk.hnet/nfc/nci.hnet/nfc/nci_core.hnfcmrvl.h
Detected Declarations
function nfcmrvl_uart_nci_openfunction nfcmrvl_uart_nci_closefunction nfcmrvl_uart_nci_sendfunction nfcmrvl_uart_nci_update_configfunction nfcmrvl_uart_parse_dtfunction nfcmrvl_nci_uart_openfunction nfcmrvl_nci_uart_closefunction nfcmrvl_nci_uart_recvfunction nfcmrvl_nci_uart_tx_startfunction nfcmrvl_nci_uart_tx_done
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Marvell NFC-over-UART driver
*
* Copyright (C) 2015, Marvell International Ltd.
*/
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/printk.h>
#include <net/nfc/nci.h>
#include <net/nfc/nci_core.h>
#include "nfcmrvl.h"
static unsigned int hci_muxed;
static unsigned int flow_control;
static unsigned int break_control;
/*
* NFCMRVL NCI OPS
*/
static int nfcmrvl_uart_nci_open(struct nfcmrvl_private *priv)
{
return 0;
}
static int nfcmrvl_uart_nci_close(struct nfcmrvl_private *priv)
{
return 0;
}
static int nfcmrvl_uart_nci_send(struct nfcmrvl_private *priv,
struct sk_buff *skb)
{
struct nci_uart *nu = priv->drv_data;
return nu->ops.send(nu, skb);
}
static void nfcmrvl_uart_nci_update_config(struct nfcmrvl_private *priv,
const void *param)
{
struct nci_uart *nu = priv->drv_data;
const struct nfcmrvl_fw_uart_config *config = param;
nci_uart_set_config(nu, le32_to_cpu(config->baudrate),
config->flow_control);
}
static const struct nfcmrvl_if_ops uart_ops = {
.nci_open = nfcmrvl_uart_nci_open,
.nci_close = nfcmrvl_uart_nci_close,
.nci_send = nfcmrvl_uart_nci_send,
.nci_update_config = nfcmrvl_uart_nci_update_config
};
static int nfcmrvl_uart_parse_dt(struct device_node *node,
struct nfcmrvl_platform_data *pdata,
struct device *dev)
{
struct device_node *matched_node;
struct gpio_desc *reset_gpio;
int ret;
matched_node = of_get_compatible_child(node, "marvell,nfc-uart");
if (!matched_node) {
matched_node = of_get_compatible_child(node, "mrvl,nfc-uart");
if (!matched_node)
return -ENODEV;
}
ret = nfcmrvl_parse_dt(matched_node, pdata);
if (ret < 0) {
pr_err("Failed to get generic entries\n");
of_node_put(matched_node);
return ret;
}
pdata->flow_control = of_property_read_bool(matched_node, "flow-control");
pdata->break_control = of_property_read_bool(matched_node, "break-control");
reset_gpio = devm_fwnode_gpiod_get_optional(dev,
of_fwnode_handle(matched_node),
Annotation
- Immediate include surface: `linux/delay.h`, `linux/device.h`, `linux/err.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/printk.h`, `net/nfc/nci.h`.
- Detected declarations: `function nfcmrvl_uart_nci_open`, `function nfcmrvl_uart_nci_close`, `function nfcmrvl_uart_nci_send`, `function nfcmrvl_uart_nci_update_config`, `function nfcmrvl_uart_parse_dt`, `function nfcmrvl_nci_uart_open`, `function nfcmrvl_nci_uart_close`, `function nfcmrvl_nci_uart_recv`, `function nfcmrvl_nci_uart_tx_start`, `function nfcmrvl_nci_uart_tx_done`.
- Atlas domain: Driver Families / drivers/nfc.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.