Files
linux-nv-oot/drivers/media/platform/tegra/cdi/cdi-dev-priv.h
Frank Chen 9ad6f3c84e media: camera: Build CDI as OOT module
Convert automotive CDI kernel driver to OOT module.

Jira CAMERASW-7592

Change-Id: Ib19ee594cc65f8041f6eba9aff7faefb753b771b
Signed-off-by: Frank Chen <frankc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2780572
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-10-04 05:17:35 -07:00

46 lines
1.1 KiB
C

// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2015-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#ifndef __CDI_DEV_PRIV_H__
#define __CDI_DEV_PRIV_H__
#include <linux/cdev.h>
#define MAX_POWER_LINKS_PER_BLOCK (4U)
struct max20087_priv {
int bus;
u32 addr;
u32 reg_len;
u32 dat_len;
u8 links[MAX_POWER_LINKS_PER_BLOCK];
};
struct cdi_dev_info {
struct i2c_client *i2c_client;
struct device *dev;
struct cdev cdev;
struct cdi_dev_platform_data *pdata;
atomic_t in_use;
struct mutex mutex;
struct cdi_dev_package rw_pkg;
struct dentry *d_entry;
u32 reg_len;
u32 reg_off;
char devname[32];
u8 power_is_on;
u8 cam_pwr_method;
u8 cam_pwr_i2c_addr;
struct max20087_priv max20087;
};
int cdi_dev_raw_rd(struct cdi_dev_info *info, unsigned int offset,
unsigned int offset_len, u8 *val, size_t size);
int cdi_dev_raw_wr(struct cdi_dev_info *info, unsigned int offset, u8 *val,
size_t size);
int cdi_dev_debugfs_init(struct cdi_dev_info *cdi_dev);
int cdi_dev_debugfs_remove(struct cdi_dev_info *cdi_dev);
#endif /* __CDI_DEV_PRIV_H__ */