media: atmel: atmel-isc: add support for xisc
Subsystems (4)
v3 cover media: atmel: atmel-isc: add support for xisc
Hello,
This series adds support for a variant of the ISC named XISC. This block is present in the product named sama7g5.
I started by moving code around, the code which was specialized for sama5d2 type of ISC, to have it inside the dedicated sama5d2 file.
I added several new pipeline elements to the code base, which would be common to sama5d2 and the new sama7g5, but only used by the new style pipeline.
I separated the input and output formats on a per-product separate array.
I added the new sama7g5 compatible driver for the xisc, which is similar with the sama5d2, but with differences in terms of DT, clocks and callbacks to specific operations.
I converted the atmel-isc binding to yaml format, and added the new binding in yaml format.
Feedback is appreciated.
Thanks,
Eugen
Changes in v3:
- Adapted commit messages for several commits to explain several acronyms, especially for submodule names
- Converted atmel-isc binding to yaml
- Converted microchip-xisc binding to yaml
- Updated MAINTAINERS
Changes in v2:
- Fixed krobot warnings with W=1 regarding functions with no prototype
- Fixed new sama7g5 driver to use the new subdev fwnode API in kernel 5.12. my driver was based on old 5.10 style API.
Eugen Hristev (33):
media: atmel: atmel-isc: specialize gamma table into product specific
media: atmel: atmel-isc: specialize driver name constant
media: atmel: atmel-isc: add checks for limiting frame sizes
media: atmel: atmel-isc: specialize max width and max height
media: atmel: atmel-isc: specialize dma cfg
media: atmel: atmel-isc: extract CSC submodule config into separate
function
media: atmel: atmel-isc-base: add id to clock debug message
media: atmel: atmel-isc: create register offsets struct
media: atmel: atmel-isc: extract CBC submodule config into separate
function
media: atmel: atmel-isc: add CBC to the reg offsets struct
media: atmel: atmel-isc: add SUB422 and SUB420 to register offsets
media: atmel: atmel-isc: add RLP to register offsets
media: atmel: atmel-isc: add HIS to register offsets
media: atmel: atmel-isc: add DMA to register offsets
media: atmel: atmel-isc: add support for version register
media: atmel: atmel-isc: add his_entry to register offsets
media: atmel: atmel-isc: add register description for additional
modules
media: atmel: atmel-isc: extend pipeline with extra modules
media: atmel: atmel-isc: add CC initialization function
media: atmel: atmel-isc: create product specific v4l2 controls config
media: atmel: atmel-isc: create callback for DPC submodule product
specific
media: atmel: atmel-isc: create callback for GAM submodule product
specific
media: atmel: atmel-isc: create callback for RLP submodule product
specific
media: atmel: atmel-isc: move the formats list into product specific
code
media: atmel: atmel-isc: create an adapt pipeline callback for product
specific
media: atmel: atmel-isc-regs: add additional fields for sama7g5 type
pipeline
media: atmel: atmel-isc-base: add support for more formats and
additional pipeline modules
media: atmel: atmel-isc-sama5d2: remove duplicate define
dt-bindings: media: atmel-isc: convert to yaml
dt-bindings: media: add microchip,xisc device bindings
media: atmel: atmel-isc: add microchip-xisc driver
MAINTAINERS: update ISC driver bindings file
MAINTAINERS: add xisc files to isc driver entry
.../devicetree/bindings/media/atmel,isc.yaml | 115 ++++ .../devicetree/bindings/media/atmel-isc.txt | 65 -- .../bindings/media/microchip,xisc.yaml | 129 ++++ MAINTAINERS | 4 +- drivers/media/platform/Makefile | 1 + drivers/media/platform/atmel/Kconfig | 11 + drivers/media/platform/atmel/Makefile | 2 + drivers/media/platform/atmel/atmel-isc-base.c | 381 ++++------- drivers/media/platform/atmel/atmel-isc-regs.h | 133 +++- drivers/media/platform/atmel/atmel-isc.h | 122 +++- .../media/platform/atmel/atmel-sama5d2-isc.c | 311 ++++++++- .../media/platform/atmel/atmel-sama7g5-isc.c | 643 ++++++++++++++++++ 12 files changed, 1574 insertions(+), 343 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/atmel,isc.yaml delete mode 100644 Documentation/devicetree/bindings/media/atmel-isc.txt create mode 100644 Documentation/devicetree/bindings/media/microchip,xisc.yaml create mode 100644 drivers/media/platform/atmel/atmel-sama7g5-isc.c
Signature · 1 line
2.25.1
PATCH v3 1/33 media: atmel: atmel-isc: specialize gamma table into product specific
Separate the gamma table from the isc base file into the specific sama5d2 product file.
Add a pointer to the gamma table and entries count inside the platform driver specific struct.
--- drivers/media/platform/atmel/atmel-isc-base.c | 47 ++----------------- drivers/media/platform/atmel/atmel-isc.h | 11 +++-- .../media/platform/atmel/atmel-sama5d2-isc.c | 45 ++++++++++++++++++ 3 files changed, 56 insertions(+), 47 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +3 -44
@@ -176,48 +176,6 @@ struct isc_format formats_list[] = { }; -/* Gamma table with gamma 1/2.2 */ -const u32 isc_gamma_table[GAMMA_MAX +1 ][GAMMA_ENTRIES ] = { -/* 0 --> gamma 1/1.8 */ - {0x65 ,0x66002F ,0x950025 ,0xBB0020 ,0xDB001D ,0xF8001A , -0x1130018 ,0x12B0017 ,0x1420016 ,0x1580014 ,0x16D0013 ,0x1810012 , -0x1940012 ,0x1A60012 ,0x1B80011 ,0x1C90010 ,0x1DA0010 ,0x1EA000F , -0x1FA000F ,0x209000F ,0x218000F ,0x227000E ,0x235000E ,0x243000E , -0x251000E ,0x25F000D ,0x26C000D ,0x279000D ,0x286000D ,0x293000C , -0x2A0000C ,0x2AC000C ,0x2B8000C ,0x2C4000C ,0x2D0000B ,0x2DC000B , -0x2E7000B ,0x2F3000B ,0x2FE000B ,0x309000B ,0x314000B ,0x31F000A , -0x32A000A ,0x334000B ,0x33F000A ,0x349000A ,0x354000A ,0x35E000A , -0x368000A ,0x372000A ,0x37C000A ,0x386000A ,0x3900009 ,0x399000A , -0x3A30009 ,0x3AD0009 ,0x3B60009 ,0x3BF000A ,0x3C90009 ,0x3D20009 , -0x3DB0009 ,0x3E40009 ,0x3ED0009 ,0x3F60009 }, - -/* 1 --> gamma 1/2 */ - {0x7F ,0x800034 ,0xB50028 ,0xDE0021 ,0x100001E ,0x11E001B , -0x1390019 ,0x1520017 ,0x16A0015 ,0x1800014 ,0x1940014 ,0x1A80013 , -0x1BB0012 ,0x1CD0011 ,0x1DF0010 ,0x1EF0010 ,0x200000F ,0x20F000F , -0x21F000E ,0x22D000F ,0x23C000E ,0x24A000E ,0x258000D ,0x265000D , -0x273000C ,0x27F000D ,0x28C000C ,0x299000C ,0x2A5000C ,0x2B1000B , -0x2BC000C ,0x2C8000B ,0x2D3000C ,0x2DF000B ,0x2EA000A ,0x2F5000A , -0x2FF000B ,0x30A000A ,0x314000B ,0x31F000A ,0x329000A ,0x333000A , -0x33D0009 ,0x3470009 ,0x350000A ,0x35A0009 ,0x363000A ,0x36D0009 , -0x3760009 ,0x37F0009 ,0x3880009 ,0x3910009 ,0x39A0009 ,0x3A30009 , -0x3AC0008 ,0x3B40009 ,0x3BD0008 ,0x3C60008 ,0x3CE0008 ,0x3D60009 , -0x3DF0008 ,0x3E70008 ,0x3EF0008 ,0x3F70008 }, - -/* 2 --> gamma 1/2.2 */ - {0x99 ,0x9B0038 ,0xD4002A ,0xFF0023 ,0x122001F ,0x141001B , -0x15D0019 ,0x1760017 ,0x18E0015 ,0x1A30015 ,0x1B80013 ,0x1CC0012 , -0x1DE0011 ,0x1F00010 ,0x2010010 ,0x2110010 ,0x221000F ,0x230000F , -0x23F000E ,0x24D000E ,0x25B000D ,0x269000C ,0x276000C ,0x283000C , -0x28F000C ,0x29B000C ,0x2A7000C ,0x2B3000B ,0x2BF000B ,0x2CA000B , -0x2D5000B ,0x2E0000A ,0x2EB000A ,0x2F5000A ,0x2FF000A ,0x30A000A , -0x3140009 ,0x31E0009 ,0x327000A ,0x3310009 ,0x33A0009 ,0x3440009 , -0x34D0009 ,0x3560009 ,0x35F0009 ,0x3680008 ,0x3710008 ,0x3790009 , -0x3820008 ,0x38A0008 ,0x3930008 ,0x39B0008 ,0x3A30008 ,0x3AB0008 , -0x3B30008 ,0x3BB0008 ,0x3C30008 ,0x3CB0007 ,0x3D20008 ,0x3DA0007 , -0x3E20007 ,0x3E90007 ,0x3F00008 ,0x3F80007 }, -}; -#define ISC_IS_FORMAT_RAW (mbus_code) \ (((mbus_code) & 0xf000) == 0x3000)
@@ -683,7 +641,7 @@ static void isc_set_pipeline(struct isc_device *isc, u32 pipeline)regmap_write (regmap,ISC_CFA_CFG , bay_cfg |ISC_CFA_CFG_EITPOL ); - gamma = &isc_gamma_table[ctrls->gamma_index][0 ]; + gamma = &isc->gamma_table[ctrls->gamma_index][0 ];regmap_bulk_write (regmap,ISC_GAM_BENTRY , gamma,GAMMA_ENTRIES );regmap_bulk_write (regmap,ISC_GAM_GENTRY , gamma,GAMMA_ENTRIES );regmap_bulk_write (regmap,ISC_GAM_RENTRY , gamma,GAMMA_ENTRIES );
@@ -2070,7 +2028,8 @@ static int isc_ctrl_init(struct isc_device *isc)v4l2_ctrl_new_std (hdl, ops,V4L2_CID_BRIGHTNESS ,-1024 ,1023 ,1 ,0 );v4l2_ctrl_new_std (hdl, ops,V4L2_CID_CONTRAST ,-2048 ,2047 ,1 ,256 ); -v4l2_ctrl_new_std (hdl, ops,V4L2_CID_GAMMA ,0 ,GAMMA_MAX ,1 ,2 ); +v4l2_ctrl_new_std (hdl, ops,V4L2_CID_GAMMA ,0 , isc->gamma_max,1 , + isc->gamma_max); isc->awb_ctrl =v4l2_ctrl_new_std (hdl, &isc_awb_ops,V4L2_CID_AUTO_WHITE_BALANCE ,0 ,1 ,1 ,1 );
drivers/media/platform/atmel/atmel-isc.h +8 -3
@@ -187,6 +187,10 @@ struct isc_ctrls {* * @current_subdev: current subdevice: the sensor * @subdev_entities: list of subdevice entitites +* +* @gamma_table: pointer to the table with gamma values, has +* gamma_max sets of GAMMA_ENTRIES entries each +* @gamma_max: maximum number of sets of inside the gamma_table */ struct isc_device {struct regmap *regmap;
@@ -245,16 +249,17 @@ struct isc_device {struct v4l2_ctrl *gr_off_ctrl;struct v4l2_ctrl *gb_off_ctrl; }; -}; -#define GAMMA_MAX 2#define GAMMA_ENTRIES 64 +/* pointer to the defined gamma table */ +const u32 (*gamma_table)[GAMMA_ENTRIES ]; +u32 gamma_max; +};#define ATMEL_ISC_NAME "atmel-isc"extern struct isc_format formats_list[];extern const struct isc_format controller_formats[]; -extern const u32 isc_gamma_table[GAMMA_MAX +1 ][GAMMA_ENTRIES ];extern const struct regmap_config isc_regmap_config;extern const struct v4l2_async_notifier_operations isc_async_ops;
drivers/media/platform/atmel/atmel-sama5d2-isc.c +45 -0
57 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v3 2/33 media: atmel: atmel-isc: specialize driver name constant
In reply to Eugen HristevThe driver name constant must defined based on product driver, thus moving the constant directly where it's required. This will allow each ISC based product to define it's own name.
--- drivers/media/platform/atmel/atmel-isc-base.c | 4 ++-- drivers/media/platform/atmel/atmel-isc.h | 2 -- drivers/media/platform/atmel/atmel-sama5d2-isc.c | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +2 -2
@@ -896,7 +896,7 @@ static int isc_querycap(struct file *file, void *priv, {struct isc_device *isc =video_drvdata (file); -strscpy (cap->driver,ATMEL_ISC_NAME ,sizeof (cap->driver)); +strscpy (cap->driver,"microchip-isc" ,sizeof (cap->driver));strscpy (cap->card,"Atmel Image Sensor Controller" ,sizeof (cap->card));snprintf (cap->bus_info,sizeof (cap->bus_info),"platform:%s" , isc->v4l2_dev.name);
@@ -2246,7 +2246,7 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier) }/* Register video device */ -strscpy (vdev->name,ATMEL_ISC_NAME ,sizeof (vdev->name)); +strscpy (vdev->name,"microchip-isc" ,sizeof (vdev->name)); vdev->release = video_device_release_empty; vdev->fops = &isc_fops; vdev->ioctl_ops = &isc_ioctl_ops;
drivers/media/platform/atmel/atmel-isc.h +0 -2
@@ -256,8 +256,6 @@ struct isc_device {u32 gamma_max; }; -#define ATMEL_ISC_NAME "atmel-isc" -extern struct isc_format formats_list[];extern const struct isc_format controller_formats[];extern const struct regmap_config isc_regmap_config;
drivers/media/platform/atmel/atmel-sama5d2-isc.c +2 -2
@@ -185,7 +185,7 @@ static int atmel_isc_probe(struct platform_device *pdev)return irq; ret =devm_request_irq (dev, irq, isc_interrupt,0 , -ATMEL_ISC_NAME , isc); +"atmel-sama5d2-isc" , isc);if (ret <0 ) {dev_err (dev,"can't register ISR for IRQ %u (ret=%i)\n" , irq, ret);
@@ -364,7 +364,7 @@ static struct platform_driver atmel_isc_driver = { .probe = atmel_isc_probe, .remove = atmel_isc_remove, .driver = { - .name = ATMEL_ISC_NAME, + .name = "atmel-sama5d2-isc", .pm = &atmel_isc_dev_pm_ops, .of_match_table = of_match_ptr(atmel_isc_of_match), },
Signature · 1 line
2.25.1
PATCH v3 3/33 media: atmel: atmel-isc: add checks for limiting frame sizes
In reply to Eugen HristevWhen calling the subdev, certain subdev drivers will overwrite the frame size and adding sizes which are beyond the ISC's capabilities. Thus we need to ensure the frame size is cropped to the maximum caps.
--- drivers/media/platform/atmel/atmel-isc-base.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/media/platform/atmel/atmel-isc-base.c +12 -0
@@ -1326,6 +1326,12 @@ static int isc_try_fmt(struct isc_device *isc, struct v4l2_format *f,v4l2_fill_pix_format (pixfmt, &format.format); +/* Limit to Atmel ISC hardware capabilities */ +if (pixfmt->width >ISC_MAX_SUPPORT_WIDTH ) + pixfmt->width =ISC_MAX_SUPPORT_WIDTH ; +if (pixfmt->height >ISC_MAX_SUPPORT_HEIGHT ) + pixfmt->height =ISC_MAX_SUPPORT_HEIGHT ; + pixfmt->field =V4L2_FIELD_NONE ; pixfmt->bytesperline = (pixfmt->width * isc->try_config.bpp) >>3 ; pixfmt->sizeimage = pixfmt->bytesperline * pixfmt->height;
@@ -1361,6 +1367,12 @@ static int isc_set_fmt(struct isc_device *isc, struct v4l2_format *f)if (ret <0 )return ret; +/* Limit to Atmel ISC hardware capabilities */ +if (pixfmt->width >ISC_MAX_SUPPORT_WIDTH ) + pixfmt->width =ISC_MAX_SUPPORT_WIDTH ; +if (pixfmt->height >ISC_MAX_SUPPORT_HEIGHT ) + pixfmt->height =ISC_MAX_SUPPORT_HEIGHT ; + isc->fmt = *f; if (isc->try_config.sd_format && isc->config.sd_format &&
Signature · 1 line
2.25.1
PATCH v3 4/33 media: atmel: atmel-isc: specialize max width and max height
In reply to Eugen HristevMove the max width and max height constants to the product specific driver and have them in the device struct.
--- drivers/media/platform/atmel/atmel-isc-base.c | 28 +++++++++---------- drivers/media/platform/atmel/atmel-isc.h | 9 ++++-- .../media/platform/atmel/atmel-sama5d2-isc.c | 7 +++-- 3 files changed, 25 insertions(+), 19 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +14 -14
@@ -1204,8 +1204,8 @@ static void isc_try_fse(struct isc_device *isc,* just use the maximum ISC can receive. */ if (ret) { - pad_cfg->try_crop.width =ISC_MAX_SUPPORT_WIDTH ; - pad_cfg->try_crop.height =ISC_MAX_SUPPORT_HEIGHT ; + pad_cfg->try_crop.width = isc->max_width; + pad_cfg->try_crop.height = isc->max_height; }else { pad_cfg->try_crop.width = fse.max_width; pad_cfg->try_crop.height = fse.max_height;
@@ -1282,10 +1282,10 @@ static int isc_try_fmt(struct isc_device *isc, struct v4l2_format *f, isc->try_config.sd_format = sd_fmt;/* Limit to Atmel ISC hardware capabilities */ -if (pixfmt->width >ISC_MAX_SUPPORT_WIDTH ) - pixfmt->width =ISC_MAX_SUPPORT_WIDTH ; -if (pixfmt->height >ISC_MAX_SUPPORT_HEIGHT ) - pixfmt->height =ISC_MAX_SUPPORT_HEIGHT ; +if (pixfmt->width > isc->max_width) + pixfmt->width = isc->max_width; +if (pixfmt->height > isc->max_height) + pixfmt->height = isc->max_height;/* * The mbus format is the one the subdev outputs.
@@ -1327,10 +1327,10 @@ static int isc_try_fmt(struct isc_device *isc, struct v4l2_format *f,v4l2_fill_pix_format (pixfmt, &format.format);/* Limit to Atmel ISC hardware capabilities */ -if (pixfmt->width >ISC_MAX_SUPPORT_WIDTH ) - pixfmt->width =ISC_MAX_SUPPORT_WIDTH ; -if (pixfmt->height >ISC_MAX_SUPPORT_HEIGHT ) - pixfmt->height =ISC_MAX_SUPPORT_HEIGHT ; +if (pixfmt->width > isc->max_width) + pixfmt->width = isc->max_width; +if (pixfmt->height > isc->max_height) + pixfmt->height = isc->max_height; pixfmt->field =V4L2_FIELD_NONE ; pixfmt->bytesperline = (pixfmt->width * isc->try_config.bpp) >>3 ;
@@ -1368,10 +1368,10 @@ static int isc_set_fmt(struct isc_device *isc, struct v4l2_format *f)return ret;/* Limit to Atmel ISC hardware capabilities */ -if (pixfmt->width >ISC_MAX_SUPPORT_WIDTH ) - pixfmt->width =ISC_MAX_SUPPORT_WIDTH ; -if (pixfmt->height >ISC_MAX_SUPPORT_HEIGHT ) - pixfmt->height =ISC_MAX_SUPPORT_HEIGHT ; +if (f->fmt.pix.width > isc->max_width) + f->fmt.pix.width = isc->max_width; +if (f->fmt.pix.height > isc->max_height) + f->fmt.pix.height = isc->max_height; isc->fmt = *f;
drivers/media/platform/atmel/atmel-isc.h +6 -3
@@ -10,9 +10,6 @@*/ #ifndef _ATMEL_ISC_H_ -#define ISC_MAX_SUPPORT_WIDTH 2592 -#define ISC_MAX_SUPPORT_HEIGHT 1944 -#define ISC_CLK_MAX_DIV 255 enum isc_clk_id {
@@ -191,6 +188,9 @@ struct isc_ctrls {* @gamma_table: pointer to the table with gamma values, has * gamma_max sets of GAMMA_ENTRIES entries each * @gamma_max: maximum number of sets of inside the gamma_table +* +* @max_width: maximum frame width, dependent on the internal RAM +* @max_height: maximum frame height, dependent on the internal RAM */ struct isc_device {struct regmap *regmap;
@@ -254,6 +254,9 @@ struct isc_device {/* pointer to the defined gamma table */ const u32 (*gamma_table)[GAMMA_ENTRIES ];u32 gamma_max; + +u32 max_width; +u32 max_height; };extern struct isc_format formats_list[];
drivers/media/platform/atmel/atmel-sama5d2-isc.c +5 -2
@@ -49,8 +49,8 @@#include "atmel-isc-regs.h" #include "atmel-isc.h" -#define ISC_MAX_SUPPORT_WIDTH 2592 -#define ISC_MAX_SUPPORT_HEIGHT 1944 +#define ISC_SAMA5D2_MAX_SUPPORT_WIDTH 2592 +#define ISC_SAMA5D2_MAX_SUPPORT_HEIGHT 1944#define ISC_CLK_MAX_DIV 255
@@ -195,6 +195,9 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->gamma_table = isc_sama5d2_gamma_table; isc->gamma_max =2 ; + isc->max_width =ISC_SAMA5D2_MAX_SUPPORT_WIDTH ; + isc->max_height =ISC_SAMA5D2_MAX_SUPPORT_HEIGHT ; + ret =isc_pipeline_init (isc);if (ret)return ret;
Signature · 1 line
2.25.1
PATCH v3 5/33 media: atmel: atmel-isc: specialize dma cfg
In reply to Eugen HristevThe dma configuration (DCFG) is specific to the product. Move this configuration in the product specific driver, and add the field inside the driver struct.
--- drivers/media/platform/atmel/atmel-isc-base.c | 3 +-- drivers/media/platform/atmel/atmel-isc.h | 2 ++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +1 -2
@@ -716,8 +716,7 @@ static int isc_configure(struct isc_device *isc) rlp_mode = isc->config.rlp_cfg_mode; pipeline = isc->config.bits_pipeline; - dcfg = isc->config.dcfg_imode | -ISC_DCFG_YMBSIZE_BEATS8 |ISC_DCFG_CMBSIZE_BEATS8 ; + dcfg = isc->config.dcfg_imode | isc->dcfg; pfe_cfg0 |= subdev->pfe_cfg0 |ISC_PFE_CFG0_MODE_PROGRESSIVE ; mask = ISC_PFE_CFG0_BPS_MASK | ISC_PFE_CFG0_HPOL_LOW |
drivers/media/platform/atmel/atmel-isc.h +2 -0
@@ -150,6 +150,7 @@ struct isc_ctrls {* @hclock: Hclock clock input (refer datasheet) * @ispck: iscpck clock (refer datasheet) * @isc_clks: ISC clocks +* @dcfg: DMA master configuration, architecture dependent * * @dev: Registered device driver * @v4l2_dev: v4l2 registered device
@@ -197,6 +198,7 @@ struct isc_device {struct clk *hclock;struct clk *ispck;struct isc_clk isc_clks[2 ]; +u32 dcfg;struct device *dev;struct v4l2_device v4l2_dev;
drivers/media/platform/atmel/atmel-sama5d2-isc.c +3 -0
@@ -198,6 +198,9 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->max_width =ISC_SAMA5D2_MAX_SUPPORT_WIDTH ; isc->max_height =ISC_SAMA5D2_MAX_SUPPORT_HEIGHT ; +/* sama5d2-isc - 8 bits per beat */ + isc->dcfg =ISC_DCFG_YMBSIZE_BEATS8 |ISC_DCFG_CMBSIZE_BEATS8 ; + ret =isc_pipeline_init (isc);if (ret)return ret;
Signature · 1 line
2.25.1
PATCH v3 6/33 media: atmel: atmel-isc: extract CSC submodule config into separate function
In reply to Eugen HristevThe CSC submodule is a part of the atmel-isc pipeline, and stands for Color Space Conversion. It is used to apply a matrix transformation to RGB pixels to convert them to the YUV components.
The CSC submodule should be initialized in the product specific driver as it's product specific. Other products can implement it differently.
---
Changes in v3:
- added explanation regarding CSC acronym Changes in v2:
- addded function prototype to avoid warning with W=1
drivers/media/platform/atmel/atmel-isc-base.c | 8 +------- drivers/media/platform/atmel/atmel-isc.h | 7 +++++++ .../media/platform/atmel/atmel-sama5d2-isc.c | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 7 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +1 -7
@@ -646,13 +646,7 @@ static void isc_set_pipeline(struct isc_device *isc, u32 pipeline)regmap_bulk_write (regmap,ISC_GAM_GENTRY , gamma,GAMMA_ENTRIES );regmap_bulk_write (regmap,ISC_GAM_RENTRY , gamma,GAMMA_ENTRIES ); -/* Convert RGB to YUV */ -regmap_write (regmap,ISC_CSC_YR_YG ,0x42 | (0x81 <<16 )); -regmap_write (regmap,ISC_CSC_YB_OY ,0x19 | (0x10 <<16 )); -regmap_write (regmap,ISC_CSC_CBR_CBG ,0xFDA | (0xFB6 <<16 )); -regmap_write (regmap,ISC_CSC_CBB_OCB ,0x70 | (0x80 <<16 )); -regmap_write (regmap,ISC_CSC_CRR_CRG ,0x70 | (0xFA2 <<16 )); -regmap_write (regmap,ISC_CSC_CRB_OCR ,0xFEE | (0x80 <<16 )); + isc->config_csc (isc);regmap_write (regmap,ISC_CBC_BRIGHT , ctrls->brightness);regmap_write (regmap,ISC_CBC_CONTRAST , ctrls->contrast);
drivers/media/platform/atmel/atmel-isc.h +7 -0
@@ -192,6 +192,9 @@ struct isc_ctrls {* * @max_width: maximum frame width, dependent on the internal RAM * @max_height: maximum frame height, dependent on the internal RAM +* +* @config_csc: pointer to a function that initializes product +* specific CSC module */ struct isc_device {struct regmap *regmap;
@@ -259,6 +262,10 @@ struct isc_device {u32 max_width;u32 max_height; + +struct { +void (*config_csc)(struct isc_device *isc); + }; };extern struct isc_format formats_list[];
drivers/media/platform/atmel/atmel-sama5d2-isc.c +17 -0
@@ -54,6 +54,21 @@#define ISC_CLK_MAX_DIV 255 +void isc_sama5d2_config_csc (struct isc_device *isc); + +void isc_sama5d2_config_csc (struct isc_device *isc) +{ +struct regmap *regmap = isc->regmap; + +/* Convert RGB to YUV */ +regmap_write (regmap,ISC_CSC_YR_YG ,0x42 | (0x81 <<16 )); +regmap_write (regmap,ISC_CSC_YB_OY ,0x19 | (0x10 <<16 )); +regmap_write (regmap,ISC_CSC_CBR_CBG ,0xFDA | (0xFB6 <<16 )); +regmap_write (regmap,ISC_CSC_CBB_OCB ,0x70 | (0x80 <<16 )); +regmap_write (regmap,ISC_CSC_CRR_CRG ,0x70 | (0xFA2 <<16 )); +regmap_write (regmap,ISC_CSC_CRB_OCR ,0xFEE | (0x80 <<16 )); +} +/* Gamma table with gamma 1/2.2 */ const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES ] = {/* 0 --> gamma 1/1.8 */
@@ -198,6 +213,8 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->max_width =ISC_SAMA5D2_MAX_SUPPORT_WIDTH ; isc->max_height =ISC_SAMA5D2_MAX_SUPPORT_HEIGHT ; + isc->config_csc = isc_sama5d2_config_csc; +/* sama5d2-isc - 8 bits per beat */ isc->dcfg =ISC_DCFG_YMBSIZE_BEATS8 |ISC_DCFG_CMBSIZE_BEATS8 ;
Signature · 1 line
2.25.1
PATCH v3 7/33 media: atmel: atmel-isc-base: add id to clock debug message
In reply to Eugen HristevAdd the clock id to the debug message regarding clock setup
--- drivers/media/platform/atmel/atmel-isc-base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +2 -2
@@ -277,8 +277,8 @@ static int isc_clk_enable(struct clk_hw *hw)unsigned long flags;unsigned int status; -dev_dbg (isc_clk->dev,"ISC CLK: %s, div = %d, parent id = %d\n" , - __func__, isc_clk->div, isc_clk->parent_id); +dev_dbg (isc_clk->dev,"ISC CLK: %s, id = %d, div = %d, parent id = %d\n" , + __func__, id, isc_clk->div, isc_clk->parent_id);spin_lock_irqsave (&isc_clk->lock, flags); regmap_update_bits(regmap, ISC_CLKCFG,
Signature · 1 line
2.25.1
PATCH v3 8/33 media: atmel: atmel-isc: create register offsets struct
In reply to Eugen HristevCreate a struct that holds register offsets that are product specific. Add initially the CSC register.
This allows each product that contains a variant of the ISC to add their own register offset.
--- drivers/media/platform/atmel/atmel-isc-base.c | 2 +- drivers/media/platform/atmel/atmel-isc-regs.h | 3 +++ drivers/media/platform/atmel/atmel-isc.h | 12 +++++++++++ .../media/platform/atmel/atmel-sama5d2-isc.c | 20 +++++++++++++------ 4 files changed, 30 insertions(+), 7 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +1 -1
@@ -2311,7 +2311,7 @@ int isc_pipeline_init(struct isc_device *isc)REG_FIELD (ISC_GAM_CTRL ,1 ,1 ),REG_FIELD (ISC_GAM_CTRL ,2 ,2 ),REG_FIELD (ISC_GAM_CTRL ,3 ,3 ), -REG_FIELD (ISC_CSC_CTRL ,0 ,0 ), +REG_FIELD (ISC_CSC_CTRL + isc->offsets.csc,0 ,0 ),REG_FIELD (ISC_CBC_CTRL ,0 ,0 ),REG_FIELD (ISC_SUB422_CTRL ,0 ,0 ), REG_FIELD(ISC_SUB420_CTRL, 0, 0),
drivers/media/platform/atmel/atmel-isc-regs.h +3 -0
@@ -153,6 +153,9 @@/* ISC_Gamma Correction Green Entry Register */ #define ISC_GAM_RENTRY 0x00000298 +/* Offset for CSC register specific to sama5d2 product */ +#define ISC_SAMA5D2_CSC_OFFSET 0 +/* Color Space Conversion Control Register */ #define ISC_CSC_CTRL 0x00000398
drivers/media/platform/atmel/atmel-isc.h +12 -0
@@ -144,6 +144,14 @@ struct isc_ctrls {#define ISC_PIPE_LINE_NODE_NUM 11 +/* +* struct isc_reg_offsets - ISC device register offsets +* @csc: Offset for the CSC register +*/ +struct isc_reg_offsets { +u32 csc; +}; +/* * struct isc_device - ISC device driver data/config struct * @regmap: Register map
@@ -195,6 +203,8 @@ struct isc_ctrls {* * @config_csc: pointer to a function that initializes product * specific CSC module +* +* @offsets: struct holding the product specific register offsets */ struct isc_device {struct regmap *regmap;
@@ -266,6 +276,8 @@ struct isc_device {struct {void (*config_csc)(struct isc_device *isc); }; + +struct isc_reg_offsets offsets; };extern struct isc_format formats_list[];
drivers/media/platform/atmel/atmel-sama5d2-isc.c +14 -6
@@ -61,12 +61,18 @@ void isc_sama5d2_config_csc(struct isc_device *isc)struct regmap *regmap = isc->regmap;/* Convert RGB to YUV */ -regmap_write (regmap,ISC_CSC_YR_YG ,0x42 | (0x81 <<16 )); -regmap_write (regmap,ISC_CSC_YB_OY ,0x19 | (0x10 <<16 )); -regmap_write (regmap,ISC_CSC_CBR_CBG ,0xFDA | (0xFB6 <<16 )); -regmap_write (regmap,ISC_CSC_CBB_OCB ,0x70 | (0x80 <<16 )); -regmap_write (regmap,ISC_CSC_CRR_CRG ,0x70 | (0xFA2 <<16 )); -regmap_write (regmap,ISC_CSC_CRB_OCR ,0xFEE | (0x80 <<16 )); +regmap_write (regmap,ISC_CSC_YR_YG + isc->offsets.csc, +0x42 | (0x81 <<16 )); +regmap_write (regmap,ISC_CSC_YB_OY + isc->offsets.csc, +0x19 | (0x10 <<16 )); +regmap_write (regmap,ISC_CSC_CBR_CBG + isc->offsets.csc, +0xFDA | (0xFB6 <<16 )); +regmap_write (regmap,ISC_CSC_CBB_OCB + isc->offsets.csc, +0x70 | (0x80 <<16 )); +regmap_write (regmap,ISC_CSC_CRR_CRG + isc->offsets.csc, +0x70 | (0xFA2 <<16 )); +regmap_write (regmap,ISC_CSC_CRB_OCR + isc->offsets.csc, +0xFEE | (0x80 <<16 )); }/* Gamma table with gamma 1/2.2 */
@@ -215,6 +221,8 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->config_csc = isc_sama5d2_config_csc; + isc->offsets.csc =ISC_SAMA5D2_CSC_OFFSET ; +/* sama5d2-isc - 8 bits per beat */ isc->dcfg =ISC_DCFG_YMBSIZE_BEATS8 |ISC_DCFG_CMBSIZE_BEATS8 ;
Signature · 1 line
2.25.1
PATCH v3 9/33 media: atmel: atmel-isc: extract CBC submodule config into separate function
In reply to Eugen HristevThe CBC submodule is a part of the atmel-isc pipeline, and stands for Contrast Brightness Control. It is used to apply gains and offsets to the luma (Y) and chroma (U, V) components of the YUV elements. The CBC submodule should be initialized in the product specific driver as it's product specific. Other products can implement it differently
---
Changes in v3:
- added module description explanation Changes in v2:
- addded function prototype to avoid warning with W=1
drivers/media/platform/atmel/atmel-isc-base.c | 4 +--- drivers/media/platform/atmel/atmel-isc.h | 3 +++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 10 ++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +1 -3
@@ -647,9 +647,7 @@ static void isc_set_pipeline(struct isc_device *isc, u32 pipeline)regmap_bulk_write (regmap,ISC_GAM_RENTRY , gamma,GAMMA_ENTRIES ); isc->config_csc (isc); - -regmap_write (regmap,ISC_CBC_BRIGHT , ctrls->brightness); -regmap_write (regmap,ISC_CBC_CONTRAST , ctrls->contrast); + isc->config_cbc (isc); }static int isc_update_profile (struct isc_device *isc)
drivers/media/platform/atmel/atmel-isc.h +3 -0
@@ -203,6 +203,8 @@ struct isc_reg_offsets {* * @config_csc: pointer to a function that initializes product * specific CSC module +* @config_cbc: pointer to a function that initializes product +* specific CBC module * * @offsets: struct holding the product specific register offsets */
@@ -275,6 +277,7 @@ struct isc_device {struct {void (*config_csc)(struct isc_device *isc); +void (*config_cbc)(struct isc_device *isc); };struct isc_reg_offsets offsets;
drivers/media/platform/atmel/atmel-sama5d2-isc.c +10 -0
@@ -55,6 +55,7 @@#define ISC_CLK_MAX_DIV 255void isc_sama5d2_config_csc (struct isc_device *isc); +void isc_sama5d2_config_cbc (struct isc_device *isc);void isc_sama5d2_config_csc (struct isc_device *isc) {
@@ -75,6 +76,14 @@ void isc_sama5d2_config_csc(struct isc_device *isc) 0xFEE | (0x80 << 16)); } +void isc_sama5d2_config_cbc (struct isc_device *isc) +{ +struct regmap *regmap = isc->regmap; + +regmap_write (regmap,ISC_CBC_BRIGHT , isc->ctrls.brightness); +regmap_write (regmap,ISC_CBC_CONTRAST , isc->ctrls.contrast); +} +/* Gamma table with gamma 1/2.2 */ const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES ] = {/* 0 --> gamma 1/1.8 */
@@ -220,6 +229,7 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->max_height =ISC_SAMA5D2_MAX_SUPPORT_HEIGHT ; isc->config_csc = isc_sama5d2_config_csc; + isc->config_cbc = isc_sama5d2_config_cbc; isc->offsets.csc =ISC_SAMA5D2_CSC_OFFSET ;
Signature · 1 line
2.25.1
PATCH v3 10/33 media: atmel: atmel-isc: add CBC to the reg offsets struct
In reply to Eugen HristevThe CBC submodule is a part of the atmel-isc pipeline, and stands for Contrast Brightness Control. It is used to apply gains and offsets to the luma (Y) and chroma (U, V) components of the YUV elements. Add cbc to the reg offsets struct. This will allow different products to have a different reg offset for this particular module.
---
Changes in v3:
- add module explanation in commit message
drivers/media/platform/atmel/atmel-isc-base.c | 2 +- drivers/media/platform/atmel/atmel-isc-regs.h | 3 +++ drivers/media/platform/atmel/atmel-isc.h | 2 ++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 7 +++++-- 4 files changed, 11 insertions(+), 3 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +1 -1
@@ -2310,7 +2310,7 @@ int isc_pipeline_init(struct isc_device *isc)REG_FIELD (ISC_GAM_CTRL ,2 ,2 ),REG_FIELD (ISC_GAM_CTRL ,3 ,3 ),REG_FIELD (ISC_CSC_CTRL + isc->offsets.csc,0 ,0 ), -REG_FIELD (ISC_CBC_CTRL ,0 ,0 ), +REG_FIELD (ISC_CBC_CTRL + isc->offsets.cbc,0 ,0 ),REG_FIELD (ISC_SUB422_CTRL ,0 ,0 ), REG_FIELD(ISC_SUB420_CTRL, 0, 0), };
drivers/media/platform/atmel/atmel-isc-regs.h +3 -0
@@ -177,6 +177,9 @@/* Color Space Conversion CRB OCR Register */ #define ISC_CSC_CRB_OCR 0x000003b0 +/* Offset for CBC register specific to sama5d2 product */ +#define ISC_SAMA5D2_CBC_OFFSET 0 +/* Contrast And Brightness Control Register */ #define ISC_CBC_CTRL 0x000003b4
drivers/media/platform/atmel/atmel-isc.h +2 -0
@@ -147,9 +147,11 @@ struct isc_ctrls {/* * struct isc_reg_offsets - ISC device register offsets * @csc: Offset for the CSC register +* @cbc: Offset for the CBC register */ struct isc_reg_offsets {u32 csc; +u32 cbc; };/*
drivers/media/platform/atmel/atmel-sama5d2-isc.c +5 -2
@@ -80,8 +80,10 @@ void isc_sama5d2_config_cbc(struct isc_device *isc) {struct regmap *regmap = isc->regmap; -regmap_write (regmap,ISC_CBC_BRIGHT , isc->ctrls.brightness); -regmap_write (regmap,ISC_CBC_CONTRAST , isc->ctrls.contrast); +regmap_write (regmap,ISC_CBC_BRIGHT + isc->offsets.cbc, + isc->ctrls.brightness); +regmap_write (regmap,ISC_CBC_CONTRAST + isc->offsets.cbc, + isc->ctrls.contrast); }/* Gamma table with gamma 1/2.2 */
@@ -232,6 +234,7 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->config_cbc = isc_sama5d2_config_cbc; isc->offsets.csc =ISC_SAMA5D2_CSC_OFFSET ; + isc->offsets.cbc =ISC_SAMA5D2_CBC_OFFSET ;/* sama5d2-isc - 8 bits per beat */ isc->dcfg =ISC_DCFG_YMBSIZE_BEATS8 |ISC_DCFG_CMBSIZE_BEATS8 ;
Signature · 1 line
2.25.1
PATCH v3 11/33 media: atmel: atmel-isc: add SUB422 and SUB420 to register offsets
In reply to Eugen HristevThe SUB submodules are a part of the atmel-isc pipeline, and stand for Subsampling. They are used to subsample the original YUV 4:4:4 pixel ratio aspect to either 4:2:2 or 4:2:0.
Add sub420 and sub422 to the reg offsets struct.
This will allow different products to have a different reg offset for these particular modules.
---
Changes in v3:
- add module explanation in commit message
drivers/media/platform/atmel/atmel-isc-base.c | 4 ++-- drivers/media/platform/atmel/atmel-isc-regs.h | 4 ++++ drivers/media/platform/atmel/atmel-isc.h | 4 ++++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +2 -2
@@ -2311,8 +2311,8 @@ int isc_pipeline_init(struct isc_device *isc)REG_FIELD (ISC_GAM_CTRL ,3 ,3 ),REG_FIELD (ISC_CSC_CTRL + isc->offsets.csc,0 ,0 ),REG_FIELD (ISC_CBC_CTRL + isc->offsets.cbc,0 ,0 ), -REG_FIELD (ISC_SUB422_CTRL ,0 ,0 ), - REG_FIELD(ISC_SUB420_CTRL, 0, 0), +REG_FIELD (ISC_SUB422_CTRL + isc->offsets.sub422,0 ,0 ), + REG_FIELD(ISC_SUB420_CTRL + isc->offsets.sub420, 0, 0), };for (i =0 ; i <ISC_PIPE_LINE_NODE_NUM ; i++) {
drivers/media/platform/atmel/atmel-isc-regs.h +4 -0
@@ -194,9 +194,13 @@#define ISC_CBC_CONTRAST 0x000003c0#define ISC_CBC_CONTRAST_MASK GENMASK(11, 0) +/* Offset for SUB422 register specific to sama5d2 product */ +#define ISC_SAMA5D2_SUB422_OFFSET 0/* Subsampling 4:4:4 to 4:2:2 Control Register */ #define ISC_SUB422_CTRL 0x000003c4 +/* Offset for SUB420 register specific to sama5d2 product */ +#define ISC_SAMA5D2_SUB420_OFFSET 0/* Subsampling 4:2:2 to 4:2:0 Control Register */ #define ISC_SUB420_CTRL 0x000003cc
drivers/media/platform/atmel/atmel-isc.h +4 -0
@@ -148,10 +148,14 @@ struct isc_ctrls {* struct isc_reg_offsets - ISC device register offsets * @csc: Offset for the CSC register * @cbc: Offset for the CBC register +* @sub422: Offset for the SUB422 register +* @sub420: Offset for the SUB420 register */ struct isc_reg_offsets {u32 csc;u32 cbc; +u32 sub422; +u32 sub420; };/*
drivers/media/platform/atmel/atmel-sama5d2-isc.c +2 -0
@@ -235,6 +235,8 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->offsets.csc =ISC_SAMA5D2_CSC_OFFSET ; isc->offsets.cbc =ISC_SAMA5D2_CBC_OFFSET ; + isc->offsets.sub422 =ISC_SAMA5D2_SUB422_OFFSET ; + isc->offsets.sub420 =ISC_SAMA5D2_SUB420_OFFSET ;/* sama5d2-isc - 8 bits per beat */ isc->dcfg =ISC_DCFG_YMBSIZE_BEATS8 |ISC_DCFG_CMBSIZE_BEATS8 ;
Signature · 1 line
2.25.1
PATCH v3 12/33 media: atmel: atmel-isc: add RLP to register offsets
In reply to Eugen HristevThe RLP submodule is a part of the atmel-isc pipeline, and stands for Rounding,Limiting and Packaging. It used to extract specific data from the ISC pipeline. For example if we want to output greyscale 8 bit, we would use limiting to 8 bits, and packaging to Luma component only. Add rlp to the reg offsets struct.
This will allow different products to have a different reg offset for this particular module.
---
Changes in v3:
- add module description in commit message
drivers/media/platform/atmel/atmel-isc-base.c | 4 ++-- drivers/media/platform/atmel/atmel-isc-regs.h | 2 ++ drivers/media/platform/atmel/atmel-isc.h | 2 ++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 1 + 4 files changed, 7 insertions(+), 2 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +2 -2
@@ -718,8 +718,8 @@ static int isc_configure(struct isc_device *isc)regmap_update_bits (regmap,ISC_PFE_CFG0 , mask, pfe_cfg0); -regmap_update_bits (regmap,ISC_RLP_CFG ,ISC_RLP_CFG_MODE_MASK , - rlp_mode); +regmap_update_bits (regmap,ISC_RLP_CFG + isc->offsets.rlp, +ISC_RLP_CFG_MODE_MASK , rlp_mode);regmap_write (regmap,ISC_DCFG , dcfg);
drivers/media/platform/atmel/atmel-isc-regs.h +2 -0
@@ -204,6 +204,8 @@/* Subsampling 4:2:2 to 4:2:0 Control Register */ #define ISC_SUB420_CTRL 0x000003cc +/* Offset for RLP register specific to sama5d2 product */ +#define ISC_SAMA5D2_RLP_OFFSET 0/* Rounding, Limiting and Packing Configuration Register */ #define ISC_RLP_CFG 0x000003d0
drivers/media/platform/atmel/atmel-isc.h +2 -0
@@ -150,12 +150,14 @@ struct isc_ctrls {* @cbc: Offset for the CBC register * @sub422: Offset for the SUB422 register * @sub420: Offset for the SUB420 register +* @rlp: Offset for the RLP register */ struct isc_reg_offsets {u32 csc;u32 cbc;u32 sub422;u32 sub420; +u32 rlp; };/*
drivers/media/platform/atmel/atmel-sama5d2-isc.c +1 -0
@@ -237,6 +237,7 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->offsets.cbc =ISC_SAMA5D2_CBC_OFFSET ; isc->offsets.sub422 =ISC_SAMA5D2_SUB422_OFFSET ; isc->offsets.sub420 =ISC_SAMA5D2_SUB420_OFFSET ; + isc->offsets.rlp =ISC_SAMA5D2_RLP_OFFSET ;/* sama5d2-isc - 8 bits per beat */ isc->dcfg =ISC_DCFG_YMBSIZE_BEATS8 |ISC_DCFG_CMBSIZE_BEATS8 ;
Signature · 1 line
2.25.1
PATCH v3 13/33 media: atmel: atmel-isc: add HIS to register offsets
In reply to Eugen HristevThe HIS submodule is a part of the atmel-isc pipeline, and stands for Histogram. This module performs a color histogram that can be read and used by the main processor.
Add his to the reg offsets struct.
This will allow different products to have a different reg offset for this particular module.
---
Changes in v3:
- added module description in commit message
drivers/media/platform/atmel/atmel-isc-base.c | 11 +++++++---- drivers/media/platform/atmel/atmel-isc-regs.h | 2 ++ drivers/media/platform/atmel/atmel-isc.h | 2 ++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 1 + 4 files changed, 12 insertions(+), 4 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +7 -4
@@ -678,12 +678,13 @@ static void isc_set_histogram(struct isc_device *isc, bool enable)struct isc_ctrls *ctrls = &isc->ctrls;if (enable) { -regmap_write (regmap,ISC_HIS_CFG , +regmap_write (regmap,ISC_HIS_CFG + isc->offsets.his,ISC_HIS_CFG_MODE_GR | (isc->config.sd_format->cfa_baycfg <<ISC_HIS_CFG_BAYSEL_SHIFT ) |ISC_HIS_CFG_RAR ); -regmap_write (regmap,ISC_HIS_CTRL ,ISC_HIS_CTRL_EN ); +regmap_write (regmap,ISC_HIS_CTRL + isc->offsets.his, +ISC_HIS_CTRL_EN );regmap_write (regmap,ISC_INTEN ,ISC_INT_HISDONE ); ctrls->hist_id =ISC_HIS_CFG_MODE_GR ;isc_update_profile (isc);
@@ -692,7 +693,8 @@ static void isc_set_histogram(struct isc_device *isc, bool enable) ctrls->hist_stat =HIST_ENABLED ; }else {regmap_write (regmap,ISC_INTDIS ,ISC_INT_HISDONE ); -regmap_write (regmap,ISC_HIS_CTRL ,ISC_HIS_CTRL_DIS ); +regmap_write (regmap,ISC_HIS_CTRL + isc->offsets.his, +ISC_HIS_CTRL_DIS ); ctrls->hist_stat =HIST_DISABLED ; }
@@ -1821,7 +1823,8 @@ static void isc_awb_work(struct work_struct *w) ctrls->awb =ISC_WB_NONE ; } } -regmap_write (regmap,ISC_HIS_CFG , hist_id | baysel |ISC_HIS_CFG_RAR ); +regmap_write (regmap,ISC_HIS_CFG + isc->offsets.his, + hist_id | baysel |ISC_HIS_CFG_RAR );isc_update_profile (isc);/* if awb has been disabled, we don't need to start another histogram */ if (ctrls->awb)
drivers/media/platform/atmel/atmel-isc-regs.h +2 -0
@@ -224,6 +224,8 @@#define ISC_RLP_CFG_MODE_YYCC_LIMITED 0xc#define ISC_RLP_CFG_MODE_MASK GENMASK(3, 0) +/* Offset for HIS register specific to sama5d2 product */ +#define ISC_SAMA5D2_HIS_OFFSET 0/* Histogram Control Register */ #define ISC_HIS_CTRL 0x000003d4
drivers/media/platform/atmel/atmel-isc.h +2 -0
@@ -151,6 +151,7 @@ struct isc_ctrls {* @sub422: Offset for the SUB422 register * @sub420: Offset for the SUB420 register * @rlp: Offset for the RLP register +* @his: Offset for the HIS related registers */ struct isc_reg_offsets {u32 csc;
@@ -158,6 +159,7 @@ struct isc_reg_offsets {u32 sub422;u32 sub420;u32 rlp; +u32 his; };/*
drivers/media/platform/atmel/atmel-sama5d2-isc.c +1 -0
@@ -238,6 +238,7 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->offsets.sub422 =ISC_SAMA5D2_SUB422_OFFSET ; isc->offsets.sub420 =ISC_SAMA5D2_SUB420_OFFSET ; isc->offsets.rlp =ISC_SAMA5D2_RLP_OFFSET ; + isc->offsets.his =ISC_SAMA5D2_HIS_OFFSET ;/* sama5d2-isc - 8 bits per beat */ isc->dcfg =ISC_DCFG_YMBSIZE_BEATS8 |ISC_DCFG_CMBSIZE_BEATS8 ;
Signature · 1 line
2.25.1
PATCH v3 14/33 media: atmel: atmel-isc: add DMA to register offsets
In reply to Eugen HristevThe DMA submodule is a part of the atmel-isc pipeline, and stands for Direct Memory Access. It acts like a master on the AXI bus of the SoC, and can directly write the RAM area with the pixel data from the ISC internal sram.
Add dma to the reg offsets struct.
This will allow different products to have a different reg offset for this particular module.
---
Changes in v3:
- added module explanation in commit message
drivers/media/platform/atmel/atmel-isc-base.c | 19 ++++++++++++------- drivers/media/platform/atmel/atmel-isc-regs.h | 3 +++ drivers/media/platform/atmel/atmel-isc.h | 2 ++ .../media/platform/atmel/atmel-sama5d2-isc.c | 1 + 4 files changed, 18 insertions(+), 7 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +12 -7
@@ -593,16 +593,20 @@ static void isc_start_dma(struct isc_device *isc) ISC_PFE_CFG0_COLEN | ISC_PFE_CFG0_ROWEN); addr0 =vb2_dma_contig_plane_dma_addr (&isc->cur_frm->vb.vb2_buf,0 ); -regmap_write (regmap,ISC_DAD0 , addr0); +regmap_write (regmap,ISC_DAD0 + isc->offsets.dma, addr0);switch (isc->config.fourcc) {case V4L2_PIX_FMT_YUV420 : -regmap_write (regmap,ISC_DAD1 , addr0 + (sizeimage *2 ) /3 ); -regmap_write (regmap,ISC_DAD2 , addr0 + (sizeimage *5 ) /6 ); +regmap_write (regmap,ISC_DAD1 + isc->offsets.dma, + addr0 + (sizeimage *2 ) /3 ); +regmap_write (regmap,ISC_DAD2 + isc->offsets.dma, + addr0 + (sizeimage *5 ) /6 );break ;case V4L2_PIX_FMT_YUV422P : -regmap_write (regmap,ISC_DAD1 , addr0 + sizeimage /2 ); -regmap_write (regmap,ISC_DAD2 , addr0 + (sizeimage *3 ) /4 ); +regmap_write (regmap,ISC_DAD1 + isc->offsets.dma, + addr0 + sizeimage /2 ); +regmap_write (regmap,ISC_DAD2 + isc->offsets.dma, + addr0 + (sizeimage *3 ) /4 );break ;default :break ;
@@ -610,7 +614,8 @@ static void isc_start_dma(struct isc_device *isc) dctrl_dview = isc->config.dctrl_dview; -regmap_write (regmap,ISC_DCTRL , dctrl_dview |ISC_DCTRL_IE_IS ); +regmap_write (regmap,ISC_DCTRL + isc->offsets.dma, + dctrl_dview |ISC_DCTRL_IE_IS );spin_lock (&isc->awb_lock);regmap_write (regmap,ISC_CTRLEN ,ISC_CTRL_CAPTURE );spin_unlock (&isc->awb_lock);
@@ -723,7 +728,7 @@ static int isc_configure(struct isc_device *isc)regmap_update_bits (regmap,ISC_RLP_CFG + isc->offsets.rlp,ISC_RLP_CFG_MODE_MASK , rlp_mode); -regmap_write (regmap,ISC_DCFG , dcfg); +regmap_write (regmap,ISC_DCFG + isc->offsets.dma, dcfg);/* Set the pipeline */ isc_set_pipeline (isc, pipeline);
drivers/media/platform/atmel/atmel-isc-regs.h +3 -0
@@ -247,6 +247,9 @@#define ISC_HIS_CFG_RAR BIT(8) +/* Offset for DMA register specific to sama5d2 product */ +#define ISC_SAMA5D2_DMA_OFFSET 0 +/* DMA Configuration Register */ #define ISC_DCFG 0x000003e0#define ISC_DCFG_IMODE_PACKED8 0x0
drivers/media/platform/atmel/atmel-isc.h +2 -0
@@ -152,6 +152,7 @@ struct isc_ctrls {* @sub420: Offset for the SUB420 register * @rlp: Offset for the RLP register * @his: Offset for the HIS related registers +* @dma: Offset for the DMA related registers */ struct isc_reg_offsets {u32 csc;
@@ -160,6 +161,7 @@ struct isc_reg_offsets {u32 sub420;u32 rlp;u32 his; +u32 dma; };/*
drivers/media/platform/atmel/atmel-sama5d2-isc.c +1 -0
@@ -239,6 +239,7 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->offsets.sub420 =ISC_SAMA5D2_SUB420_OFFSET ; isc->offsets.rlp =ISC_SAMA5D2_RLP_OFFSET ; isc->offsets.his =ISC_SAMA5D2_HIS_OFFSET ; + isc->offsets.dma =ISC_SAMA5D2_DMA_OFFSET ;/* sama5d2-isc - 8 bits per beat */ isc->dcfg =ISC_DCFG_YMBSIZE_BEATS8 |ISC_DCFG_CMBSIZE_BEATS8 ;
Signature · 1 line
2.25.1
PATCH v3 15/33 media: atmel: atmel-isc: add support for version register
In reply to Eugen HristevAdd support for version register and print it at probe time.
--- drivers/media/platform/atmel/atmel-isc-regs.h | 5 +++++ drivers/media/platform/atmel/atmel-isc.h | 2 ++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 5 +++++ 3 files changed, 12 insertions(+)
drivers/media/platform/atmel/atmel-isc-regs.h +5 -0
@@ -295,6 +295,11 @@/* DMA Address 2 Register */ #define ISC_DAD2 0x000003fc +/* Offset for version register specific to sama5d2 product */ +#define ISC_SAMA5D2_VERSION_OFFSET 0 +/* Version Register */ +#define ISC_VERSION 0x0000040c +/* Histogram Entry */ #define ISC_HIS_ENTRY 0x00000410
drivers/media/platform/atmel/atmel-isc.h +2 -0
@@ -153,6 +153,7 @@ struct isc_ctrls {* @rlp: Offset for the RLP register * @his: Offset for the HIS related registers * @dma: Offset for the DMA related registers +* @version: Offset for the version register */ struct isc_reg_offsets {u32 csc;
@@ -162,6 +163,7 @@ struct isc_reg_offsets {u32 rlp;u32 his;u32 dma; +u32 version; };/*
drivers/media/platform/atmel/atmel-sama5d2-isc.c +5 -0
@@ -192,6 +192,7 @@ static int atmel_isc_probe(struct platform_device *pdev)struct isc_subdev_entity *subdev_entity;int irq;int ret; +u32 ver; isc =devm_kzalloc (dev,sizeof (*isc),GFP_KERNEL );if (!isc)
@@ -240,6 +241,7 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->offsets.rlp =ISC_SAMA5D2_RLP_OFFSET ; isc->offsets.his =ISC_SAMA5D2_HIS_OFFSET ; isc->offsets.dma =ISC_SAMA5D2_DMA_OFFSET ; + isc->offsets.version =ISC_SAMA5D2_VERSION_OFFSET ;/* sama5d2-isc - 8 bits per beat */ isc->dcfg =ISC_DCFG_YMBSIZE_BEATS8 |ISC_DCFG_CMBSIZE_BEATS8 ;
@@ -335,6 +337,9 @@ static int atmel_isc_probe(struct platform_device *pdev)pm_runtime_enable (dev);pm_request_idle (dev); +regmap_read (isc->regmap,ISC_VERSION + isc->offsets.version, &ver); +dev_info (dev,"Microchip ISC version %x\n" , ver); +return 0 ; cleanup_subdev:
Signature · 1 line
2.25.1
PATCH v3 16/33 media: atmel: atmel-isc: add his_entry to register offsets
In reply to Eugen HristevAdd his_entry to the reg offsets struct.
This will allow different products to have a different reg offset for this particular module.
--- drivers/media/platform/atmel/atmel-isc-base.c | 3 ++- drivers/media/platform/atmel/atmel-isc-regs.h | 2 ++ drivers/media/platform/atmel/atmel-isc.h | 2 ++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 1 + 4 files changed, 7 insertions(+), 1 deletion(-)
drivers/media/platform/atmel/atmel-isc-base.c +2 -1
@@ -1672,7 +1672,8 @@ static void isc_hist_count(struct isc_device *isc, u32 *min, u32 *max) *min =0 ; *max =HIST_ENTRIES ; -regmap_bulk_read (regmap,ISC_HIS_ENTRY , hist_entry,HIST_ENTRIES ); +regmap_bulk_read (regmap,ISC_HIS_ENTRY + isc->offsets.his_entry, + hist_entry,HIST_ENTRIES ); *hist_count =0 ;/*
drivers/media/platform/atmel/atmel-isc-regs.h +2 -0
@@ -300,6 +300,8 @@/* Version Register */ #define ISC_VERSION 0x0000040c +/* Offset for version register specific to sama5d2 product */ +#define ISC_SAMA5D2_HIS_ENTRY_OFFSET 0/* Histogram Entry */ #define ISC_HIS_ENTRY 0x00000410
drivers/media/platform/atmel/atmel-isc.h +2 -0
@@ -154,6 +154,7 @@ struct isc_ctrls {* @his: Offset for the HIS related registers * @dma: Offset for the DMA related registers * @version: Offset for the version register +* @his_entry: Offset for the HIS entries registers */ struct isc_reg_offsets {u32 csc;
@@ -164,6 +165,7 @@ struct isc_reg_offsets {u32 his;u32 dma;u32 version; +u32 his_entry; };/*
drivers/media/platform/atmel/atmel-sama5d2-isc.c +1 -0
@@ -242,6 +242,7 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->offsets.his =ISC_SAMA5D2_HIS_OFFSET ; isc->offsets.dma =ISC_SAMA5D2_DMA_OFFSET ; isc->offsets.version =ISC_SAMA5D2_VERSION_OFFSET ; + isc->offsets.his_entry =ISC_SAMA5D2_HIS_ENTRY_OFFSET ;/* sama5d2-isc - 8 bits per beat */ isc->dcfg =ISC_DCFG_YMBSIZE_BEATS8 |ISC_DCFG_CMBSIZE_BEATS8 ;
Signature · 1 line
2.25.1
PATCH v3 17/33 media: atmel: atmel-isc: add register description for additional modules
In reply to Eugen HristevAdd register description for additional pipeline modules: the Defective Pixel Correction (DPC) and the Vertical and Horizontal Scaler(VHXS)
--- drivers/media/platform/atmel/atmel-isc-regs.h | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+)
drivers/media/platform/atmel/atmel-isc-regs.h +67 -0
@@ -90,6 +90,46 @@#define ISC_INT_DDONE BIT(8)#define ISC_INT_HISDONE BIT(12) +/* ISC DPC Control Register */ +#define ISC_DPC_CTRL 0x40 + +#define ISC_DPC_CTRL_DPCEN BIT(0) +#define ISC_DPC_CTRL_GDCEN BIT(1) +#define ISC_DPC_CTRL_BLCEN BIT(2) + +/* ISC DPC Config Register */ +#define ISC_DPC_CFG 0x44 + +#define ISC_DPC_CFG_BAYSEL_SHIFT 0 + +#define ISC_DPC_CFG_EITPOL BIT(4) + +#define ISC_DPC_CFG_TA_ENABLE BIT(14) +#define ISC_DPC_CFG_TC_ENABLE BIT(13) +#define ISC_DPC_CFG_TM_ENABLE BIT(12) + +#define ISC_DPC_CFG_RE_MODE BIT(17) + +#define ISC_DPC_CFG_GDCCLP_SHIFT 20 +#define ISC_DPC_CFG_GDCCLP_MASK GENMASK(22, 20) + +#define ISC_DPC_CFG_BLOFF_SHIFT 24 +#define ISC_DPC_CFG_BLOFF_MASK GENMASK(31, 24) + +#define ISC_DPC_CFG_BAYCFG_SHIFT 0 +#define ISC_DPC_CFG_BAYCFG_MASK GENMASK(1, 0) +/* ISC DPC Threshold Median Register */ +#define ISC_DPC_THRESHM 0x48 + +/* ISC DPC Threshold Closest Register */ +#define ISC_DPC_THRESHC 0x4C + +/* ISC DPC Threshold Average Register */ +#define ISC_DPC_THRESHA 0x50 + +/* ISC DPC STatus Register */ +#define ISC_DPC_SR 0x54 +/* ISC White Balance Control Register */ #define ISC_WB_CTRL 0x00000058
@@ -153,6 +193,33 @@/* ISC_Gamma Correction Green Entry Register */ #define ISC_GAM_RENTRY 0x00000298 +/* ISC VHXS Control Register */ +#define ISC_VHXS_CTRL 0x398 + +/* ISC VHXS Source Size Register */ +#define ISC_VHXS_SS 0x39C + +/* ISC VHXS Destination Size Register */ +#define ISC_VHXS_DS 0x3A0 + +/* ISC Vertical Factor Register */ +#define ISC_VXS_FACT 0x3a4 + +/* ISC Horizontal Factor Register */ +#define ISC_HXS_FACT 0x3a8 + +/* ISC Vertical Config Register */ +#define ISC_VXS_CFG 0x3ac + +/* ISC Horizontal Config Register */ +#define ISC_HXS_CFG 0x3b0 + +/* ISC Vertical Tap Register */ +#define ISC_VXS_TAP 0x3b4 + +/* ISC Horizontal Tap Register */ +#define ISC_HXS_TAP 0x434 +/* Offset for CSC register specific to sama5d2 product */ #define ISC_SAMA5D2_CSC_OFFSET 0
Signature · 1 line
2.25.1
PATCH v3 18/33 media: atmel: atmel-isc: extend pipeline with extra modules
In reply to Eugen HristevNewer ISC pipelines have the additional modules of Defective Pixel Correction -> DPC itself,
Defective Pixel Correction -> Green Disparity Correction (DPC_GDC) Defective Pixel Correction -> Black Level Correction (DPC_BLC) Vertical and Horizontal Scaler -> VHXS
Some products have this full pipeline (sama7g5), other products do not (sama5d2)
Add the modules to the isc base, and also extend the register range to include the modules.
--- drivers/media/platform/atmel/atmel-isc-base.c | 11 ++++++-- drivers/media/platform/atmel/atmel-isc.h | 28 +++++++++++-------- 2 files changed, 25 insertions(+), 14 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +9 -2
@@ -2309,8 +2309,14 @@ int isc_pipeline_init(struct isc_device *isc)struct regmap_field *regs;unsigned int i; -/* WB-->CFA-->CC-->GAM-->CSC-->CBC-->SUB422-->SUB420 */ +/* +* DPCEN-->GDCEN-->BLCEN-->WB-->CFA-->CC--> +* GAM-->VHXS-->CSC-->CBC-->SUB422-->SUB420 +*/ const struct reg_field regfields[ISC_PIPE_LINE_NODE_NUM ] = { +REG_FIELD (ISC_DPC_CTRL ,0 ,0 ), +REG_FIELD (ISC_DPC_CTRL ,1 ,1 ), +REG_FIELD (ISC_DPC_CTRL ,2 ,2 ),REG_FIELD (ISC_WB_CTRL ,0 ,0 ),REG_FIELD (ISC_CFA_CTRL ,0 ,0 ),REG_FIELD (ISC_CC_CTRL ,0 ,0 ),
@@ -2318,6 +2324,7 @@ int isc_pipeline_init(struct isc_device *isc)REG_FIELD (ISC_GAM_CTRL ,1 ,1 ),REG_FIELD (ISC_GAM_CTRL ,2 ,2 ),REG_FIELD (ISC_GAM_CTRL ,3 ,3 ), +REG_FIELD (ISC_VHXS_CTRL ,0 ,0 ),REG_FIELD (ISC_CSC_CTRL + isc->offsets.csc,0 ,0 ),REG_FIELD (ISC_CBC_CTRL + isc->offsets.cbc,0 ,0 ), REG_FIELD(ISC_SUB422_CTRL + isc->offsets.sub422, 0, 0),
@@ -2336,7 +2343,7 @@ int isc_pipeline_init(struct isc_device *isc) }/* regmap configuration */ -#define ATMEL_ISC_REG_MAX 0xbfc +#define ATMEL_ISC_REG_MAX 0xd5cconst struct regmap_config isc_regmap_config = { .reg_bits =32 , .reg_stride =4 ,
drivers/media/platform/atmel/atmel-isc.h +16 -12
@@ -68,17 +68,21 @@ struct isc_format { };/* Pipeline bitmap */ -#define WB_ENABLE BIT(0) -#define CFA_ENABLE BIT(1) -#define CC_ENABLE BIT(2) -#define GAM_ENABLE BIT(3) -#define GAM_BENABLE BIT(4) -#define GAM_GENABLE BIT(5) -#define GAM_RENABLE BIT(6) -#define CSC_ENABLE BIT(7) -#define CBC_ENABLE BIT(8) -#define SUB422_ENABLE BIT(9) -#define SUB420_ENABLE BIT(10) +#define DPC_DPCENABLE BIT(0) +#define DPC_GDCENABLE BIT(1) +#define DPC_BLCENABLE BIT(2) +#define WB_ENABLE BIT(3) +#define CFA_ENABLE BIT(4) +#define CC_ENABLE BIT(5) +#define GAM_ENABLE BIT(6) +#define GAM_BENABLE BIT(7) +#define GAM_GENABLE BIT(8) +#define GAM_RENABLE BIT(9) +#define VHXS_ENABLE BIT(10) +#define CSC_ENABLE BIT(11) +#define CBC_ENABLE BIT(12) +#define SUB422_ENABLE BIT(13) +#define SUB420_ENABLE BIT(14)#define GAM_ENABLES (GAM_RENABLE | GAM_GENABLE | GAM_BENABLE | GAM_ENABLE)
@@ -142,7 +146,7 @@ struct isc_ctrls {u32 hist_minmax[HIST_BAYER ][2 ]; }; -#define ISC_PIPE_LINE_NODE_NUM 11 +#define ISC_PIPE_LINE_NODE_NUM 15/* * struct isc_reg_offsets - ISC device register offsets
Signature · 1 line
2.25.1
PATCH v3 19/33 media: atmel: atmel-isc: add CC initialization function
In reply to Eugen HristevThe CC submodule is a part of the atmel-isc pipeline, and stands for Color Correction. It is used to apply gains and offsets to the chroma (U, V) components of the YUV elements.
Implement the CC submodule initialization, as a product specific function, which currently configures the neutral point in color correction.
---
Changes in v3:
- added module description in commit message Changes in v2:
- addded function prototype to avoid warning with W=1
drivers/media/platform/atmel/atmel-isc-base.c | 1 + drivers/media/platform/atmel/atmel-isc.h | 3 +++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 15 +++++++++++++++ 3 files changed, 19 insertions(+)
drivers/media/platform/atmel/atmel-isc-base.c +1 -0
@@ -653,6 +653,7 @@ static void isc_set_pipeline(struct isc_device *isc, u32 pipeline) isc->config_csc (isc); isc->config_cbc (isc); + isc->config_cc (isc); }static int isc_update_profile (struct isc_device *isc)
drivers/media/platform/atmel/atmel-isc.h +3 -0
@@ -225,6 +225,8 @@ struct isc_reg_offsets {* specific CSC module * @config_cbc: pointer to a function that initializes product * specific CBC module +* @config_cc: pointer to a function that initializes product +* specific CC module * * @offsets: struct holding the product specific register offsets */
@@ -298,6 +300,7 @@ struct isc_device {struct {void (*config_csc)(struct isc_device *isc);void (*config_cbc)(struct isc_device *isc); +void (*config_cc)(struct isc_device *isc); };struct isc_reg_offsets offsets;
drivers/media/platform/atmel/atmel-sama5d2-isc.c +15 -0
@@ -56,6 +56,7 @@void isc_sama5d2_config_csc (struct isc_device *isc);void isc_sama5d2_config_cbc (struct isc_device *isc); +void isc_sama5d2_config_cc (struct isc_device *isc);void isc_sama5d2_config_csc (struct isc_device *isc) {
@@ -86,6 +87,19 @@ void isc_sama5d2_config_cbc(struct isc_device *isc) isc->ctrls.contrast); } +void isc_sama5d2_config_cc (struct isc_device *isc) +{ +struct regmap *regmap = isc->regmap; + +/* Configure each register at the neutral fixed point 1.0 or 0.0 */ +regmap_write (regmap,ISC_CC_RR_RG , (1 <<8 )); +regmap_write (regmap,ISC_CC_RB_OR ,0 ); +regmap_write (regmap,ISC_CC_GR_GG , (1 <<8 ) <<16 ); +regmap_write (regmap,ISC_CC_GB_OG ,0 ); +regmap_write (regmap,ISC_CC_BR_BG ,0 ); +regmap_write (regmap,ISC_CC_BB_OB , (1 <<8 )); +} +/* Gamma table with gamma 1/2.2 */ const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES ] = {/* 0 --> gamma 1/1.8 */
@@ -233,6 +247,7 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->config_csc = isc_sama5d2_config_csc; isc->config_cbc = isc_sama5d2_config_cbc; + isc->config_cc = isc_sama5d2_config_cc; isc->offsets.csc =ISC_SAMA5D2_CSC_OFFSET ; isc->offsets.cbc =ISC_SAMA5D2_CBC_OFFSET ;
Signature · 1 line
2.25.1
PATCH v3 20/33 media: atmel: atmel-isc: create product specific v4l2 controls config
In reply to Eugen HristevCreate product specific callback for initializing v4l2 controls. Call this from v4l2 controls init function.
--- drivers/media/platform/atmel/atmel-isc-base.c | 5 +++-- drivers/media/platform/atmel/atmel-isc.h | 5 +++++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +3 -2
@@ -2036,11 +2036,12 @@ static int isc_ctrl_init(struct isc_device *isc)if (ret <0 )return ret; +/* Initialize product specific controls. For example, contrast */ + isc->config_ctrls (isc, ops); + ctrls->brightness =0 ; - ctrls->contrast =256 ;v4l2_ctrl_new_std (hdl, ops,V4L2_CID_BRIGHTNESS ,-1024 ,1023 ,1 ,0 ); -v4l2_ctrl_new_std (hdl, ops,V4L2_CID_CONTRAST ,-2048 ,2047 ,1 ,256 );v4l2_ctrl_new_std (hdl, ops,V4L2_CID_GAMMA ,0 , isc->gamma_max,1 , isc->gamma_max); isc->awb_ctrl = v4l2_ctrl_new_std(hdl, &isc_awb_ops,
drivers/media/platform/atmel/atmel-isc.h +5 -0
@@ -227,6 +227,8 @@ struct isc_reg_offsets {* specific CBC module * @config_cc: pointer to a function that initializes product * specific CC module +* @config_ctrls: pointer to a functoin that initializes product +* specific v4l2 controls. * * @offsets: struct holding the product specific register offsets */
@@ -301,6 +303,9 @@ struct isc_device {void (*config_csc)(struct isc_device *isc);void (*config_cbc)(struct isc_device *isc);void (*config_cc)(struct isc_device *isc); + +void (*config_ctrls)(struct isc_device *isc, +const struct v4l2_ctrl_ops *ops); };struct isc_reg_offsets offsets;
drivers/media/platform/atmel/atmel-sama5d2-isc.c +15 -0
@@ -58,6 +58,9 @@ void isc_sama5d2_config_csc(struct isc_device *isc);void isc_sama5d2_config_cbc (struct isc_device *isc);void isc_sama5d2_config_cc (struct isc_device *isc); +void isc_sama5d2_config_ctrls (struct isc_device *isc, +const struct v4l2_ctrl_ops *ops); +void isc_sama5d2_config_csc (struct isc_device *isc) {struct regmap *regmap = isc->regmap;
@@ -100,6 +103,17 @@ void isc_sama5d2_config_cc(struct isc_device *isc)regmap_write (regmap,ISC_CC_BB_OB , (1 <<8 )); } +void isc_sama5d2_config_ctrls (struct isc_device *isc, +const struct v4l2_ctrl_ops *ops) +{ +struct isc_ctrls *ctrls = &isc->ctrls; +struct v4l2_ctrl_handler *hdl = &ctrls->handler; + + ctrls->contrast =256 ; + +v4l2_ctrl_new_std (hdl, ops,V4L2_CID_CONTRAST ,-2048 ,2047 ,1 ,256 ); +} +/* Gamma table with gamma 1/2.2 */ const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES ] = {/* 0 --> gamma 1/1.8 */
@@ -248,6 +262,7 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->config_csc = isc_sama5d2_config_csc; isc->config_cbc = isc_sama5d2_config_cbc; isc->config_cc = isc_sama5d2_config_cc; + isc->config_ctrls = isc_sama5d2_config_ctrls; isc->offsets.csc =ISC_SAMA5D2_CSC_OFFSET ; isc->offsets.cbc =ISC_SAMA5D2_CBC_OFFSET ;
Signature · 1 line
2.25.1
PATCH v3 21/33 media: atmel: atmel-isc: create callback for DPC submodule product specific
In reply to Eugen HristevThe DPC submodule is a part of the atmel-isc pipeline, and stands for Defective Pixel Correction. Its purpose is to detect defective pixels and correct them if possible with the help of adjacent pixels.
Create a product specific callback for initializing the DPC submodule of the pipeline.
For sama5d2 product, this module does not exist, thus this function is a noop.
---
Changes in v3:
- added module description in commit message Changes in v2:
- addded function prototype to avoid warning with W=1
drivers/media/platform/atmel/atmel-isc-base.c | 1 + drivers/media/platform/atmel/atmel-isc.h | 3 +++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 7 +++++++ 3 files changed, 11 insertions(+)
drivers/media/platform/atmel/atmel-isc-base.c +1 -0
@@ -651,6 +651,7 @@ static void isc_set_pipeline(struct isc_device *isc, u32 pipeline)regmap_bulk_write (regmap,ISC_GAM_GENTRY , gamma,GAMMA_ENTRIES );regmap_bulk_write (regmap,ISC_GAM_RENTRY , gamma,GAMMA_ENTRIES ); + isc->config_dpc (isc); isc->config_csc (isc); isc->config_cbc (isc); isc->config_cc (isc);
drivers/media/platform/atmel/atmel-isc.h +3 -0
@@ -221,6 +221,8 @@ struct isc_reg_offsets {* @max_width: maximum frame width, dependent on the internal RAM * @max_height: maximum frame height, dependent on the internal RAM * +* @config_dpc: pointer to a function that initializes product +* specific DPC module * @config_csc: pointer to a function that initializes product * specific CSC module * @config_cbc: pointer to a function that initializes product
@@ -300,6 +302,7 @@ struct isc_device {u32 max_height;struct { +void (*config_dpc)(struct isc_device *isc);void (*config_csc)(struct isc_device *isc);void (*config_cbc)(struct isc_device *isc);void (*config_cc)(struct isc_device *isc);
drivers/media/platform/atmel/atmel-sama5d2-isc.c +7 -0
@@ -57,6 +57,7 @@void isc_sama5d2_config_csc (struct isc_device *isc);void isc_sama5d2_config_cbc (struct isc_device *isc);void isc_sama5d2_config_cc (struct isc_device *isc); +void isc_sama5d2_config_dpc (struct isc_device *isc);void isc_sama5d2_config_ctrls (struct isc_device *isc,const struct v4l2_ctrl_ops *ops);
@@ -114,6 +115,11 @@ void isc_sama5d2_config_ctrls(struct isc_device *isc,v4l2_ctrl_new_std (hdl, ops,V4L2_CID_CONTRAST ,-2048 ,2047 ,1 ,256 ); } +void isc_sama5d2_config_dpc (struct isc_device *isc) +{ +/* This module is not present on sama5d2 pipeline */ +} +/* Gamma table with gamma 1/2.2 */ const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES ] = {/* 0 --> gamma 1/1.8 */
@@ -259,6 +265,7 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->max_width =ISC_SAMA5D2_MAX_SUPPORT_WIDTH ; isc->max_height =ISC_SAMA5D2_MAX_SUPPORT_HEIGHT ; + isc->config_dpc = isc_sama5d2_config_dpc; isc->config_csc = isc_sama5d2_config_csc; isc->config_cbc = isc_sama5d2_config_cbc; isc->config_cc = isc_sama5d2_config_cc;
Signature · 1 line
2.25.1
PATCH v3 22/33 media: atmel: atmel-isc: create callback for GAM submodule product specific
In reply to Eugen HristevThe GAM submodule is a part of the atmel-isc pipeline, and stands for Gamma Correction. It is used to apply the gamma curve to the incoming pixels. Create a product specific callback for initializing the GAM submodule of the pipeline.
For sama5d2 product, there is no special configuration at this moment, thus this function is a noop.
---
Changes in v3:
- added module description in commit message Changes in v2:
- addded function prototype to avoid warning with W=1
drivers/media/platform/atmel/atmel-isc-base.c | 1 + drivers/media/platform/atmel/atmel-isc.h | 3 +++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 7 +++++++ 3 files changed, 11 insertions(+)
drivers/media/platform/atmel/atmel-isc-base.c +1 -0
@@ -655,6 +655,7 @@ static void isc_set_pipeline(struct isc_device *isc, u32 pipeline) isc->config_csc (isc); isc->config_cbc (isc); isc->config_cc (isc); + isc->config_gam (isc); }static int isc_update_profile (struct isc_device *isc)
drivers/media/platform/atmel/atmel-isc.h +3 -0
@@ -229,6 +229,8 @@ struct isc_reg_offsets {* specific CBC module * @config_cc: pointer to a function that initializes product * specific CC module +* @config_gam: pointer to a function that initializes product +* specific GAMMA module * @config_ctrls: pointer to a functoin that initializes product * specific v4l2 controls. *
@@ -306,6 +308,7 @@ struct isc_device {void (*config_csc)(struct isc_device *isc);void (*config_cbc)(struct isc_device *isc);void (*config_cc)(struct isc_device *isc); +void (*config_gam)(struct isc_device *isc);void (*config_ctrls)(struct isc_device *isc,const struct v4l2_ctrl_ops *ops);
drivers/media/platform/atmel/atmel-sama5d2-isc.c +7 -0
@@ -58,6 +58,7 @@ void isc_sama5d2_config_csc(struct isc_device *isc);void isc_sama5d2_config_cbc (struct isc_device *isc);void isc_sama5d2_config_cc (struct isc_device *isc);void isc_sama5d2_config_dpc (struct isc_device *isc); +void isc_sama5d2_config_gam (struct isc_device *isc);void isc_sama5d2_config_ctrls (struct isc_device *isc,const struct v4l2_ctrl_ops *ops);
@@ -120,6 +121,11 @@ void isc_sama5d2_config_dpc(struct isc_device *isc)/* This module is not present on sama5d2 pipeline */ } +void isc_sama5d2_config_gam (struct isc_device *isc) +{ +/* No specific gamma configuration */ +} +/* Gamma table with gamma 1/2.2 */ const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES ] = {/* 0 --> gamma 1/1.8 */
@@ -269,6 +275,7 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->config_csc = isc_sama5d2_config_csc; isc->config_cbc = isc_sama5d2_config_cbc; isc->config_cc = isc_sama5d2_config_cc; + isc->config_gam = isc_sama5d2_config_gam; isc->config_ctrls = isc_sama5d2_config_ctrls; isc->offsets.csc =ISC_SAMA5D2_CSC_OFFSET ;
Signature · 1 line
2.25.1
PATCH v3 23/33 media: atmel: atmel-isc: create callback for RLP submodule product specific
In reply to Eugen HristevThe RLP submodule is a part of the atmel-isc pipeline, and stands for Rounding,Limiting and Packaging. It used to extract specific data from the ISC pipeline. For example if we want to output greyscale 8 bit, we would use limiting to 8 bits, and packaging to Luma component only.
Create a product specific callback for initializing the RLP submodule of the pipeline
---
Changes in v3:
- added module description in commit message Changes in v2:
- addded function prototype to avoid warning with W=1
drivers/media/platform/atmel/atmel-isc-base.c | 6 ++---- drivers/media/platform/atmel/atmel-isc.h | 3 +++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 11 +++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +2 -4
@@ -711,11 +711,10 @@ static void isc_set_histogram(struct isc_device *isc, bool enable)static int isc_configure (struct isc_device *isc) {struct regmap *regmap = isc->regmap; -u32 pfe_cfg0, rlp_mode, dcfg, mask, pipeline; +u32 pfe_cfg0, dcfg, mask, pipeline;struct isc_subdev_entity *subdev = isc->current_subdev; pfe_cfg0 = isc->config.sd_format->pfe_cfg0_bps; - rlp_mode = isc->config.rlp_cfg_mode; pipeline = isc->config.bits_pipeline; dcfg = isc->config.dcfg_imode | isc->dcfg;
@@ -728,8 +727,7 @@ static int isc_configure(struct isc_device *isc)regmap_update_bits (regmap,ISC_PFE_CFG0 , mask, pfe_cfg0); -regmap_update_bits (regmap,ISC_RLP_CFG + isc->offsets.rlp, -ISC_RLP_CFG_MODE_MASK , rlp_mode); + isc->config_rlp (isc);regmap_write (regmap,ISC_DCFG + isc->offsets.dma, dcfg);
drivers/media/platform/atmel/atmel-isc.h +3 -0
@@ -231,6 +231,8 @@ struct isc_reg_offsets {* specific CC module * @config_gam: pointer to a function that initializes product * specific GAMMA module +* @config_rlp: pointer to a function that initializes product +* specific RLP module * @config_ctrls: pointer to a functoin that initializes product * specific v4l2 controls. *
@@ -309,6 +311,7 @@ struct isc_device {void (*config_cbc)(struct isc_device *isc);void (*config_cc)(struct isc_device *isc);void (*config_gam)(struct isc_device *isc); +void (*config_rlp)(struct isc_device *isc);void (*config_ctrls)(struct isc_device *isc,const struct v4l2_ctrl_ops *ops);
drivers/media/platform/atmel/atmel-sama5d2-isc.c +11 -0
@@ -59,6 +59,7 @@ void isc_sama5d2_config_cbc(struct isc_device *isc);void isc_sama5d2_config_cc (struct isc_device *isc);void isc_sama5d2_config_dpc (struct isc_device *isc);void isc_sama5d2_config_gam (struct isc_device *isc); +void isc_sama5d2_config_rlp (struct isc_device *isc);void isc_sama5d2_config_ctrls (struct isc_device *isc,const struct v4l2_ctrl_ops *ops);
@@ -126,6 +127,15 @@ void isc_sama5d2_config_gam(struct isc_device *isc)/* No specific gamma configuration */ } +void isc_sama5d2_config_rlp (struct isc_device *isc) +{ +struct regmap *regmap = isc->regmap; +u32 rlp_mode = isc->config.rlp_cfg_mode; + +regmap_update_bits (regmap,ISC_RLP_CFG + isc->offsets.rlp, +ISC_RLP_CFG_MODE_MASK , rlp_mode); +} +/* Gamma table with gamma 1/2.2 */ const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES ] = {/* 0 --> gamma 1/1.8 */
@@ -276,6 +286,7 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->config_cbc = isc_sama5d2_config_cbc; isc->config_cc = isc_sama5d2_config_cc; isc->config_gam = isc_sama5d2_config_gam; + isc->config_rlp = isc_sama5d2_config_rlp; isc->config_ctrls = isc_sama5d2_config_ctrls; isc->offsets.csc =ISC_SAMA5D2_CSC_OFFSET ;
Signature · 1 line
2.25.1
PATCH v3 24/33 media: atmel: atmel-isc: move the formats list into product specific code
In reply to Eugen HristevThe list of input and output formats has to be product specific. Move this list into the product specific code.
Have pointers to these arrays inside the device struct.
--- drivers/media/platform/atmel/atmel-isc-base.c | 167 ++---------------- drivers/media/platform/atmel/atmel-isc.h | 12 +- .../media/platform/atmel/atmel-sama5d2-isc.c | 136 ++++++++++++++ 3 files changed, 165 insertions(+), 150 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +19 -148
@@ -45,137 +45,6 @@ module_param(sensor_preferred, uint, 0644);MODULE_PARM_DESC (sensor_preferred,"Sensor is preferred to output the specified format (1-on 0-off), default 1" ); -/* This is a list of the formats that the ISC can *output* */ -const struct isc_format controller_formats[] = { - { - .fourcc =V4L2_PIX_FMT_ARGB444 , - }, - { - .fourcc =V4L2_PIX_FMT_ARGB555 , - }, - { - .fourcc =V4L2_PIX_FMT_RGB565 , - }, - { - .fourcc =V4L2_PIX_FMT_ABGR32 , - }, - { - .fourcc =V4L2_PIX_FMT_XBGR32 , - }, - { - .fourcc =V4L2_PIX_FMT_YUV420 , - }, - { - .fourcc =V4L2_PIX_FMT_YUYV , - }, - { - .fourcc =V4L2_PIX_FMT_YUV422P , - }, - { - .fourcc =V4L2_PIX_FMT_GREY , - }, - { - .fourcc =V4L2_PIX_FMT_Y10 , - }, -}; - -/* This is a list of formats that the ISC can receive as *input* */ -struct isc_format formats_list[] = { - { - .fourcc =V4L2_PIX_FMT_SBGGR8 , - .mbus_code =MEDIA_BUS_FMT_SBGGR8_1X8 , - .pfe_cfg0_bps =ISC_PFE_CFG0_BPS_EIGHT , - .cfa_baycfg =ISC_BAY_CFG_BGBG , - }, - { - .fourcc =V4L2_PIX_FMT_SGBRG8 , - .mbus_code =MEDIA_BUS_FMT_SGBRG8_1X8 , - .pfe_cfg0_bps =ISC_PFE_CFG0_BPS_EIGHT , - .cfa_baycfg =ISC_BAY_CFG_GBGB , - }, - { - .fourcc =V4L2_PIX_FMT_SGRBG8 , - .mbus_code =MEDIA_BUS_FMT_SGRBG8_1X8 , - .pfe_cfg0_bps =ISC_PFE_CFG0_BPS_EIGHT , - .cfa_baycfg =ISC_BAY_CFG_GRGR , - }, - { - .fourcc =V4L2_PIX_FMT_SRGGB8 , - .mbus_code =MEDIA_BUS_FMT_SRGGB8_1X8 , - .pfe_cfg0_bps =ISC_PFE_CFG0_BPS_EIGHT , - .cfa_baycfg =ISC_BAY_CFG_RGRG , - }, - { - .fourcc =V4L2_PIX_FMT_SBGGR10 , - .mbus_code =MEDIA_BUS_FMT_SBGGR10_1X10 , - .pfe_cfg0_bps =ISC_PFG_CFG0_BPS_TEN , - .cfa_baycfg =ISC_BAY_CFG_RGRG , - }, - { - .fourcc =V4L2_PIX_FMT_SGBRG10 , - .mbus_code =MEDIA_BUS_FMT_SGBRG10_1X10 , - .pfe_cfg0_bps =ISC_PFG_CFG0_BPS_TEN , - .cfa_baycfg =ISC_BAY_CFG_GBGB , - }, - { - .fourcc =V4L2_PIX_FMT_SGRBG10 , - .mbus_code =MEDIA_BUS_FMT_SGRBG10_1X10 , - .pfe_cfg0_bps =ISC_PFG_CFG0_BPS_TEN , - .cfa_baycfg =ISC_BAY_CFG_GRGR , - }, - { - .fourcc =V4L2_PIX_FMT_SRGGB10 , - .mbus_code =MEDIA_BUS_FMT_SRGGB10_1X10 , - .pfe_cfg0_bps =ISC_PFG_CFG0_BPS_TEN , - .cfa_baycfg =ISC_BAY_CFG_RGRG , - }, - { - .fourcc =V4L2_PIX_FMT_SBGGR12 , - .mbus_code =MEDIA_BUS_FMT_SBGGR12_1X12 , - .pfe_cfg0_bps =ISC_PFG_CFG0_BPS_TWELVE , - .cfa_baycfg =ISC_BAY_CFG_BGBG , - }, - { - .fourcc =V4L2_PIX_FMT_SGBRG12 , - .mbus_code =MEDIA_BUS_FMT_SGBRG12_1X12 , - .pfe_cfg0_bps =ISC_PFG_CFG0_BPS_TWELVE , - .cfa_baycfg =ISC_BAY_CFG_GBGB , - }, - { - .fourcc =V4L2_PIX_FMT_SGRBG12 , - .mbus_code =MEDIA_BUS_FMT_SGRBG12_1X12 , - .pfe_cfg0_bps =ISC_PFG_CFG0_BPS_TWELVE , - .cfa_baycfg =ISC_BAY_CFG_GRGR , - }, - { - .fourcc =V4L2_PIX_FMT_SRGGB12 , - .mbus_code =MEDIA_BUS_FMT_SRGGB12_1X12 , - .pfe_cfg0_bps =ISC_PFG_CFG0_BPS_TWELVE , - .cfa_baycfg =ISC_BAY_CFG_RGRG , - }, - { - .fourcc =V4L2_PIX_FMT_GREY , - .mbus_code =MEDIA_BUS_FMT_Y8_1X8 , - .pfe_cfg0_bps =ISC_PFE_CFG0_BPS_EIGHT , - }, - { - .fourcc =V4L2_PIX_FMT_YUYV , - .mbus_code =MEDIA_BUS_FMT_YUYV8_2X8 , - .pfe_cfg0_bps =ISC_PFE_CFG0_BPS_EIGHT , - }, - { - .fourcc =V4L2_PIX_FMT_RGB565 , - .mbus_code =MEDIA_BUS_FMT_RGB565_2X8_LE , - .pfe_cfg0_bps =ISC_PFE_CFG0_BPS_EIGHT , - }, - { - .fourcc =V4L2_PIX_FMT_Y10 , - .mbus_code =MEDIA_BUS_FMT_Y10_1X10 , - .pfe_cfg0_bps =ISC_PFG_CFG0_BPS_TEN , - }, - -}; -#define ISC_IS_FORMAT_RAW (mbus_code) \ (((mbus_code) & 0xf000) == 0x3000)
@@ -906,25 +775,26 @@ static int isc_querycap(struct file *file, void *priv,static int isc_enum_fmt_vid_cap (struct file *file,void *priv,struct v4l2_fmtdesc *f) { +struct isc_device *isc =video_drvdata (file);u32 index = f->index;u32 i, supported_index; -if (index <ARRAY_SIZE (controller_formats)) { - f->pixelformat = controller_formats[index].fourcc; +if (index < isc->controller_formats_size) { + f->pixelformat = isc->controller_formats[index].fourcc;return 0 ; } - index -=ARRAY_SIZE (controller_formats); + index -= isc->controller_formats_size; i =0 ; supported_index =0 ; -for (i =0 ; i <ARRAY_SIZE (formats_list); i++) { -if (!ISC_IS_FORMAT_RAW (formats_list[i].mbus_code) || - !formats_list[i].sd_support) +for (i =0 ; i < isc->formats_list_size; i++) { +if (!ISC_IS_FORMAT_RAW (isc->formats_list[i].mbus_code) || + !isc->formats_list[i].sd_support)continue ;if (supported_index == index) { - f->pixelformat = formats_list[i].fourcc; + f->pixelformat = isc->formats_list[i].fourcc;return 0 ; } supported_index++;
@@ -1465,8 +1335,8 @@ static int isc_enum_framesizes(struct file *file, void *fh,if (isc->user_formats[i]->fourcc == fsize->pixel_format) ret =0 ; -for (i =0 ; i <ARRAY_SIZE (controller_formats); i++) -if (controller_formats[i].fourcc == fsize->pixel_format) +for (i =0 ; i < isc->controller_formats_size; i++) +if (isc->controller_formats[i].fourcc == fsize->pixel_format) ret =0 ;if (ret)
@@ -1502,8 +1372,8 @@ static int isc_enum_frameintervals(struct file *file, void *fh,if (isc->user_formats[i]->fourcc == fival->pixel_format) ret =0 ; -for (i =0 ; i <ARRAY_SIZE (controller_formats); i++) -if (controller_formats[i].fourcc == fival->pixel_format) +for (i =0 ; i < isc->controller_formats_size; i++) +if (isc->controller_formats[i].fourcc == fival->pixel_format) ret =0 ;if (ret)
@@ -2111,12 +1981,13 @@ static void isc_async_unbind(struct v4l2_async_notifier *notifier,v4l2_ctrl_handler_free (&isc->ctrls.handler); } -static struct isc_format *find_format_by_code (unsigned int code,int *index) +static struct isc_format *find_format_by_code (struct isc_device *isc, +unsigned int code,int *index) { -struct isc_format *fmt = &formats_list[0 ]; +struct isc_format *fmt = &isc->formats_list[0 ];unsigned int i; -for (i =0 ; i <ARRAY_SIZE (formats_list); i++) { +for (i =0 ; i < isc->formats_list_size; i++) {if (fmt->mbus_code == code) { *index = i;return fmt;
@@ -2133,7 +2004,7 @@ static int isc_formats_init(struct isc_device *isc)struct isc_format *fmt;struct v4l2_subdev *subdev = isc->current_subdev->sd;unsigned int num_fmts, i, j; -u32 list_size =ARRAY_SIZE (formats_list); +u32 list_size = isc->formats_list_size;struct v4l2_subdev_mbus_code_enum mbus_code = { .which =V4L2_SUBDEV_FORMAT_ACTIVE , };
@@ -2143,7 +2014,7 @@ static int isc_formats_init(struct isc_device *isc) NULL, &mbus_code)) { mbus_code.index++; - fmt =find_format_by_code (mbus_code.code, &i); + fmt =find_format_by_code (isc, mbus_code.code, &i);if (!fmt) {v4l2_warn (&isc->v4l2_dev,"Mbus code %x not supported\n" , mbus_code.code);
@@ -2164,7 +2035,7 @@ static int isc_formats_init(struct isc_device *isc)if (!isc->user_formats)return -ENOMEM ; - fmt = &formats_list[0 ]; + fmt = &isc->formats_list[0 ];for (i =0 , j =0 ; i < list_size; i++) {if (fmt->sd_support) isc->user_formats[j++] = fmt;
drivers/media/platform/atmel/atmel-isc.h +10 -2
@@ -237,6 +237,12 @@ struct isc_reg_offsets {* specific v4l2 controls. * * @offsets: struct holding the product specific register offsets +* @controller_formats: pointer to the array of possible formats that the +* controller can output +* @formats_list: pointer to the array of possible formats that can +* be used as an input to the controller +* @controller_formats_size: size of controller_formats array +* @formats_list_size: size of formats_list array */ struct isc_device {struct regmap *regmap;
@@ -318,10 +324,12 @@ struct isc_device { };struct isc_reg_offsets offsets; +const struct isc_format *controller_formats; +struct isc_format *formats_list; +u32 controller_formats_size; +u32 formats_list_size; }; -extern struct isc_format formats_list[]; -extern const struct isc_format controller_formats[];extern const struct regmap_config isc_regmap_config;extern const struct v4l2_async_notifier_operations isc_async_ops;
drivers/media/platform/atmel/atmel-sama5d2-isc.c +136 -0
148 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v3 25/33 media: atmel: atmel-isc: create an adapt pipeline callback for product specific
In reply to Eugen HristevOnce the pipeline is set in the base code, create a callback that will adapt the ISC pipeline to each product.
Create the adapt_pipeline callback that will be used in this fashion.
--- drivers/media/platform/atmel/atmel-isc-base.c | 4 ++++ drivers/media/platform/atmel/atmel-isc.h | 5 +++++ drivers/media/platform/atmel/atmel-sama5d2-isc.c | 12 ++++++++++++ 3 files changed, 21 insertions(+)
drivers/media/platform/atmel/atmel-isc-base.c +4 -0
@@ -1047,6 +1047,10 @@ static int isc_try_configure_pipeline(struct isc_device *isc)default : isc->try_config.bits_pipeline =0x0 ; } + +/* Tune the pipeline to product specific */ + isc->adapt_pipeline (isc); +return 0 ; }
drivers/media/platform/atmel/atmel-isc.h +5 -0
@@ -236,6 +236,9 @@ struct isc_reg_offsets {* @config_ctrls: pointer to a functoin that initializes product * specific v4l2 controls. * +* @adapt_pipeline: pointer to a function that adapts the pipeline bits +* to the product specific pipeline +* * @offsets: struct holding the product specific register offsets * @controller_formats: pointer to the array of possible formats that the * controller can output
@@ -321,6 +324,8 @@ struct isc_device {void (*config_ctrls)(struct isc_device *isc,const struct v4l2_ctrl_ops *ops); + +void (*adapt_pipeline)(struct isc_device *isc); };struct isc_reg_offsets offsets;
drivers/media/platform/atmel/atmel-sama5d2-isc.c +12 -0
@@ -54,12 +54,17 @@#define ISC_CLK_MAX_DIV 255 +#define ISC_SAMA5D2_PIPELINE \ + (WB_ENABLE | CFA_ENABLE | CC_ENABLE | GAM_ENABLES | CSC_ENABLE | \ + CBC_ENABLE | SUB422_ENABLE | SUB420_ENABLE) +void isc_sama5d2_config_csc (struct isc_device *isc);void isc_sama5d2_config_cbc (struct isc_device *isc);void isc_sama5d2_config_cc (struct isc_device *isc);void isc_sama5d2_config_dpc (struct isc_device *isc);void isc_sama5d2_config_gam (struct isc_device *isc);void isc_sama5d2_config_rlp (struct isc_device *isc); +void isc_sama5d2_adapt_pipeline (struct isc_device *isc);void isc_sama5d2_config_ctrls (struct isc_device *isc,const struct v4l2_ctrl_ops *ops);
@@ -267,6 +272,11 @@ void isc_sama5d2_config_rlp(struct isc_device *isc) ISC_RLP_CFG_MODE_MASK, rlp_mode); } +void isc_sama5d2_adapt_pipeline (struct isc_device *isc) +{ + isc->try_config.bits_pipeline &=ISC_SAMA5D2_PIPELINE ; +} +/* Gamma table with gamma 1/2.2 */ const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES ] = {/* 0 --> gamma 1/1.8 */
@@ -420,6 +430,8 @@ static int atmel_isc_probe(struct platform_device *pdev) isc->config_rlp = isc_sama5d2_config_rlp; isc->config_ctrls = isc_sama5d2_config_ctrls; + isc->adapt_pipeline = isc_sama5d2_adapt_pipeline; + isc->offsets.csc =ISC_SAMA5D2_CSC_OFFSET ; isc->offsets.cbc =ISC_SAMA5D2_CBC_OFFSET ; isc->offsets.sub422 =ISC_SAMA5D2_SUB422_OFFSET ;
Signature · 1 line
2.25.1
PATCH v3 26/33 media: atmel: atmel-isc-regs: add additional fields for sama7g5 type pipeline
In reply to Eugen HristevAdd additional fields for registers present in sama7g5 type pipeline. Extend register masks for additional bits in sama7g5 type pipeline registers.
--- drivers/media/platform/atmel/atmel-isc-regs.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/media/platform/atmel/atmel-isc-regs.h +14 -2
@@ -289,8 +289,18 @@#define ISC_RLP_CFG_MODE_ARGB32 0xa#define ISC_RLP_CFG_MODE_YYCC 0xb#define ISC_RLP_CFG_MODE_YYCC_LIMITED 0xc +#define ISC_RLP_CFG_MODE_YCYC 0xd#define ISC_RLP_CFG_MODE_MASK GENMASK(3, 0) +#define ISC_RLP_CFG_LSH BIT(5) + +#define ISC_RLP_CFG_YMODE_YUYV (3 << 6) +#define ISC_RLP_CFG_YMODE_YVYU (2 << 6) +#define ISC_RLP_CFG_YMODE_VYUY (0 << 6) +#define ISC_RLP_CFG_YMODE_UYVY (1 << 6) + +#define ISC_RLP_CFG_YMODE_MASK GENMASK(7, 6) +/* Offset for HIS register specific to sama5d2 product */ #define ISC_SAMA5D2_HIS_OFFSET 0/* Histogram Control Register */
@@ -332,13 +342,15 @@#define ISC_DCFG_YMBSIZE_BEATS4 (0x1 << 4)#define ISC_DCFG_YMBSIZE_BEATS8 (0x2 << 4)#define ISC_DCFG_YMBSIZE_BEATS16 (0x3 << 4) -#define ISC_DCFG_YMBSIZE_MASK GENMASK(5, 4) +#define ISC_DCFG_YMBSIZE_BEATS32 (0x4 << 4) +#define ISC_DCFG_YMBSIZE_MASK GENMASK(6, 4)#define ISC_DCFG_CMBSIZE_SINGLE (0x0 << 8)#define ISC_DCFG_CMBSIZE_BEATS4 (0x1 << 8)#define ISC_DCFG_CMBSIZE_BEATS8 (0x2 << 8)#define ISC_DCFG_CMBSIZE_BEATS16 (0x3 << 8) -#define ISC_DCFG_CMBSIZE_MASK GENMASK(9, 8) +#define ISC_DCFG_CMBSIZE_BEATS32 (0x4 << 8) +#define ISC_DCFG_CMBSIZE_MASK GENMASK(10, 8)/* DMA Control Register */ #define ISC_DCTRL 0x000003e4
Signature · 1 line
2.25.1
PATCH v3 27/33 media: atmel: atmel-isc-base: add support for more formats and additional pipeline modules
In reply to Eugen HristevAdd support for additional formats supported by newer pipelines, and for additional pipeline modules.
--- drivers/media/platform/atmel/atmel-isc-base.c | 48 +++++++++++++++---- 1 file changed, 38 insertions(+), 10 deletions(-)
drivers/media/platform/atmel/atmel-isc-base.c +38 -10
@@ -843,6 +843,8 @@ static int isc_try_validate_formats(struct isc_device *isc)case V4L2_PIX_FMT_YUV420 :case V4L2_PIX_FMT_YUV422P :case V4L2_PIX_FMT_YUYV : +case V4L2_PIX_FMT_UYVY : +case V4L2_PIX_FMT_VYUY : ret =0 ; yuv = true;break ;
@@ -857,6 +859,7 @@ static int isc_try_validate_formats(struct isc_device *isc)break ;case V4L2_PIX_FMT_GREY :case V4L2_PIX_FMT_Y10 : +case V4L2_PIX_FMT_Y16 : ret =0 ; grey = true;break ;
@@ -887,6 +890,8 @@ static int isc_try_validate_formats(struct isc_device *isc)*/ static int isc_try_configure_rlp_dma (struct isc_device *isc,bool direct_dump) { + isc->try_config.rlp_cfg_mode =0 ; +switch (isc->try_config.fourcc) {case V4L2_PIX_FMT_SBGGR8 :case V4L2_PIX_FMT_SGBRG8 :
@@ -953,7 +958,19 @@ static int isc_try_configure_rlp_dma(struct isc_device *isc, bool direct_dump) isc->try_config.bpp =16 ;break ;case V4L2_PIX_FMT_YUYV : - isc->try_config.rlp_cfg_mode =ISC_RLP_CFG_MODE_YYCC ; + isc->try_config.rlp_cfg_mode =ISC_RLP_CFG_MODE_YCYC |ISC_RLP_CFG_YMODE_YUYV ; + isc->try_config.dcfg_imode =ISC_DCFG_IMODE_PACKED32 ; + isc->try_config.dctrl_dview =ISC_DCTRL_DVIEW_PACKED ; + isc->try_config.bpp =16 ; +break ; +case V4L2_PIX_FMT_UYVY : + isc->try_config.rlp_cfg_mode =ISC_RLP_CFG_MODE_YCYC |ISC_RLP_CFG_YMODE_UYVY ; + isc->try_config.dcfg_imode =ISC_DCFG_IMODE_PACKED32 ; + isc->try_config.dctrl_dview =ISC_DCTRL_DVIEW_PACKED ; + isc->try_config.bpp =16 ; +break ; +case V4L2_PIX_FMT_VYUY : + isc->try_config.rlp_cfg_mode =ISC_RLP_CFG_MODE_YCYC |ISC_RLP_CFG_YMODE_VYUY ; isc->try_config.dcfg_imode =ISC_DCFG_IMODE_PACKED32 ; isc->try_config.dctrl_dview =ISC_DCTRL_DVIEW_PACKED ; isc->try_config.bpp =16 ;
@@ -964,8 +981,11 @@ static int isc_try_configure_rlp_dma(struct isc_device *isc, bool direct_dump) isc->try_config.dctrl_dview =ISC_DCTRL_DVIEW_PACKED ; isc->try_config.bpp =8 ;break ; +case V4L2_PIX_FMT_Y16 : + isc->try_config.rlp_cfg_mode =ISC_RLP_CFG_MODE_DATY10 |ISC_RLP_CFG_LSH ; + fallthrough;case V4L2_PIX_FMT_Y10 : - isc->try_config.rlp_cfg_mode =ISC_RLP_CFG_MODE_DATY10 ; + isc->try_config.rlp_cfg_mode |=ISC_RLP_CFG_MODE_DATY10 ; isc->try_config.dcfg_imode =ISC_DCFG_IMODE_PACKED16 ; isc->try_config.dctrl_dview =ISC_DCTRL_DVIEW_PACKED ; isc->try_config.bpp =16 ;
@@ -999,7 +1019,8 @@ static int isc_try_configure_pipeline(struct isc_device *isc)/* if sensor format is RAW, we convert inside ISC */ if (ISC_IS_FORMAT_RAW (isc->try_config.sd_format->mbus_code)) { isc->try_config.bits_pipeline =CFA_ENABLE | -WB_ENABLE |GAM_ENABLES ; +WB_ENABLE |GAM_ENABLES |DPC_BLCENABLE | +CC_ENABLE ; }else { isc->try_config.bits_pipeline =0x0 ; }
@@ -1008,8 +1029,9 @@ static int isc_try_configure_pipeline(struct isc_device *isc)/* if sensor format is RAW, we convert inside ISC */ if (ISC_IS_FORMAT_RAW (isc->try_config.sd_format->mbus_code)) { isc->try_config.bits_pipeline =CFA_ENABLE | -CSC_ENABLE |WB_ENABLE |GAM_ENABLES | -SUB420_ENABLE |SUB422_ENABLE |CBC_ENABLE ; +CSC_ENABLE |GAM_ENABLES |WB_ENABLE | +SUB420_ENABLE |SUB422_ENABLE |CBC_ENABLE | +DPC_BLCENABLE ; }else { isc->try_config.bits_pipeline =0x0 ; }
@@ -1019,33 +1041,39 @@ static int isc_try_configure_pipeline(struct isc_device *isc)if (ISC_IS_FORMAT_RAW (isc->try_config.sd_format->mbus_code)) { isc->try_config.bits_pipeline =CFA_ENABLE |CSC_ENABLE |WB_ENABLE |GAM_ENABLES | -SUB422_ENABLE |CBC_ENABLE ; +SUB422_ENABLE |CBC_ENABLE |DPC_BLCENABLE ; }else { isc->try_config.bits_pipeline =0x0 ; }break ;case V4L2_PIX_FMT_YUYV : +case V4L2_PIX_FMT_UYVY : +case V4L2_PIX_FMT_VYUY :/* if sensor format is RAW, we convert inside ISC */ if (ISC_IS_FORMAT_RAW (isc->try_config.sd_format->mbus_code)) { isc->try_config.bits_pipeline =CFA_ENABLE |CSC_ENABLE |WB_ENABLE |GAM_ENABLES | -SUB422_ENABLE |CBC_ENABLE ; +SUB422_ENABLE |CBC_ENABLE |DPC_BLCENABLE ; }else { isc->try_config.bits_pipeline =0x0 ; }break ;case V4L2_PIX_FMT_GREY : -if (ISC_IS_FORMAT_RAW (isc->try_config.sd_format->mbus_code)) { +case V4L2_PIX_FMT_Y16 :/* if sensor format is RAW, we convert inside ISC */ +if (ISC_IS_FORMAT_RAW (isc->try_config.sd_format->mbus_code)) { isc->try_config.bits_pipeline =CFA_ENABLE |CSC_ENABLE |WB_ENABLE |GAM_ENABLES | -CBC_ENABLE ; +CBC_ENABLE |DPC_BLCENABLE ; }else { isc->try_config.bits_pipeline =0x0 ; }break ;default : - isc->try_config.bits_pipeline =0x0 ; +if (ISC_IS_FORMAT_RAW (isc->try_config.sd_format->mbus_code)) + isc->try_config.bits_pipeline =WB_ENABLE |DPC_BLCENABLE ; +else + isc->try_config.bits_pipeline =0x0 ; }/* Tune the pipeline to product specific */
Signature · 1 line
2.25.1
PATCH v3 28/33 media: atmel: atmel-isc-sama5d2: remove duplicate define
In reply to Eugen HristevRemove a duplicate definition of clock max divider
--- drivers/media/platform/atmel/atmel-sama5d2-isc.c | 2 -- 1 file changed, 2 deletions(-)
drivers/media/platform/atmel/atmel-sama5d2-isc.c +0 -2
@@ -52,8 +52,6 @@#define ISC_SAMA5D2_MAX_SUPPORT_WIDTH 2592#define ISC_SAMA5D2_MAX_SUPPORT_HEIGHT 1944 -#define ISC_CLK_MAX_DIV 255 -#define ISC_SAMA5D2_PIPELINE \ (WB_ENABLE | CFA_ENABLE | CC_ENABLE | GAM_ENABLES | CSC_ENABLE | \ CBC_ENABLE | SUB422_ENABLE | SUB420_ENABLE)
Signature · 1 line
2.25.1
PATCH v3 29/33 dt-bindings: media: atmel-isc: convert to yaml
In reply to Eugen HristevConvert the Atmel ISC to yaml binding format.
--- .../devicetree/bindings/media/atmel,isc.yaml | 115 ++++++++++++++++++ .../devicetree/bindings/media/atmel-isc.txt | 65 ---------- 2 files changed, 115 insertions(+), 65 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/atmel,isc.yaml delete mode 100644 Documentation/devicetree/bindings/media/atmel-isc.txt
Documentation/devicetree/bindings/media/atmel,isc.yaml new file +115 -0
@@ -0,0 +1,115 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (C) 2016-2021 Microchip Technology, Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/atmel,isc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Atmel Image Sensor Controller (ISC) + +maintainers: + - Eugen Hristev <[email protected]> + +description: + The Image Sensor Controller (ISC) device provides the video input capabilities for the + Atmel/Microchip AT91 SAMA family of devices. + + The ISC has a single parallel input that supports RAW Bayer, RGB or YUV video, + with both external synchronization and BT.656 synchronization for the latter. + +properties: + compatible: + const: atmel,sama5d2-isc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + minItems: 3 + maxItems: 3 + + clock-names: + items: + - const: hclock + - const: iscck + - const: gck + + '#clock-cells': + const: 0 + + clock-output-names: + const: isc-mck + + port: + $ref: /schemas/graph.yaml#/properties/port + description: + Input port node, single endpoint describing the input pad. + + properties: + endpoint: + $ref: video-interfaces.yaml# + + properties: + remote-endpoint: true + + bus-width: + enum: [8, 9, 10, 11, 12] + default: 12 + + hsync-active: + enum: [0, 1] + default: 1 + + vsync-active: + enum: [0, 1] + default: 1 + + pclk-sample: + enum: [0, 1] + default: 1 + + required: + - remote-endpoint + + additionalProperties: false + + additionalProperties: false + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - clock-output-names + - port + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + + isc: isc@f0008000 { + compatible = "atmel,sama5d2-isc"; + reg = <0xf0008000 0x4000>; + interrupts = <46 IRQ_TYPE_LEVEL_HIGH 5>; + clocks = <&isc_clk>, <&iscck>, <&isc_gclk>; + clock-names = "hclock", "iscck", "gck"; + #clock-cells = <0>; + clock-output-names = "isc-mck"; + + port { + isc_0: endpoint { + remote-endpoint = <&ov7740_0>; + hsync-active = <1>; + vsync-active = <0>; + pclk-sample = <1>; + bus-width = <8>; + }; + }; + }; +
Documentation/devicetree/bindings/media/atmel-isc.txt deleted +0 -65
65 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH v3 29/33] dt-bindings: media: atmel-isc: convert to yaml
Quoted 10 lines · Eugen Hristev
Convert the Atmel ISC to yaml binding format.
Signed-off-by Eugen Hristev <[email protected]>--- .../devicetree/bindings/media/atmel,isc.yaml | 115 ++++++++++++++++++ .../devicetree/bindings/media/atmel-isc.txt | 65 ---------- 2 files changed, 115 insertions(+), 65 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/atmel,isc.yaml delete mode 100644 Documentation/devicetree/bindings/media/atmel-isc.txt
PATCH v4 29/33 dt-bindings: media: atmel-isc: convert to yaml
In reply to Eugen HristevConvert the Atmel ISC to yaml binding format.
---
Changes in v4:
- added '|' at description to maintain line breaks
.../devicetree/bindings/media/atmel,isc.yaml | 115 ++++++++++++++++++ .../devicetree/bindings/media/atmel-isc.txt | 65 ---------- 2 files changed, 115 insertions(+), 65 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/atmel,isc.yaml delete mode 100644 Documentation/devicetree/bindings/media/atmel-isc.txt
Documentation/devicetree/bindings/media/atmel,isc.yaml new file +115 -0
@@ -0,0 +1,115 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (C) 2016-2021 Microchip Technology, Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/atmel,isc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Atmel Image Sensor Controller (ISC) + +maintainers: + - Eugen Hristev <[email protected]> + +description: | + The Image Sensor Controller (ISC) device provides the video input capabilities for the + Atmel/Microchip AT91 SAMA family of devices. + + The ISC has a single parallel input that supports RAW Bayer, RGB or YUV video, + with both external synchronization and BT.656 synchronization for the latter. + +properties: + compatible: + const: atmel,sama5d2-isc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + minItems: 3 + maxItems: 3 + + clock-names: + items: + - const: hclock + - const: iscck + - const: gck + + '#clock-cells': + const: 0 + + clock-output-names: + const: isc-mck + + port: + $ref: /schemas/graph.yaml#/properties/port + description: + Input port node, single endpoint describing the input pad. + + properties: + endpoint: + $ref: video-interfaces.yaml# + + properties: + remote-endpoint: true + + bus-width: + enum: [8, 9, 10, 11, 12] + default: 12 + + hsync-active: + enum: [0, 1] + default: 1 + + vsync-active: + enum: [0, 1] + default: 1 + + pclk-sample: + enum: [0, 1] + default: 1 + + required: + - remote-endpoint + + additionalProperties: false + + additionalProperties: false + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - clock-output-names + - port + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + + isc: isc@f0008000 { + compatible = "atmel,sama5d2-isc"; + reg = <0xf0008000 0x4000>; + interrupts = <46 IRQ_TYPE_LEVEL_HIGH 5>; + clocks = <&isc_clk>, <&iscck>, <&isc_gclk>; + clock-names = "hclock", "iscck", "gck"; + #clock-cells = <0>; + clock-output-names = "isc-mck"; + + port { + isc_0: endpoint { + remote-endpoint = <&ov7740_0>; + hsync-active = <1>; + vsync-active = <0>; + pclk-sample = <1>; + bus-width = <8>; + }; + }; + }; +
Documentation/devicetree/bindings/media/atmel-isc.txt deleted +0 -65
65 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH v4 29/33] dt-bindings: media: atmel-isc: convert to yaml
Quoted 7 lines · Eugen Hristev
Convert the Atmel ISC to yaml binding format.
Signed-off-by Eugen Hristev <[email protected]>---
Changes in v4:
- added '|' at description to maintain line breaks
Quoted 6 lines
.../devicetree/bindings/media/atmel,isc.yaml | 115 ++++++++++++++++++ .../devicetree/bindings/media/atmel-isc.txt | 65 ---------- 2 files changed, 115 insertions(+), 65 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/atmel,isc.yaml delete mode 100644 Documentation/devicetree/bindings/media/atmel-isc.txt
PATCH v3 30/33 dt-bindings: media: add microchip,xisc device bindings
In reply to Eugen HristevAdd bindings for the Microchip eXtended Image Sensor Controller. Based on the atmel,isc.yaml binding.
--- .../bindings/media/microchip,xisc.yaml | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/microchip,xisc.yaml
Documentation/devicetree/bindings/media/microchip,xisc.yaml new file +129 -0
@@ -0,0 +1,129 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (C) 2021 Microchip Technology, Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/microchip,xisc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip eXtended Image Sensor Controller (XISC) + +maintainers: + - Eugen Hristev <[email protected]> + +description: + The eXtended Image Sensor Controller (XISC) device provides the video input capabilities for the + Microchip AT91 SAM family of devices. + + The XISC has a single internal parallel input that supports RAW Bayer, RGB or YUV video. + The source can be either a demuxer from a CSI2 type of bus, or a simple direct bridge to a + parallel sensor. + + The XISC provides one clock output that is used to clock the demuxer/bridge. + +properties: + compatible: + const: microchip,sama7g5-isc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: hclock + + '#clock-cells': + const: 0 + + clock-output-names: + const: isc-mck + + microchip,mipi-mode: + type: boolean + description: + As the XISC is usually connected to a demux/bridge, the XISC receives + the same type of input, however, it should be aware of the type of + signals received. The mipi-mode enables different internal handling + of the data and clock lines. + + port: + $ref: /schemas/graph.yaml#/properties/port + description: + Input port node, single endpoint describing the input pad. + + properties: + endpoint: + $ref: video-interfaces.yaml# + + properties: + bus-type: + enum: [5, 6] + + remote-endpoint: true + + bus-width: + enum: [8, 9, 10, 11, 12] + default: 12 + + hsync-active: + enum: [0, 1] + default: 1 + + vsync-active: + enum: [0, 1] + default: 1 + + pclk-sample: + enum: [0, 1] + default: 1 + + required: + - remote-endpoint + - bus-type + + additionalProperties: false + + additionalProperties: false + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - clock-output-names + - port + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/clock/at91.h> + #include <dt-bindings/interrupt-controller/irq.h> + + xisc: xisc@e1408000 { + compatible = "microchip,sama7g5-isc"; + reg = <0xe1408000 0x2000>; + interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&pmc PMC_TYPE_PERIPHERAL 56>; + clock-names = "hclock"; + #clock-cells = <0>; + clock-output-names = "isc-mck"; + + port { + xisc_in: endpoint { + bus-type = <5>; /* Parallel */ + remote-endpoint = <&csi2dc_out>; + hsync-active = <1>; + vsync-active = <1>; + bus-width = <12>; + }; + }; + }; +
Signature · 1 line
2.25.1
Rob Herring
maintainerRe: [PATCH v3 30/33] dt-bindings: media: add microchip,xisc device bindings
Quoted 15 lines · Eugen Hristev
Add bindings for the Microchip eXtended Image Sensor Controller. Based on the atmel,isc.yaml binding.
Signed-off-by Eugen Hristev <[email protected]>--- .../bindings/media/microchip,xisc.yaml | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/microchip,xisc.yamlDocumentation/devicetree/bindings/media/microchip,xisc.yaml new file +0
-0
Documentation/devicetree/bindings/media/microchip,xisc.yaml line 1
Quoted 1 line
Documentation/devicetree/bindings/media/microchip,xisc.yaml new file +1
-0@@ -0,0 +1,129 @@ +# SPDX-License-Identifier: GPL-2.0-only
Dual license new bindings:
GPL-2.0-only OR BSD-2-Clause
Documentation/devicetree/bindings/media/microchip,xisc.yaml line 13
Quoted 12 lines
Documentation/devicetree/bindings/media/microchip,xisc.yaml new file +12
-0+# Copyright (C) 2021 Microchip Technology, Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/microchip,xisc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip eXtended Image Sensor Controller (XISC) + +maintainers: + - Eugen Hristev <[email protected]> + +description:
You need '|' on the end if you want to preserve line breaks.
Quoted 119 lines
Documentation/devicetree/bindings/media/microchip,xisc.yaml new file +116
-0+ The eXtended Image Sensor Controller (XISC) device provides the video input capabilities for the + Microchip AT91 SAM family of devices. + + The XISC has a single internal parallel input that supports RAW Bayer, RGB or YUV video. + The source can be either a demuxer from a CSI2 type of bus, or a simple direct bridge to a + parallel sensor. + + The XISC provides one clock output that is used to clock the demuxer/bridge. + +properties: + compatible: + const: microchip,sama7g5-isc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: hclock + + '#clock-cells': + const: 0 + + clock-output-names: + const: isc-mck + + microchip,mipi-mode: + type: boolean + description: + As the XISC is usually connected to a demux/bridge, the XISC receives + the same type of input, however, it should be aware of the type of + signals received. The mipi-mode enables different internal handling + of the data and clock lines. + + port: + $ref: /schemas/graph.yaml#/properties/port + description: + Input port node, single endpoint describing the input pad. + + properties: + endpoint: + $ref: video-interfaces.yaml# + + properties: + bus-type: + enum: [5, 6] + + remote-endpoint: true + + bus-width: + enum: [8, 9, 10, 11, 12] + default: 12 + + hsync-active: + enum: [0, 1] + default: 1 + + vsync-active: + enum: [0, 1] + default: 1 + + pclk-sample: + enum: [0, 1] + default: 1 + + required: + - remote-endpoint + - bus-type + + additionalProperties: false + + additionalProperties: false + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - clock-output-names + - port + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/clock/at91.h> + #include <dt-bindings/interrupt-controller/irq.h> + + xisc: xisc@e1408000 { + compatible = "microchip,sama7g5-isc"; + reg = <0xe1408000 0x2000>; + interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&pmc PMC_TYPE_PERIPHERAL 56>; + clock-names = "hclock"; + #clock-cells = <0>; + clock-output-names = "isc-mck"; + + port { + xisc_in: endpoint { + bus-type = <5>; /* Parallel */ + remote-endpoint = <&csi2dc_out>; + hsync-active = <1>; + vsync-active = <1>; + bus-width = <12>; + }; + }; + }; +Signature · 1 line
2.25.1
PATCH v4 30/33 dt-bindings: media: add microchip,xisc device bindings
In reply to Eugen HristevAdd bindings for the Microchip eXtended Image Sensor Controller. Based on the atmel,isc.yaml binding.
--- .../bindings/media/microchip,xisc.yaml | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/microchip,xisc.yaml
Documentation/devicetree/bindings/media/microchip,xisc.yaml new file +129 -0
@@ -0,0 +1,129 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (C) 2021 Microchip Technology, Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/microchip,xisc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip eXtended Image Sensor Controller (XISC) + +maintainers: + - Eugen Hristev <[email protected]> + +description: | + The eXtended Image Sensor Controller (XISC) device provides the video input capabilities for the + Microchip AT91 SAM family of devices. + + The XISC has a single internal parallel input that supports RAW Bayer, RGB or YUV video. + The source can be either a demuxer from a CSI2 type of bus, or a simple direct bridge to a + parallel sensor. + + The XISC provides one clock output that is used to clock the demuxer/bridge. + +properties: + compatible: + const: microchip,sama7g5-isc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: hclock + + '#clock-cells': + const: 0 + + clock-output-names: + const: isc-mck + + microchip,mipi-mode: + type: boolean + description: + As the XISC is usually connected to a demux/bridge, the XISC receives + the same type of input, however, it should be aware of the type of + signals received. The mipi-mode enables different internal handling + of the data and clock lines. + + port: + $ref: /schemas/graph.yaml#/properties/port + description: + Input port node, single endpoint describing the input pad. + + properties: + endpoint: + $ref: video-interfaces.yaml# + + properties: + bus-type: + enum: [5, 6] + + remote-endpoint: true + + bus-width: + enum: [8, 9, 10, 11, 12] + default: 12 + + hsync-active: + enum: [0, 1] + default: 1 + + vsync-active: + enum: [0, 1] + default: 1 + + pclk-sample: + enum: [0, 1] + default: 1 + + required: + - remote-endpoint + - bus-type + + additionalProperties: false + + additionalProperties: false + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - clock-output-names + - port + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/clock/at91.h> + #include <dt-bindings/interrupt-controller/irq.h> + + xisc: xisc@e1408000 { + compatible = "microchip,sama7g5-isc"; + reg = <0xe1408000 0x2000>; + interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&pmc PMC_TYPE_PERIPHERAL 56>; + clock-names = "hclock"; + #clock-cells = <0>; + clock-output-names = "isc-mck"; + + port { + xisc_in: endpoint { + bus-type = <5>; /* Parallel */ + remote-endpoint = <&csi2dc_out>; + hsync-active = <1>; + vsync-active = <1>; + bus-width = <12>; + }; + }; + }; +
Signature · 1 line
2.25.1
Rob Herring
maintainerRe: [PATCH v4 30/33] dt-bindings: media: add microchip,xisc device bindings
Quoted 15 lines · Eugen Hristev
Add bindings for the Microchip eXtended Image Sensor Controller. Based on the atmel,isc.yaml binding.
Signed-off-by Eugen Hristev <[email protected]>--- .../bindings/media/microchip,xisc.yaml | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/microchip,xisc.yamlDocumentation/devicetree/bindings/media/microchip,xisc.yaml new file +0
-0
Documentation/devicetree/bindings/media/microchip,xisc.yaml line 1
Quoted 1 line
Documentation/devicetree/bindings/media/microchip,xisc.yaml new file +1
-0@@ -0,0 +1,129 @@ +# SPDX-License-Identifier: GPL-2.0-only
Dual license still missing.
Quoted 131 lines
Documentation/devicetree/bindings/media/microchip,xisc.yaml new file +128
-0+# Copyright (C) 2021 Microchip Technology, Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/microchip,xisc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip eXtended Image Sensor Controller (XISC) + +maintainers: + - Eugen Hristev <[email protected]> + +description: | + The eXtended Image Sensor Controller (XISC) device provides the video input capabilities for the + Microchip AT91 SAM family of devices. + + The XISC has a single internal parallel input that supports RAW Bayer, RGB or YUV video. + The source can be either a demuxer from a CSI2 type of bus, or a simple direct bridge to a + parallel sensor. + + The XISC provides one clock output that is used to clock the demuxer/bridge. + +properties: + compatible: + const: microchip,sama7g5-isc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: hclock + + '#clock-cells': + const: 0 + + clock-output-names: + const: isc-mck + + microchip,mipi-mode: + type: boolean + description: + As the XISC is usually connected to a demux/bridge, the XISC receives + the same type of input, however, it should be aware of the type of + signals received. The mipi-mode enables different internal handling + of the data and clock lines. + + port: + $ref: /schemas/graph.yaml#/properties/port + description: + Input port node, single endpoint describing the input pad. + + properties: + endpoint: + $ref: video-interfaces.yaml# + + properties: + bus-type: + enum: [5, 6] + + remote-endpoint: true + + bus-width: + enum: [8, 9, 10, 11, 12] + default: 12 + + hsync-active: + enum: [0, 1] + default: 1 + + vsync-active: + enum: [0, 1] + default: 1 + + pclk-sample: + enum: [0, 1] + default: 1 + + required: + - remote-endpoint + - bus-type + + additionalProperties: false + + additionalProperties: false + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - clock-output-names + - port + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/clock/at91.h> + #include <dt-bindings/interrupt-controller/irq.h> + + xisc: xisc@e1408000 { + compatible = "microchip,sama7g5-isc"; + reg = <0xe1408000 0x2000>; + interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&pmc PMC_TYPE_PERIPHERAL 56>; + clock-names = "hclock"; + #clock-cells = <0>; + clock-output-names = "isc-mck"; + + port { + xisc_in: endpoint { + bus-type = <5>; /* Parallel */ + remote-endpoint = <&csi2dc_out>; + hsync-active = <1>; + vsync-active = <1>; + bus-width = <12>; + }; + }; + }; +Signature · 1 line
2.25.1
PATCH v5 30/33 dt-bindings: media: add microchip,xisc device bindings
In reply to Eugen HristevAdd bindings for the Microchip eXtended Image Sensor Controller. Based on the atmel,isc.yaml binding.
---
Changes in v5:
- fixed license clause to add BSD-2 Changes in v4:
- added '|' at description to preserve line breaks
.../bindings/media/microchip,xisc.yaml | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/microchip,xisc.yaml
Documentation/devicetree/bindings/media/microchip,xisc.yaml new file +129 -0
@@ -0,0 +1,129 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (C) 2021 Microchip Technology, Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/microchip,xisc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip eXtended Image Sensor Controller (XISC) + +maintainers: + - Eugen Hristev <[email protected]> + +description: | + The eXtended Image Sensor Controller (XISC) device provides the video input capabilities for the + Microchip AT91 SAM family of devices. + + The XISC has a single internal parallel input that supports RAW Bayer, RGB or YUV video. + The source can be either a demuxer from a CSI2 type of bus, or a simple direct bridge to a + parallel sensor. + + The XISC provides one clock output that is used to clock the demuxer/bridge. + +properties: + compatible: + const: microchip,sama7g5-isc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: hclock + + '#clock-cells': + const: 0 + + clock-output-names: + const: isc-mck + + microchip,mipi-mode: + type: boolean + description: + As the XISC is usually connected to a demux/bridge, the XISC receives + the same type of input, however, it should be aware of the type of + signals received. The mipi-mode enables different internal handling + of the data and clock lines. + + port: + $ref: /schemas/graph.yaml#/properties/port + description: + Input port node, single endpoint describing the input pad. + + properties: + endpoint: + $ref: video-interfaces.yaml# + + properties: + bus-type: + enum: [5, 6] + + remote-endpoint: true + + bus-width: + enum: [8, 9, 10, 11, 12] + default: 12 + + hsync-active: + enum: [0, 1] + default: 1 + + vsync-active: + enum: [0, 1] + default: 1 + + pclk-sample: + enum: [0, 1] + default: 1 + + required: + - remote-endpoint + - bus-type + + additionalProperties: false + + additionalProperties: false + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - clock-output-names + - port + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/clock/at91.h> + #include <dt-bindings/interrupt-controller/irq.h> + + xisc: xisc@e1408000 { + compatible = "microchip,sama7g5-isc"; + reg = <0xe1408000 0x2000>; + interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&pmc PMC_TYPE_PERIPHERAL 56>; + clock-names = "hclock"; + #clock-cells = <0>; + clock-output-names = "isc-mck"; + + port { + xisc_in: endpoint { + bus-type = <5>; /* Parallel */ + remote-endpoint = <&csi2dc_out>; + hsync-active = <1>; + vsync-active = <1>; + bus-width = <12>; + }; + }; + }; +
Signature · 1 line
2.25.1
Re: [PATCH v5 30/33] dt-bindings: media: add microchip, xisc device bindings
Quoted 10 lines · Eugen Hristev
Add bindings for the Microchip eXtended Image Sensor Controller. Based on the atmel,isc.yaml binding.
Signed-off-by Eugen Hristev <[email protected]>---
Changes in v5:
- fixed license clause to add BSD-2 Changes in v4:
- added '|' at description to preserve line breaks
Quoted 4 lines
.../bindings/media/microchip,xisc.yaml | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/microchip,xisc.yaml
PATCH v3 31/33 media: atmel: atmel-isc: add microchip-xisc driver
In reply to Eugen HristevAdd driver for the extended variant of the isc, the microchip XISC present on sama7g5 product.
--- drivers/media/platform/Makefile | 1 + drivers/media/platform/atmel/Kconfig | 11 + drivers/media/platform/atmel/Makefile | 2 + drivers/media/platform/atmel/atmel-isc-base.c | 2 +- drivers/media/platform/atmel/atmel-isc-regs.h | 26 + .../media/platform/atmel/atmel-sama7g5-isc.c | 643 ++++++++++++++++++ 6 files changed, 684 insertions(+), 1 deletion(-) create mode 100644 drivers/media/platform/atmel/atmel-sama7g5-isc.c
drivers/media/platform/Makefile +1 -0
@@ -67,6 +67,7 @@ obj-$(CONFIG_VIDEO_RCAR_VIN) += rcar-vin/ obj-$(CONFIG_VIDEO_ATMEL_ISC) += atmel/ obj-$(CONFIG_VIDEO_ATMEL_ISI) += atmel/ +obj-$(CONFIG_VIDEO_ATMEL_XISC) += atmel/ obj-$(CONFIG_VIDEO_STM32_DCMI) += stm32/
drivers/media/platform/atmel/Kconfig +11 -0
@@ -12,6 +12,17 @@ config VIDEO_ATMEL_ISC This module makes the ATMEL Image Sensor Controller available as a v4l2 device. +config VIDEO_ATMEL_XISC + tristate "ATMEL eXtended Image Sensor Controller (XISC) support" + depends on VIDEO_V4L2 && COMMON_CLK && VIDEO_V4L2_SUBDEV_API + depends on ARCH_AT91 || COMPILE_TEST + select VIDEOBUF2_DMA_CONTIG + select REGMAP_MMIO + select V4L2_FWNODE + help + This module makes the ATMEL eXtended Image Sensor Controller + available as a v4l2 device. + config VIDEO_ATMEL_ISI tristate "ATMEL Image Sensor Interface (ISI) support" depends on VIDEO_V4L2 && OF
drivers/media/platform/atmel/Makefile +2 -0
@@ -1,5 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only atmel-isc-objs = atmel-sama5d2-isc.o atmel-isc-base.o +atmel-xisc-objs = atmel-sama7g5-isc.o atmel-isc-base.o obj-$(CONFIG_VIDEO_ATMEL_ISI) += atmel-isi.o obj-$(CONFIG_VIDEO_ATMEL_ISC) += atmel-isc.o +obj-$(CONFIG_VIDEO_ATMEL_XISC) += atmel-xisc.o
drivers/media/platform/atmel/atmel-isc-base.c +1 -1
@@ -592,7 +592,7 @@ static int isc_configure(struct isc_device *isc) mask =ISC_PFE_CFG0_BPS_MASK |ISC_PFE_CFG0_HPOL_LOW |ISC_PFE_CFG0_VPOL_LOW |ISC_PFE_CFG0_PPOL_LOW |ISC_PFE_CFG0_MODE_MASK |ISC_PFE_CFG0_CCIR_CRC | -ISC_PFE_CFG0_CCIR656 ; +ISC_PFE_CFG0_CCIR656 |ISC_PFE_CFG0_MIPI ;regmap_update_bits (regmap,ISC_PFE_CFG0 , mask, pfe_cfg0);
drivers/media/platform/atmel/atmel-isc-regs.h +26 -0
@@ -26,6 +26,7 @@#define ISC_PFE_CFG0_PPOL_LOW BIT(2)#define ISC_PFE_CFG0_CCIR656 BIT(9)#define ISC_PFE_CFG0_CCIR_CRC BIT(10) +#define ISC_PFE_CFG0_MIPI BIT(14)#define ISC_PFE_CFG0_MODE_PROGRESSIVE (0x0 << 4)#define ISC_PFE_CFG0_MODE_MASK GENMASK(6, 4)
@@ -184,6 +185,8 @@/* ISC Gamma Correction Control Register */ #define ISC_GAM_CTRL 0x00000094 +#define ISC_GAM_CTRL_BIPART BIT(4) +/* ISC_Gamma Correction Blue Entry Register */ #define ISC_GAM_BENTRY 0x00000098
@@ -222,6 +225,8 @@/* Offset for CSC register specific to sama5d2 product */ #define ISC_SAMA5D2_CSC_OFFSET 0 +/* Offset for CSC register specific to sama7g5 product */ +#define ISC_SAMA7G5_CSC_OFFSET 0x11c/* Color Space Conversion Control Register */ #define ISC_CSC_CTRL 0x00000398
@@ -246,6 +251,8 @@/* Offset for CBC register specific to sama5d2 product */ #define ISC_SAMA5D2_CBC_OFFSET 0 +/* Offset for CBC register specific to sama7g5 product */ +#define ISC_SAMA7G5_CBC_OFFSET 0x11c/* Contrast And Brightness Control Register */ #define ISC_CBC_CTRL 0x000003b4
@@ -261,18 +268,30 @@#define ISC_CBC_CONTRAST 0x000003c0#define ISC_CBC_CONTRAST_MASK GENMASK(11, 0) +/* Hue Register */ +#define ISC_CBCHS_HUE 0x4e0 +/* Saturation Register */ +#define ISC_CBCHS_SAT 0x4e4 +/* Offset for SUB422 register specific to sama5d2 product */ #define ISC_SAMA5D2_SUB422_OFFSET 0 +/* Offset for SUB422 register specific to sama7g5 product */ +#define ISC_SAMA7G5_SUB422_OFFSET 0x124 +/* Subsampling 4:4:4 to 4:2:2 Control Register */ #define ISC_SUB422_CTRL 0x000003c4/* Offset for SUB420 register specific to sama5d2 product */ #define ISC_SAMA5D2_SUB420_OFFSET 0 +/* Offset for SUB420 register specific to sama7g5 product */ +#define ISC_SAMA7G5_SUB420_OFFSET 0x124/* Subsampling 4:2:2 to 4:2:0 Control Register */ #define ISC_SUB420_CTRL 0x000003cc/* Offset for RLP register specific to sama5d2 product */ #define ISC_SAMA5D2_RLP_OFFSET 0 +/* Offset for RLP register specific to sama7g5 product */ +#define ISC_SAMA7G5_RLP_OFFSET 0x124/* Rounding, Limiting and Packing Configuration Register */ #define ISC_RLP_CFG 0x000003d0
@@ -303,6 +322,8 @@/* Offset for HIS register specific to sama5d2 product */ #define ISC_SAMA5D2_HIS_OFFSET 0 +/* Offset for HIS register specific to sama7g5 product */ +#define ISC_SAMA7G5_HIS_OFFSET 0x124/* Histogram Control Register */ #define ISC_HIS_CTRL 0x000003d4
@@ -326,6 +347,8 @@/* Offset for DMA register specific to sama5d2 product */ #define ISC_SAMA5D2_DMA_OFFSET 0 +/* Offset for DMA register specific to sama7g5 product */ +#define ISC_SAMA7G5_DMA_OFFSET 0x13c/* DMA Configuration Register */ #define ISC_DCFG 0x000003e0
@@ -376,11 +399,14 @@/* Offset for version register specific to sama5d2 product */ #define ISC_SAMA5D2_VERSION_OFFSET 0 +#define ISC_SAMA7G5_VERSION_OFFSET 0x13c/* Version Register */ #define ISC_VERSION 0x0000040c/* Offset for version register specific to sama5d2 product */ #define ISC_SAMA5D2_HIS_ENTRY_OFFSET 0 +/* Offset for version register specific to sama7g5 product */ +#define ISC_SAMA7G5_HIS_ENTRY_OFFSET 0x14c/* Histogram Entry */ #define ISC_HIS_ENTRY 0x00000410
drivers/media/platform/atmel/atmel-sama7g5-isc.c new file +643 -0
643 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v3 32/33 MAINTAINERS: update ISC driver bindings file
In reply to Eugen HristevISC driver was converted to yaml. Update maintainers file.
--- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS +1 -1
@@ -11720,7 +11720,7 @@ MICROCHIP ISC DRIVER M: Eugen Hristev <[email protected]> L: [email protected] S: Supported -F: Documentation/devicetree/bindings/media/atmel-isc.txt +F: Documentation/devicetree/bindings/media/atmel,isc.yaml F: drivers/media/platform/atmel/atmel-isc-base.c F: drivers/media/platform/atmel/atmel-isc-regs.h F: drivers/media/platform/atmel/atmel-isc.h
Signature · 1 line
2.25.1
PATCH v3 33/33 MAINTAINERS: add xisc files to isc driver entry
In reply to Eugen HristevAdd XISC driver and binding files to the ISC driver entry.
--- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+)
MAINTAINERS +2 -0
@@ -11721,10 +11721,12 @@ M: Eugen Hristev <[email protected]> L: [email protected] S: Supported F: Documentation/devicetree/bindings/media/atmel,isc.yaml +F: Documentation/devicetree/bindings/media/microchip,xisc.yaml F: drivers/media/platform/atmel/atmel-isc-base.c F: drivers/media/platform/atmel/atmel-isc-regs.h F: drivers/media/platform/atmel/atmel-isc.h F: drivers/media/platform/atmel/atmel-sama5d2-isc.c +F: drivers/media/platform/atmel/atmel-sama7g5-isc.c F: include/linux/atmel-isc-media.h MICROCHIP ISI DRIVER
Signature · 1 line
2.25.1