mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
Merge tag 'staging-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH: "Here is the big set of staging driver updates for 6.19-rc1. Only thing "major" in here is that two subsystems, gpib and vc04 have moved out of the staging tree into the "real" portion of the kernel, which is great to see. Other than that, the rest of the changes are just tiny coding style cleanups, nothing earth-shattering. All of these have been in linux-next for a while with no reported problems" * tag 'staging-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (53 commits) staging: rtl8723bs: fix out-of-bounds read in OnBeacon ESR IE parsing staging: rtl8723bs: fix stack buffer overflow in OnAssocReq IE parsing staging: rtl8723bs: fix out-of-bounds read in rtw_get_ie() parser staging: gpib: Clean-up commented-out code staging: rtl8723bs: remove custom FIELD_OFFSET macro staging: rtl8723bs: replace FIELD_OFFSET usage with offsetof in rtw_mlme_ext.c staging: rtl8723bs: remove dead commented code from odm.c staging: rtl8723bs: use standard offsetof in cfg80211 operations staging: rtl8723bs: remove unused registry and BSSID offset macros staging: rtl8723bs: core: delete commented-out code staging: rtl8723bs: core: fix block comment style issues staging: greybus: uart: check return values during probe staging: fbtft: core: fix potential memory leak in fbtft_probe_common() staging: gpib: Destage gpib staging: gpib: Fix SPDX license for gpib headers staging: gpib: Update TODO file staging: gpib: Change // comments in uapi header file platform/raspberrypi: Destage VCHIQ MMAL driver platform/raspberrypi: Destage VCHIQ interface staging: vc04_services: Cleanup VCHIQ TODO entries ...
This commit is contained in:
@@ -4910,7 +4910,9 @@ S: Maintained
|
||||
T: git https://github.com/broadcom/stblinux.git
|
||||
F: Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml
|
||||
F: drivers/pci/controller/pcie-brcmstb.c
|
||||
F: drivers/platform/raspberrypi/vchiq-*
|
||||
F: drivers/staging/vc04_services
|
||||
F: include/linux/raspberrypi/vchiq*
|
||||
N: bcm2711
|
||||
N: bcm2712
|
||||
N: bcm283*
|
||||
@@ -10727,7 +10729,9 @@ F: drivers/platform/x86/gpd-pocket-fan.c
|
||||
GPIB DRIVERS
|
||||
M: Dave Penkler <dpenkler@gmail.com>
|
||||
S: Maintained
|
||||
F: drivers/staging/gpib/
|
||||
F: drivers/gpib/
|
||||
F: include/uapi/linux/gpib.h
|
||||
F: include/uapi/linux/gpib_ioctl.h
|
||||
|
||||
GPIO ACPI SUPPORT
|
||||
M: Mika Westerberg <westeri@kernel.org>
|
||||
|
||||
@@ -161,6 +161,8 @@ source "drivers/greybus/Kconfig"
|
||||
|
||||
source "drivers/comedi/Kconfig"
|
||||
|
||||
source "drivers/gpib/Kconfig"
|
||||
|
||||
source "drivers/staging/Kconfig"
|
||||
|
||||
source "drivers/platform/Kconfig"
|
||||
|
||||
@@ -150,6 +150,7 @@ obj-$(CONFIG_VHOST_IOTLB) += vhost/
|
||||
obj-$(CONFIG_VHOST) += vhost/
|
||||
obj-$(CONFIG_GREYBUS) += greybus/
|
||||
obj-$(CONFIG_COMEDI) += comedi/
|
||||
obj-$(CONFIG_GPIB) += gpib/
|
||||
obj-$(CONFIG_STAGING) += staging/
|
||||
obj-y += platform/
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
menuconfig GPIB
|
||||
tristate "Linux GPIB drivers"
|
||||
tristate "GPIB drivers"
|
||||
help
|
||||
Enable support for GPIB cards and dongles for Linux. GPIB
|
||||
is the General Purpose Interface Bus which conforms to the
|
||||
IEEE488 standard.
|
||||
Enable support for GPIB cards and dongles. GPIB is the
|
||||
General Purpose Interface Bus which conforms to the IEEE488
|
||||
standard.
|
||||
|
||||
This set of drivers can be used with the corresponding user
|
||||
space library that can be found on Sourceforge under linux-gpib.
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
subdir-ccflags-y += -I$(src)/include -I$(src)/uapi
|
||||
subdir-ccflags-y += -I$(src)/include
|
||||
|
||||
obj-$(CONFIG_GPIB_AGILENT_82350B) += agilent_82350b/
|
||||
obj-$(CONFIG_GPIB_AGILENT_82357A) += agilent_82357a/
|
||||
@@ -4,20 +4,6 @@ TODO:
|
||||
CHECK:ALLOC_SIZEOF_STRUCT: Prefer kmalloc(sizeof(*board->private_data)...) over kmalloc(sizeof(struct xxx_priv)...)
|
||||
./gpio/gpib_bitbang.c:50: ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parenthese
|
||||
This warning will be addressed later: WARNING:UNDOCUMENTED_DT_STRING: DT compatible string
|
||||
- tidy-up comments:
|
||||
- there are some "//comments" and "// comments" scattered around
|
||||
- sometimes they are misaligned
|
||||
- sometimes "// comments" are interleaved with "/* comments */"
|
||||
- multiline comments should start with initial almost-blank line:
|
||||
/*
|
||||
* Good
|
||||
* multiline
|
||||
* comment
|
||||
*/
|
||||
/* Bad
|
||||
* multiline
|
||||
* comment
|
||||
*/
|
||||
- resolve XXX notes where possible
|
||||
- fix FIXME notes
|
||||
- clean-up commented-out code
|
||||
@@ -1290,26 +1290,14 @@ static void cb_gpib_release(struct pcmcia_device *link)
|
||||
|
||||
static int cb_gpib_suspend(struct pcmcia_device *link)
|
||||
{
|
||||
//struct local_info *info = link->priv;
|
||||
//struct struct gpib_board *dev = info->dev;
|
||||
|
||||
if (link->open)
|
||||
dev_warn(&link->dev, "Device still open\n");
|
||||
//netif_device_detach(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cb_gpib_resume(struct pcmcia_device *link)
|
||||
{
|
||||
//struct local_info *info = link->priv;
|
||||
//struct struct gpib_board *dev = info->dev;
|
||||
|
||||
/*if (link->open) {
|
||||
* ni_gpib_probe(dev); / really?
|
||||
* //netif_device_attach(dev);
|
||||
*
|
||||
*/
|
||||
return cb_gpib_config(link);
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
#include "gpib_types.h"
|
||||
#include "gpib_proto.h"
|
||||
#include "gpib_cmd.h"
|
||||
#include "gpib.h"
|
||||
#include "gpib_ioctl.h"
|
||||
#include <linux/gpib.h>
|
||||
#include <linux/gpib_ioctl.h>
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/interrupt.h>
|
||||
@@ -8,7 +8,7 @@
|
||||
#define _GPIB_TYPES_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include "gpib.h"
|
||||
#include <linux/gpib.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/mutex.h>
|
||||
@@ -535,7 +535,7 @@ int tms9914_read(struct gpib_board *board, struct tms9914_priv *priv, u8 *buffer
|
||||
buffer += num_bytes;
|
||||
length -= num_bytes;
|
||||
}
|
||||
// read last bytes if we havn't received an END yet
|
||||
// read last bytes if we haven't received an END yet
|
||||
if (*end == 0) {
|
||||
// make sure we holdoff after last byte read
|
||||
tms9914_set_holdoff_mode(priv, TMS9914_HOLDOFF_ALL);
|
||||
@@ -18,3 +18,5 @@ source "drivers/platform/surface/Kconfig"
|
||||
source "drivers/platform/x86/Kconfig"
|
||||
|
||||
source "drivers/platform/arm64/Kconfig"
|
||||
|
||||
source "drivers/platform/raspberrypi/Kconfig"
|
||||
|
||||
@@ -13,3 +13,4 @@ obj-$(CONFIG_CHROME_PLATFORMS) += chrome/
|
||||
obj-$(CONFIG_CZNIC_PLATFORMS) += cznic/
|
||||
obj-$(CONFIG_SURFACE_PLATFORMS) += surface/
|
||||
obj-$(CONFIG_ARM64_PLATFORM_DEVICES) += arm64/
|
||||
obj-$(CONFIG_BCM2835_VCHIQ) += raspberrypi/
|
||||
|
||||
52
drivers/platform/raspberrypi/Kconfig
Normal file
52
drivers/platform/raspberrypi/Kconfig
Normal file
@@ -0,0 +1,52 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
menuconfig BCM_VIDEOCORE
|
||||
tristate "Broadcom VideoCore support"
|
||||
depends on OF
|
||||
depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && !RASPBERRYPI_FIRMWARE)
|
||||
default y
|
||||
help
|
||||
Support for Broadcom VideoCore services including
|
||||
the BCM2835 family of products which is used
|
||||
by the Raspberry PI.
|
||||
|
||||
if BCM_VIDEOCORE
|
||||
|
||||
config BCM2835_VCHIQ
|
||||
tristate "BCM2835 VCHIQ"
|
||||
depends on HAS_DMA
|
||||
imply VCHIQ_CDEV
|
||||
help
|
||||
Broadcom BCM2835 and similar SoCs have a VPU called VideoCore.
|
||||
This config enables the VCHIQ driver, which implements a
|
||||
messaging interface between the kernel and the firmware running
|
||||
on VideoCore. Other drivers use this interface to communicate to
|
||||
the VPU. More specifically, the VCHIQ driver is used by
|
||||
audio/video and camera drivers as well as for implementing MMAL
|
||||
API, which is in turn used by several multimedia services on the
|
||||
BCM2835 family of SoCs.
|
||||
|
||||
Defaults to Y when the Broadcom Videocore services are included
|
||||
in the build, N otherwise.
|
||||
|
||||
if BCM2835_VCHIQ
|
||||
|
||||
config VCHIQ_CDEV
|
||||
bool "VCHIQ Character Driver"
|
||||
help
|
||||
Enable the creation of VCHIQ character driver. The cdev exposes
|
||||
ioctls used by userspace libraries and testing tools to interact
|
||||
with VideoCore, via the VCHIQ core driver (Check BCM2835_VCHIQ
|
||||
for more info).
|
||||
|
||||
This can be set to 'N' if the VideoCore communication is not
|
||||
needed by userspace but only by other kernel modules
|
||||
(like bcm2835-audio).
|
||||
|
||||
If not sure, set this to 'Y'.
|
||||
|
||||
endif
|
||||
|
||||
source "drivers/platform/raspberrypi/vchiq-mmal/Kconfig"
|
||||
|
||||
endif
|
||||
15
drivers/platform/raspberrypi/Makefile
Normal file
15
drivers/platform/raspberrypi/Makefile
Normal file
@@ -0,0 +1,15 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
obj-$(CONFIG_BCM2835_VCHIQ) += vchiq.o
|
||||
|
||||
vchiq-objs := \
|
||||
vchiq-interface/vchiq_core.o \
|
||||
vchiq-interface/vchiq_arm.o \
|
||||
vchiq-interface/vchiq_bus.o \
|
||||
vchiq-interface/vchiq_debugfs.o \
|
||||
|
||||
ifdef CONFIG_VCHIQ_CDEV
|
||||
vchiq-objs += vchiq-interface/vchiq_dev.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_BCM2835_VCHIQ_MMAL) += vchiq-mmal/
|
||||
4
drivers/platform/raspberrypi/vchiq-interface/TODO
Normal file
4
drivers/platform/raspberrypi/vchiq-interface/TODO
Normal file
@@ -0,0 +1,4 @@
|
||||
* Documentation
|
||||
|
||||
A short top-down description of this driver's architecture (function of
|
||||
kthreads, userspace, limitations) could be very helpful for reviewers.
|
||||
@@ -30,11 +30,12 @@
|
||||
#include <linux/uaccess.h>
|
||||
#include <soc/bcm2835/raspberrypi-firmware.h>
|
||||
|
||||
#include "vchiq_core.h"
|
||||
#include <linux/raspberrypi/vchiq_core.h>
|
||||
#include <linux/raspberrypi/vchiq_arm.h>
|
||||
#include <linux/raspberrypi/vchiq_bus.h>
|
||||
#include <linux/raspberrypi/vchiq_debugfs.h>
|
||||
|
||||
#include "vchiq_ioctl.h"
|
||||
#include "vchiq_arm.h"
|
||||
#include "vchiq_bus.h"
|
||||
#include "vchiq_debugfs.h"
|
||||
|
||||
#define DEVICE_NAME "vchiq"
|
||||
|
||||
@@ -62,7 +63,6 @@
|
||||
* the interface.
|
||||
*/
|
||||
static struct vchiq_device *bcm2835_audio;
|
||||
static struct vchiq_device *bcm2835_camera;
|
||||
|
||||
static const struct vchiq_platform_info bcm2835_info = {
|
||||
.cache_line_size = 32,
|
||||
@@ -73,7 +73,13 @@ static const struct vchiq_platform_info bcm2836_info = {
|
||||
};
|
||||
|
||||
struct vchiq_arm_state {
|
||||
/* Keepalive-related data */
|
||||
/*
|
||||
* Keepalive-related data
|
||||
*
|
||||
* The keepalive mechanism was retro-fitted to VCHIQ to allow active
|
||||
* services to prevent the system from suspending.
|
||||
* This feature is not used on Raspberry Pi devices.
|
||||
*/
|
||||
struct task_struct *ka_thread;
|
||||
struct completion ka_evt;
|
||||
atomic_t ka_use_count;
|
||||
@@ -1416,7 +1422,6 @@ static int vchiq_probe(struct platform_device *pdev)
|
||||
vchiq_debugfs_init(&mgmt->state);
|
||||
|
||||
bcm2835_audio = vchiq_device_register(&pdev->dev, "bcm2835-audio");
|
||||
bcm2835_camera = vchiq_device_register(&pdev->dev, "bcm2835-camera");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1426,7 +1431,6 @@ static void vchiq_remove(struct platform_device *pdev)
|
||||
struct vchiq_drv_mgmt *mgmt = dev_get_drvdata(&pdev->dev);
|
||||
|
||||
vchiq_device_unregister(bcm2835_audio);
|
||||
vchiq_device_unregister(bcm2835_camera);
|
||||
vchiq_debugfs_deinit();
|
||||
vchiq_deregister_chrdev();
|
||||
vchiq_platform_uninit(mgmt);
|
||||
@@ -11,8 +11,8 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
#include "vchiq_arm.h"
|
||||
#include "vchiq_bus.h"
|
||||
#include <linux/raspberrypi/vchiq_arm.h>
|
||||
#include <linux/raspberrypi/vchiq_bus.h>
|
||||
|
||||
static int vchiq_bus_type_match(struct device *dev, const struct device_driver *drv)
|
||||
{
|
||||
@@ -15,8 +15,8 @@
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/sched/signal.h>
|
||||
|
||||
#include "vchiq_arm.h"
|
||||
#include "vchiq_core.h"
|
||||
#include <linux/raspberrypi/vchiq_arm.h>
|
||||
#include <linux/raspberrypi/vchiq_core.h>
|
||||
|
||||
#define VCHIQ_SLOT_HANDLER_STACK 8192
|
||||
|
||||
@@ -4001,10 +4001,7 @@ void vchiq_log_dump_mem(struct device *dev, const char *label, u32 addr,
|
||||
}
|
||||
*s++ = '\0';
|
||||
|
||||
if (label && (*label != '\0'))
|
||||
dev_dbg(dev, "core: %s: %08x: %s\n", label, addr, line_buf);
|
||||
else
|
||||
dev_dbg(dev, "core: %s: %08x: %s\n", label, addr, line_buf);
|
||||
dev_dbg(dev, "core: %s: %08x: %s\n", label, addr, line_buf);
|
||||
|
||||
addr += 16;
|
||||
mem += 16;
|
||||
@@ -5,9 +5,9 @@
|
||||
*/
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
#include "vchiq_core.h"
|
||||
#include "vchiq_arm.h"
|
||||
#include "vchiq_debugfs.h"
|
||||
#include <linux/raspberrypi/vchiq_core.h>
|
||||
#include <linux/raspberrypi/vchiq_arm.h>
|
||||
#include <linux/raspberrypi/vchiq_debugfs.h>
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
#include <linux/compat.h>
|
||||
#include <linux/miscdevice.h>
|
||||
|
||||
#include "vchiq_core.h"
|
||||
#include <linux/raspberrypi/vchiq_core.h>
|
||||
#include <linux/raspberrypi/vchiq_arm.h>
|
||||
#include <linux/raspberrypi/vchiq_debugfs.h>
|
||||
|
||||
#include "vchiq_ioctl.h"
|
||||
#include "vchiq_arm.h"
|
||||
#include "vchiq_debugfs.h"
|
||||
|
||||
static const char *const ioctl_names[] = {
|
||||
"CONNECT",
|
||||
@@ -5,8 +5,7 @@
|
||||
#define VCHIQ_IOCTLS_H
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#include "../../include/linux/raspberrypi/vchiq.h"
|
||||
#include <linux/raspberrypi/vchiq.h>
|
||||
|
||||
#define VCHIQ_IOC_MAGIC 0xc4
|
||||
#define VCHIQ_INVALID_HANDLE (~0)
|
||||
@@ -22,11 +22,12 @@
|
||||
#include <linux/mm.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/completion.h>
|
||||
#include <linux/raspberrypi/vchiq.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <media/videobuf2-vmalloc.h>
|
||||
|
||||
#include "../include/linux/raspberrypi/vchiq.h"
|
||||
#include "../interface/vchiq_arm/vchiq_arm.h"
|
||||
#include <linux/raspberrypi/vchiq_arm.h>
|
||||
|
||||
#include "mmal-common.h"
|
||||
#include "mmal-vchiq.h"
|
||||
#include "mmal-msg.h"
|
||||
@@ -48,6 +48,4 @@ source "drivers/staging/axis-fifo/Kconfig"
|
||||
|
||||
source "drivers/staging/vme_user/Kconfig"
|
||||
|
||||
source "drivers/staging/gpib/Kconfig"
|
||||
|
||||
endif # STAGING
|
||||
|
||||
@@ -13,4 +13,3 @@ obj-$(CONFIG_MOST) += most/
|
||||
obj-$(CONFIG_GREYBUS) += greybus/
|
||||
obj-$(CONFIG_BCM2835_VCHIQ) += vc04_services/
|
||||
obj-$(CONFIG_XIL_AXIS_FIFO) += axis-fifo/
|
||||
obj-$(CONFIG_GPIB) += gpib/
|
||||
|
||||
@@ -88,16 +88,8 @@
|
||||
#define XLLF_INT_TC_MASK 0x08000000 /* Transmit complete */
|
||||
#define XLLF_INT_RC_MASK 0x04000000 /* Receive complete */
|
||||
#define XLLF_INT_TSE_MASK 0x02000000 /* Transmit length mismatch */
|
||||
#define XLLF_INT_TRC_MASK 0x01000000 /* Transmit reset complete */
|
||||
#define XLLF_INT_RRC_MASK 0x00800000 /* Receive reset complete */
|
||||
#define XLLF_INT_TFPF_MASK 0x00400000 /* Tx FIFO Programmable Full */
|
||||
#define XLLF_INT_TFPE_MASK 0x00200000 /* Tx FIFO Programmable Empty */
|
||||
#define XLLF_INT_RFPF_MASK 0x00100000 /* Rx FIFO Programmable Full */
|
||||
#define XLLF_INT_RFPE_MASK 0x00080000 /* Rx FIFO Programmable Empty */
|
||||
#define XLLF_INT_ALL_MASK 0xfff80000 /* All the ints */
|
||||
#define XLLF_INT_ERROR_MASK 0xf2000000 /* Error status ints */
|
||||
#define XLLF_INT_RXERROR_MASK 0xe0000000 /* Receive Error status ints */
|
||||
#define XLLF_INT_TXERROR_MASK 0x12000000 /* Transmit Error status ints */
|
||||
|
||||
#define XLLF_INT_CLEAR_ALL GENMASK(31, 0)
|
||||
|
||||
/* ----------------------------
|
||||
* globals
|
||||
@@ -125,7 +117,6 @@ MODULE_PARM_DESC(write_timeout, "ms to wait before blocking write() timing out;
|
||||
|
||||
struct axis_fifo {
|
||||
int id;
|
||||
int irq; /* interrupt */
|
||||
void __iomem *base_addr; /* kernel space memory */
|
||||
|
||||
unsigned int rx_fifo_depth; /* max words in the receive fifo */
|
||||
@@ -137,8 +128,6 @@ struct axis_fifo {
|
||||
struct mutex read_lock; /* lock for reading */
|
||||
wait_queue_head_t write_queue; /* wait queue for asynchronos write */
|
||||
struct mutex write_lock; /* lock for writing */
|
||||
unsigned int write_flags; /* write file flags */
|
||||
unsigned int read_flags; /* read file flags */
|
||||
|
||||
struct device *dt_device; /* device created from the device tree */
|
||||
struct miscdevice miscdev;
|
||||
@@ -165,7 +154,7 @@ static void reset_ip_core(struct axis_fifo *fifo)
|
||||
XLLF_INT_RPORE_MASK | XLLF_INT_RPUE_MASK |
|
||||
XLLF_INT_TPOE_MASK | XLLF_INT_TSE_MASK,
|
||||
fifo->base_addr + XLLF_IER_OFFSET);
|
||||
iowrite32(XLLF_INT_ALL_MASK, fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
iowrite32(XLLF_INT_CLEAR_ALL, fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,7 +184,7 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,
|
||||
int ret;
|
||||
u32 tmp_buf[READ_BUF_SIZE];
|
||||
|
||||
if (fifo->read_flags & O_NONBLOCK) {
|
||||
if (f->f_flags & O_NONBLOCK) {
|
||||
/*
|
||||
* Device opened in non-blocking mode. Try to lock it and then
|
||||
* check if any packet is available.
|
||||
@@ -337,7 +326,7 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
|
||||
if (words_to_write > (fifo->tx_fifo_depth - 4))
|
||||
return -EINVAL;
|
||||
|
||||
if (fifo->write_flags & O_NONBLOCK) {
|
||||
if (f->f_flags & O_NONBLOCK) {
|
||||
/*
|
||||
* Device opened in non-blocking mode. Try to lock it and then
|
||||
* check if there is any room to write the given buffer.
|
||||
@@ -396,106 +385,36 @@ end_unlock:
|
||||
|
||||
static irqreturn_t axis_fifo_irq(int irq, void *dw)
|
||||
{
|
||||
struct axis_fifo *fifo = (struct axis_fifo *)dw;
|
||||
unsigned int pending_interrupts;
|
||||
struct axis_fifo *fifo = dw;
|
||||
u32 isr, ier, intr;
|
||||
|
||||
do {
|
||||
pending_interrupts = ioread32(fifo->base_addr +
|
||||
XLLF_IER_OFFSET) &
|
||||
ioread32(fifo->base_addr
|
||||
+ XLLF_ISR_OFFSET);
|
||||
if (pending_interrupts & XLLF_INT_RC_MASK) {
|
||||
/* packet received */
|
||||
ier = ioread32(fifo->base_addr + XLLF_IER_OFFSET);
|
||||
isr = ioread32(fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
intr = ier & isr;
|
||||
|
||||
/* wake the reader process if it is waiting */
|
||||
wake_up(&fifo->read_queue);
|
||||
if (intr & XLLF_INT_RC_MASK)
|
||||
wake_up(&fifo->read_queue);
|
||||
|
||||
/* clear interrupt */
|
||||
iowrite32(XLLF_INT_RC_MASK & XLLF_INT_ALL_MASK,
|
||||
fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
} else if (pending_interrupts & XLLF_INT_TC_MASK) {
|
||||
/* packet sent */
|
||||
if (intr & XLLF_INT_TC_MASK)
|
||||
wake_up(&fifo->write_queue);
|
||||
|
||||
/* wake the writer process if it is waiting */
|
||||
wake_up(&fifo->write_queue);
|
||||
if (intr & XLLF_INT_RPURE_MASK)
|
||||
dev_err(fifo->dt_device, "receive under-read interrupt\n");
|
||||
|
||||
iowrite32(XLLF_INT_TC_MASK & XLLF_INT_ALL_MASK,
|
||||
fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
} else if (pending_interrupts & XLLF_INT_TFPF_MASK) {
|
||||
/* transmit fifo programmable full */
|
||||
if (intr & XLLF_INT_RPORE_MASK)
|
||||
dev_err(fifo->dt_device, "receive over-read interrupt\n");
|
||||
|
||||
iowrite32(XLLF_INT_TFPF_MASK & XLLF_INT_ALL_MASK,
|
||||
fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
} else if (pending_interrupts & XLLF_INT_TFPE_MASK) {
|
||||
/* transmit fifo programmable empty */
|
||||
if (intr & XLLF_INT_RPUE_MASK)
|
||||
dev_err(fifo->dt_device, "receive underrun error interrupt\n");
|
||||
|
||||
iowrite32(XLLF_INT_TFPE_MASK & XLLF_INT_ALL_MASK,
|
||||
fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
} else if (pending_interrupts & XLLF_INT_RFPF_MASK) {
|
||||
/* receive fifo programmable full */
|
||||
if (intr & XLLF_INT_TPOE_MASK)
|
||||
dev_err(fifo->dt_device, "transmit overrun error interrupt\n");
|
||||
|
||||
iowrite32(XLLF_INT_RFPF_MASK & XLLF_INT_ALL_MASK,
|
||||
fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
} else if (pending_interrupts & XLLF_INT_RFPE_MASK) {
|
||||
/* receive fifo programmable empty */
|
||||
if (intr & XLLF_INT_TSE_MASK)
|
||||
dev_err(fifo->dt_device,
|
||||
"transmit length mismatch error interrupt\n");
|
||||
|
||||
iowrite32(XLLF_INT_RFPE_MASK & XLLF_INT_ALL_MASK,
|
||||
fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
} else if (pending_interrupts & XLLF_INT_TRC_MASK) {
|
||||
/* transmit reset complete interrupt */
|
||||
|
||||
iowrite32(XLLF_INT_TRC_MASK & XLLF_INT_ALL_MASK,
|
||||
fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
} else if (pending_interrupts & XLLF_INT_RRC_MASK) {
|
||||
/* receive reset complete interrupt */
|
||||
|
||||
iowrite32(XLLF_INT_RRC_MASK & XLLF_INT_ALL_MASK,
|
||||
fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
} else if (pending_interrupts & XLLF_INT_RPURE_MASK) {
|
||||
/* receive fifo under-read error interrupt */
|
||||
dev_err(fifo->dt_device,
|
||||
"receive under-read interrupt\n");
|
||||
|
||||
iowrite32(XLLF_INT_RPURE_MASK & XLLF_INT_ALL_MASK,
|
||||
fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
} else if (pending_interrupts & XLLF_INT_RPORE_MASK) {
|
||||
/* receive over-read error interrupt */
|
||||
dev_err(fifo->dt_device,
|
||||
"receive over-read interrupt\n");
|
||||
|
||||
iowrite32(XLLF_INT_RPORE_MASK & XLLF_INT_ALL_MASK,
|
||||
fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
} else if (pending_interrupts & XLLF_INT_RPUE_MASK) {
|
||||
/* receive underrun error interrupt */
|
||||
dev_err(fifo->dt_device,
|
||||
"receive underrun error interrupt\n");
|
||||
|
||||
iowrite32(XLLF_INT_RPUE_MASK & XLLF_INT_ALL_MASK,
|
||||
fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
} else if (pending_interrupts & XLLF_INT_TPOE_MASK) {
|
||||
/* transmit overrun error interrupt */
|
||||
dev_err(fifo->dt_device,
|
||||
"transmit overrun error interrupt\n");
|
||||
|
||||
iowrite32(XLLF_INT_TPOE_MASK & XLLF_INT_ALL_MASK,
|
||||
fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
} else if (pending_interrupts & XLLF_INT_TSE_MASK) {
|
||||
/* transmit length mismatch error interrupt */
|
||||
dev_err(fifo->dt_device,
|
||||
"transmit length mismatch error interrupt\n");
|
||||
|
||||
iowrite32(XLLF_INT_TSE_MASK & XLLF_INT_ALL_MASK,
|
||||
fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
} else if (pending_interrupts) {
|
||||
/* unknown interrupt type */
|
||||
dev_err(fifo->dt_device,
|
||||
"unknown interrupt(s) 0x%x\n",
|
||||
pending_interrupts);
|
||||
|
||||
iowrite32(XLLF_INT_ALL_MASK,
|
||||
fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
}
|
||||
} while (pending_interrupts);
|
||||
iowrite32(XLLF_INT_CLEAR_ALL, fifo->base_addr + XLLF_ISR_OFFSET);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
@@ -504,27 +423,15 @@ static int axis_fifo_open(struct inode *inod, struct file *f)
|
||||
{
|
||||
struct axis_fifo *fifo = container_of(f->private_data,
|
||||
struct axis_fifo, miscdev);
|
||||
unsigned int flags = f->f_flags & O_ACCMODE;
|
||||
|
||||
f->private_data = fifo;
|
||||
|
||||
if (((f->f_flags & O_ACCMODE) == O_WRONLY) ||
|
||||
((f->f_flags & O_ACCMODE) == O_RDWR)) {
|
||||
if (fifo->has_tx_fifo) {
|
||||
fifo->write_flags = f->f_flags;
|
||||
} else {
|
||||
dev_err(fifo->dt_device, "tried to open device for write but the transmit fifo is disabled\n");
|
||||
return -EPERM;
|
||||
}
|
||||
}
|
||||
if ((flags == O_WRONLY || flags == O_RDWR) && !fifo->has_tx_fifo)
|
||||
return -EPERM;
|
||||
|
||||
if (((f->f_flags & O_ACCMODE) == O_RDONLY) ||
|
||||
((f->f_flags & O_ACCMODE) == O_RDWR)) {
|
||||
if (fifo->has_rx_fifo) {
|
||||
fifo->read_flags = f->f_flags;
|
||||
} else {
|
||||
dev_err(fifo->dt_device, "tried to open device for read but the receive fifo is disabled\n");
|
||||
return -EPERM;
|
||||
}
|
||||
}
|
||||
if ((flags == O_RDONLY || flags == O_RDWR) && !fifo->has_rx_fifo)
|
||||
return -EPERM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -575,30 +482,14 @@ static void axis_fifo_debugfs_init(struct axis_fifo *fifo)
|
||||
&axis_fifo_debugfs_regs_fops);
|
||||
}
|
||||
|
||||
/* read named property from the device tree */
|
||||
static int get_dts_property(struct axis_fifo *fifo,
|
||||
char *name, unsigned int *var)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = of_property_read_u32(fifo->dt_device->of_node, name, var);
|
||||
if (rc) {
|
||||
dev_err(fifo->dt_device, "couldn't read IP dts property '%s'",
|
||||
name);
|
||||
return rc;
|
||||
}
|
||||
dev_dbg(fifo->dt_device, "dts property '%s' = %u\n",
|
||||
name, *var);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int axis_fifo_parse_dt(struct axis_fifo *fifo)
|
||||
{
|
||||
int ret;
|
||||
unsigned int value;
|
||||
struct device_node *node = fifo->dt_device->of_node;
|
||||
|
||||
ret = get_dts_property(fifo, "xlnx,axi-str-rxd-tdata-width", &value);
|
||||
ret = of_property_read_u32(node, "xlnx,axi-str-rxd-tdata-width",
|
||||
&value);
|
||||
if (ret) {
|
||||
dev_err(fifo->dt_device, "missing xlnx,axi-str-rxd-tdata-width property\n");
|
||||
goto end;
|
||||
@@ -608,7 +499,8 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = get_dts_property(fifo, "xlnx,axi-str-txd-tdata-width", &value);
|
||||
ret = of_property_read_u32(node, "xlnx,axi-str-txd-tdata-width",
|
||||
&value);
|
||||
if (ret) {
|
||||
dev_err(fifo->dt_device, "missing xlnx,axi-str-txd-tdata-width property\n");
|
||||
goto end;
|
||||
@@ -618,30 +510,32 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = get_dts_property(fifo, "xlnx,rx-fifo-depth",
|
||||
&fifo->rx_fifo_depth);
|
||||
ret = of_property_read_u32(node, "xlnx,rx-fifo-depth",
|
||||
&fifo->rx_fifo_depth);
|
||||
if (ret) {
|
||||
dev_err(fifo->dt_device, "missing xlnx,rx-fifo-depth property\n");
|
||||
ret = -EIO;
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = get_dts_property(fifo, "xlnx,tx-fifo-depth",
|
||||
&fifo->tx_fifo_depth);
|
||||
ret = of_property_read_u32(node, "xlnx,tx-fifo-depth",
|
||||
&fifo->tx_fifo_depth);
|
||||
if (ret) {
|
||||
dev_err(fifo->dt_device, "missing xlnx,tx-fifo-depth property\n");
|
||||
ret = -EIO;
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = get_dts_property(fifo, "xlnx,use-rx-data", &fifo->has_rx_fifo);
|
||||
ret = of_property_read_u32(node, "xlnx,use-rx-data",
|
||||
&fifo->has_rx_fifo);
|
||||
if (ret) {
|
||||
dev_err(fifo->dt_device, "missing xlnx,use-rx-data property\n");
|
||||
ret = -EIO;
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = get_dts_property(fifo, "xlnx,use-tx-data", &fifo->has_tx_fifo);
|
||||
ret = of_property_read_u32(node, "xlnx,use-tx-data",
|
||||
&fifo->has_tx_fifo);
|
||||
if (ret) {
|
||||
dev_err(fifo->dt_device, "missing xlnx,use-tx-data property\n");
|
||||
ret = -EIO;
|
||||
@@ -659,6 +553,7 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
||||
struct axis_fifo *fifo = NULL;
|
||||
char *device_name;
|
||||
int rc = 0; /* error return value */
|
||||
int irq;
|
||||
|
||||
/* ----------------------------
|
||||
* init wrapper device
|
||||
@@ -693,8 +588,6 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(fifo->base_addr))
|
||||
return PTR_ERR(fifo->base_addr);
|
||||
|
||||
dev_dbg(fifo->dt_device, "remapped memory to 0x%p\n", fifo->base_addr);
|
||||
|
||||
/* ----------------------------
|
||||
* init IP
|
||||
* ----------------------------
|
||||
@@ -712,17 +605,16 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
||||
*/
|
||||
|
||||
/* get IRQ resource */
|
||||
rc = platform_get_irq(pdev, 0);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
/* request IRQ */
|
||||
fifo->irq = rc;
|
||||
rc = devm_request_irq(fifo->dt_device, fifo->irq, &axis_fifo_irq, 0,
|
||||
rc = devm_request_irq(fifo->dt_device, irq, &axis_fifo_irq, 0,
|
||||
DRIVER_NAME, fifo);
|
||||
if (rc) {
|
||||
dev_err(fifo->dt_device, "couldn't allocate interrupt %i\n",
|
||||
fifo->irq);
|
||||
irq);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -764,6 +656,8 @@ static void axis_fifo_remove(struct platform_device *pdev)
|
||||
|
||||
static const struct of_device_id axis_fifo_of_match[] = {
|
||||
{ .compatible = "xlnx,axi-fifo-mm-s-4.1", },
|
||||
{ .compatible = "xlnx,axi-fifo-mm-s-4.2", },
|
||||
{ .compatible = "xlnx,axi-fifo-mm-s-4.3", },
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, axis_fifo_of_match);
|
||||
@@ -806,4 +700,4 @@ module_exit(axis_fifo_exit);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Jacob Feder <jacobsfeder@gmail.com>");
|
||||
MODULE_DESCRIPTION("Xilinx AXI-Stream FIFO v4.1 IP core driver");
|
||||
MODULE_DESCRIPTION("Xilinx AXI-Stream FIFO IP core driver");
|
||||
|
||||
@@ -14,7 +14,10 @@ AXI4-Lite interface. DOES NOT support:
|
||||
- AXI4 (non-lite)
|
||||
|
||||
Required properties:
|
||||
- compatible: Should be "xlnx,axi-fifo-mm-s-4.1"
|
||||
- compatible: Should be one of:
|
||||
"xlnx,axi-fifo-mm-s-4.1"
|
||||
"xlnx,axi-fifo-mm-s-4.2"
|
||||
"xlnx,axi-fifo-mm-s-4.3"
|
||||
- interrupt-names: Should be "interrupt"
|
||||
- interrupt-parent: Should be <&intc>
|
||||
- interrupts: Should contain interrupts lines.
|
||||
|
||||
@@ -1171,8 +1171,8 @@ int fbtft_probe_common(struct fbtft_display *display,
|
||||
par->pdev = pdev;
|
||||
|
||||
if (display->buswidth == 0) {
|
||||
dev_err(dev, "buswidth is not set\n");
|
||||
return -EINVAL;
|
||||
ret = dev_err_probe(dev, -EINVAL, "buswidth is not set\n");
|
||||
goto out_release;
|
||||
}
|
||||
|
||||
/* write register functions */
|
||||
|
||||
@@ -879,14 +879,18 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev,
|
||||
if (retval)
|
||||
goto exit_put_port;
|
||||
|
||||
send_control(gb_tty, gb_tty->ctrlout);
|
||||
retval = send_control(gb_tty, gb_tty->ctrlout);
|
||||
if (retval)
|
||||
goto exit_connection_disable;
|
||||
|
||||
/* initialize the uart to be 9600n81 */
|
||||
gb_tty->line_coding.rate = cpu_to_le32(9600);
|
||||
gb_tty->line_coding.format = GB_SERIAL_1_STOP_BITS;
|
||||
gb_tty->line_coding.parity = GB_SERIAL_NO_PARITY;
|
||||
gb_tty->line_coding.data_bits = 8;
|
||||
send_line_coding(gb_tty);
|
||||
retval = send_line_coding(gb_tty);
|
||||
if (retval)
|
||||
goto exit_connection_disable;
|
||||
|
||||
retval = gb_connection_enable(connection);
|
||||
if (retval)
|
||||
|
||||
@@ -24,6 +24,4 @@ source "drivers/staging/most/video/Kconfig"
|
||||
|
||||
source "drivers/staging/most/dim2/Kconfig"
|
||||
|
||||
source "drivers/staging/most/i2c/Kconfig"
|
||||
|
||||
endif
|
||||
|
||||
@@ -3,4 +3,3 @@
|
||||
obj-$(CONFIG_MOST_NET) += net/
|
||||
obj-$(CONFIG_MOST_VIDEO) += video/
|
||||
obj-$(CONFIG_MOST_DIM2) += dim2/
|
||||
obj-$(CONFIG_MOST_I2C) += i2c/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user