linux/include/uapi/linux/media-bus-format.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
 * Media Bus API header
 *
 * Copyright (C) 2009, Guennadi Liakhovetski <[email protected]>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef __LINUX_MEDIA_BUS_FORMAT_H
#define __LINUX_MEDIA_BUS_FORMAT_H

/*
 * These bus formats uniquely identify data formats on the data bus. Format 0
 * is reserved, MEDIA_BUS_FMT_FIXED shall be used by host-client pairs, where
 * the data format is fixed. Additionally, "2X8" means that one pixel is
 * transferred in two 8-bit samples, "BE" or "LE" specify in which order those
 * samples are transferred over the bus: "LE" means that the least significant
 * bits are transferred first, "BE" means that the most significant bits are
 * transferred first, and "PADHI" and "PADLO" define which bits - low or high,
 * in the incomplete high byte, are filled with padding bits.
 *
 * The bus formats are grouped by type, bus_width, bits per component, samples
 * per pixel and order of subsamples. Numerical values are sorted using generic
 * numerical sort order (8 thus comes before 10).
 *
 * As their value can't change when a new bus format is inserted in the
 * enumeration, the bus formats are explicitly given a numerical value. The next
 * free values for each category are listed below, update them when inserting
 * new pixel codes.
 */

#define MEDIA_BUS_FMT_FIXED

/* RGB - next is	0x1026 */
#define MEDIA_BUS_FMT_RGB444_1X12
#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE
#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE
#define MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE
#define MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE
#define MEDIA_BUS_FMT_RGB565_1X16
#define MEDIA_BUS_FMT_BGR565_2X8_BE
#define MEDIA_BUS_FMT_BGR565_2X8_LE
#define MEDIA_BUS_FMT_RGB565_2X8_BE
#define MEDIA_BUS_FMT_RGB565_2X8_LE
#define MEDIA_BUS_FMT_RGB666_1X18
#define MEDIA_BUS_FMT_RGB666_2X9_BE
#define MEDIA_BUS_FMT_BGR666_1X18
#define MEDIA_BUS_FMT_RBG888_1X24
#define MEDIA_BUS_FMT_RGB666_1X24_CPADHI
#define MEDIA_BUS_FMT_BGR666_1X24_CPADHI
#define MEDIA_BUS_FMT_RGB565_1X24_CPADHI
#define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG
#define MEDIA_BUS_FMT_BGR888_1X24
#define MEDIA_BUS_FMT_BGR888_3X8
#define MEDIA_BUS_FMT_GBR888_1X24
#define MEDIA_BUS_FMT_RGB888_1X24
#define MEDIA_BUS_FMT_RGB888_2X12_BE
#define MEDIA_BUS_FMT_RGB888_2X12_LE
#define MEDIA_BUS_FMT_RGB888_3X8
#define MEDIA_BUS_FMT_RGB888_3X8_DELTA
#define MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
#define MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA
#define MEDIA_BUS_FMT_RGB666_1X30_CPADLO
#define MEDIA_BUS_FMT_RGB888_1X30_CPADLO
#define MEDIA_BUS_FMT_ARGB8888_1X32
#define MEDIA_BUS_FMT_RGB888_1X32_PADHI
#define MEDIA_BUS_FMT_RGB101010_1X30
#define MEDIA_BUS_FMT_RGB666_1X36_CPADLO
#define MEDIA_BUS_FMT_RGB888_1X36_CPADLO
#define MEDIA_BUS_FMT_RGB121212_1X36
#define MEDIA_BUS_FMT_RGB161616_1X48

