summaryrefslogtreecommitdiff
path: root/src/drivers/camera/cros_camera.h
blob: f69e77d3e5086be23ef46e6e99897dfa080f6aab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef __VENDORCODE_GOOGLE_CHROMEOS_CAMERA_H
#define __VENDORCODE_GOOGLE_CHROMEOS_CAMERA_H

#include <stdint.h>

#define CROS_CAMERA_INFO_MAGIC "CrOS"
#define CROS_CAMERA_INFO_VERSION 1
#define CROS_CAMERA_INFO_SIZE_MIN 0x0a

struct cros_camera_info {
	uint8_t magic[4];  /* CROS_CAMERA_INFO_MAGIC */
	uint16_t crc16;
	uint8_t version;
	uint8_t size;
	uint16_t data_format;
	uint16_t module_pid;
	uint8_t module_vid[2];
	uint8_t sensor_vid[2];
	uint16_t sensor_pid;
};

/* Returns 0 on success, non-zero on errors. */
int check_cros_camera_info(const struct cros_camera_info *info);

#endif