1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (C) 2013 - 2024 Intel Corporation */
7 #include <linux/auxiliary_bus.h>
8 #include <linux/container_of.h>
9 #include <linux/device.h>
10 #include <linux/irqreturn.h>
11 #include <linux/list.h>
12 #include <linux/scatterlist.h>
13 #include <linux/types.h>
18 #define IPU6_BUS_NAME IPU6_NAME "-bus"
20 struct ipu6_buttress_ctrl
;
22 struct ipu6_bus_device
{
23 struct auxiliary_device auxdev
;
24 const struct auxiliary_driver
*auxdrv
;
25 const struct ipu6_auxdrv_data
*auxdrv_data
;
26 struct list_head list
;
29 struct ipu6_device
*isp
;
30 struct ipu6_buttress_ctrl
*ctrl
;
32 const struct firmware
*fw
;
33 struct sg_table fw_sgt
;
35 dma_addr_t pkg_dir_dma_addr
;
36 unsigned int pkg_dir_size
;
39 struct ipu6_auxdrv_data
{
40 irqreturn_t (*isr
)(struct ipu6_bus_device
*adev
);
41 irqreturn_t (*isr_threaded
)(struct ipu6_bus_device
*adev
);
45 #define to_ipu6_bus_device(_dev) \
46 container_of(to_auxiliary_dev(_dev), struct ipu6_bus_device, auxdev)
47 #define auxdev_to_adev(_auxdev) \
48 container_of(_auxdev, struct ipu6_bus_device, auxdev)
49 #define ipu6_bus_get_drvdata(adev) dev_get_drvdata(&(adev)->auxdev.dev)
51 struct ipu6_bus_device
*
52 ipu6_bus_initialize_device(struct pci_dev
*pdev
, struct device
*parent
,
53 void *pdata
, struct ipu6_buttress_ctrl
*ctrl
,
55 int ipu6_bus_add_device(struct ipu6_bus_device
*adev
);
56 void ipu6_bus_del_devices(struct pci_dev
*pdev
);