/* YUV (including grey) - next is	0x202f */
#define MEDIA_BUS_FMT_Y8_1X8
#define MEDIA_BUS_FMT_UV8_1X8
#define MEDIA_BUS_FMT_UYVY8_1_5X8
#define MEDIA_BUS_FMT_VYUY8_1_5X8
#define MEDIA_BUS_FMT_YUYV8_1_5X8
#define MEDIA_BUS_FMT_YVYU8_1_5X8
#define MEDIA_BUS_FMT_UYVY8_2X8
#define MEDIA_BUS_FMT_VYUY8_2X8
#define MEDIA_BUS_FMT_YUYV8_2X8
#define MEDIA_BUS_FMT_YVYU8_2X8
#define MEDIA_BUS_FMT_Y10_1X10
#define MEDIA_BUS_FMT_Y10_2X8_PADHI_LE
#define MEDIA_BUS_FMT_UYVY10_2X10
#define MEDIA_BUS_FMT_VYUY10_2X10
#define MEDIA_BUS_FMT_YUYV10_2X10
#define MEDIA_BUS_FMT_YVYU10_2X10
#define MEDIA_BUS_FMT_Y12_1X12
#define MEDIA_BUS_FMT_UYVY12_2X12
#define MEDIA_BUS_FMT_VYUY12_2X12
#define MEDIA_BUS_FMT_YUYV12_2X12
#define MEDIA_BUS_FMT_YVYU12_2X12
#define MEDIA_BUS_FMT_Y14_1X14
#define MEDIA_BUS_FMT_Y16_1X16
#define MEDIA_BUS_FMT_UYVY8_1X16
#define MEDIA_BUS_FMT_VYUY8_1X16
#define MEDIA_BUS_FMT_YUYV8_1X16
#define MEDIA_BUS_FMT_YVYU8_1X16
#define MEDIA_BUS_FMT_YDYUYDYV8_1X16
#define MEDIA_BUS_FMT_UYVY10_1X20
#define MEDIA_BUS_FMT_VYUY10_1X20
#define MEDIA_BUS_FMT_YUYV10_1X20
#define MEDIA_BUS_FMT_YVYU10_1X20
#define MEDIA_BUS_FMT_VUY8_1X24
#define MEDIA_BUS_FMT_YUV8_1X24
#define MEDIA_BUS_FMT_UYYVYY8_0_5X24
#define MEDIA_BUS_FMT_UYVY12_1X24
#define MEDIA_BUS_FMT_VYUY12_1X24
#define MEDIA_BUS_FMT_YUYV12_1X24
#define MEDIA_BUS_FMT_YVYU12_1X24
#define MEDIA_BUS_FMT_YUV10_1X30
#define MEDIA_BUS_FMT_UYYVYY10_0_5X30
#define MEDIA_BUS_FMT_AYUV8_1X32
#define MEDIA_BUS_FMT_UYYVYY12_0_5X36
#define MEDIA_BUS_FMT_YUV12_1X36
#define MEDIA_BUS_FMT_YUV16_1X48
#define MEDIA_BUS_FMT_UYYVYY16_0_5X48

/* Bayer - next is	0x3021 */
#define MEDIA_BUS_FMT_SBGGR8_1X8
#define MEDIA_BUS_FMT_SGBRG8_1X8
#define MEDIA_BUS_FMT_SGRBG8_1X8
#define MEDIA_BUS_FMT_SRGGB8_1X8
#define MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8
#define MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8
#define MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8
#define MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8
#define MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8
#define MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8
#define MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8
#define MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8
#define MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE
#define MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE
#define MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE
#define MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE
#define MEDIA_BUS_FMT_SBGGR10_1X10
#define MEDIA_BUS_FMT_SGBRG10_1X10
#define MEDIA_BUS_FMT_SGRBG10_1X10
#define MEDIA_BUS_FMT_SRGGB10_1X10
#define MEDIA_BUS_FMT_SBGGR12_1X12
#define MEDIA_BUS_FMT_SGBRG12_1X12
#define MEDIA_BUS_FMT_SGRBG12_1X12
#define MEDIA_BUS_FMT_SRGGB12_1X12
#define MEDIA_BUS_FMT_SBGGR14_1X14
#define MEDIA_BUS_FMT_SGBRG14_1X14
#define MEDIA_BUS_FMT_SGRBG14_1X14
#define MEDIA_BUS_FMT_SRGGB14_1X14
#define MEDIA_BUS_FMT_SBGGR16_1X16
#define MEDIA_BUS_FMT_SGBRG16_1X16
#define MEDIA_BUS_FMT_SGRBG16_1X16
#define MEDIA_BUS_FMT_SRGGB16_1X16

/* JPEG compressed formats - next is	0x4002 */
#define MEDIA_BUS_FMT_JPEG_1X8

/* Vendor specific formats - next is	0x5002 */

/* S5C73M3 sensor specific interleaved UYVY and JPEG */
#define MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8

/* HSV - next is	0x6002 */
#define MEDIA_BUS_FMT_AHSV8888_1X32

/*
 * This format should be used when the same driver handles
 * both sides of the link and the bus format is a fixed
 * metadata format that is not configurable from userspace.
 * Width and height will be set to 0 for this format.
 */
#define MEDIA_BUS_FMT_METADATA_FIXED

/* Generic line based metadata formats for serial buses. Next is 0x8008. */
#define MEDIA_BUS_FMT_META_8
#define MEDIA_BUS_FMT_META_10
#define MEDIA_BUS_FMT_META_12
#define MEDIA_BUS_FMT_META_14
#define MEDIA_BUS_FMT_META_16
#define MEDIA_BUS_FMT_META_20
#define MEDIA_BUS_FMT_META_24

#endif /* __LINUX_MEDIA_BUS_FORMAT_H */