1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* Copyright (C) 2013 - 2024 Intel Corporation */ 3 4 #ifndef IPU6_BUS_H 5 #define IPU6_BUS_H 6 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> 14 15 struct firmware; 16 struct pci_dev; 17 18 struct ipu6_buttress_ctrl; 19 20 struct ipu6_bus_device { 21 struct auxiliary_device auxdev; 22 const struct auxiliary_driver *auxdrv; 23 const struct ipu6_auxdrv_data *auxdrv_data; 24 struct list_head list; 25 void *pdata; 26 struct ipu6_mmu *mmu; 27 struct ipu6_device *isp; 28 const struct ipu6_buttress_ctrl *ctrl; 29 const struct firmware *fw; 30 struct sg_table fw_sgt; 31 u64 *pkg_dir; 32 dma_addr_t pkg_dir_dma_addr; 33 unsigned int pkg_dir_size; 34 }; 35 36 struct ipu6_auxdrv_data { 37 irqreturn_t (*isr)(struct ipu6_bus_device *adev); 38 irqreturn_t (*isr_threaded)(struct ipu6_bus_device *adev); 39 bool wake_isr_thread; 40 }; 41 42 #define to_ipu6_bus_device(_dev) \ 43 container_of(to_auxiliary_dev(_dev), struct ipu6_bus_device, auxdev) 44 #define auxdev_to_adev(_auxdev) \ 45 container_of(_auxdev, struct ipu6_bus_device, auxdev) 46 #define ipu6_bus_get_drvdata(adev) dev_get_drvdata(&(adev)->auxdev.dev) 47 48 struct ipu6_bus_device * 49 ipu6_bus_initialize_device(struct pci_dev *pdev, struct device *parent, 50 void *pdata, const struct ipu6_buttress_ctrl *ctrl, 51 char *name); 52 int ipu6_bus_add_device(struct ipu6_bus_device *adev); 53 void ipu6_bus_del_devices(struct pci_dev *pdev); 54 55 #endif 56