| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * isppreview.c |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 8 | 9 | * |
|---|
| 9 | 10 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
|---|
| 10 | 11 | * Sakari Ailus <sakari.ailus@iki.fi> |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 13 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 14 | | - * published by the Free Software Foundation. |
|---|
| 15 | 12 | */ |
|---|
| 16 | 13 | |
|---|
| 17 | 14 | #include <linux/device.h> |
|---|
| .. | .. |
|---|
| 756 | 753 | preview_config_luma_enhancement, |
|---|
| 757 | 754 | preview_enable_luma_enhancement, |
|---|
| 758 | 755 | offsetof(struct prev_params, luma), |
|---|
| 759 | | - FIELD_SIZEOF(struct prev_params, luma), |
|---|
| 756 | + sizeof_field(struct prev_params, luma), |
|---|
| 760 | 757 | offsetof(struct omap3isp_prev_update_config, luma), |
|---|
| 761 | 758 | }, /* OMAP3ISP_PREV_INVALAW */ { |
|---|
| 762 | 759 | NULL, |
|---|
| .. | .. |
|---|
| 765 | 762 | preview_config_hmed, |
|---|
| 766 | 763 | preview_enable_hmed, |
|---|
| 767 | 764 | offsetof(struct prev_params, hmed), |
|---|
| 768 | | - FIELD_SIZEOF(struct prev_params, hmed), |
|---|
| 765 | + sizeof_field(struct prev_params, hmed), |
|---|
| 769 | 766 | offsetof(struct omap3isp_prev_update_config, hmed), |
|---|
| 770 | 767 | }, /* OMAP3ISP_PREV_CFA */ { |
|---|
| 771 | 768 | preview_config_cfa, |
|---|
| 772 | 769 | NULL, |
|---|
| 773 | 770 | offsetof(struct prev_params, cfa), |
|---|
| 774 | | - FIELD_SIZEOF(struct prev_params, cfa), |
|---|
| 771 | + sizeof_field(struct prev_params, cfa), |
|---|
| 775 | 772 | offsetof(struct omap3isp_prev_update_config, cfa), |
|---|
| 776 | 773 | }, /* OMAP3ISP_PREV_CHROMA_SUPP */ { |
|---|
| 777 | 774 | preview_config_chroma_suppression, |
|---|
| 778 | 775 | preview_enable_chroma_suppression, |
|---|
| 779 | 776 | offsetof(struct prev_params, csup), |
|---|
| 780 | | - FIELD_SIZEOF(struct prev_params, csup), |
|---|
| 777 | + sizeof_field(struct prev_params, csup), |
|---|
| 781 | 778 | offsetof(struct omap3isp_prev_update_config, csup), |
|---|
| 782 | 779 | }, /* OMAP3ISP_PREV_WB */ { |
|---|
| 783 | 780 | preview_config_whitebalance, |
|---|
| 784 | 781 | NULL, |
|---|
| 785 | 782 | offsetof(struct prev_params, wbal), |
|---|
| 786 | | - FIELD_SIZEOF(struct prev_params, wbal), |
|---|
| 783 | + sizeof_field(struct prev_params, wbal), |
|---|
| 787 | 784 | offsetof(struct omap3isp_prev_update_config, wbal), |
|---|
| 788 | 785 | }, /* OMAP3ISP_PREV_BLKADJ */ { |
|---|
| 789 | 786 | preview_config_blkadj, |
|---|
| 790 | 787 | NULL, |
|---|
| 791 | 788 | offsetof(struct prev_params, blkadj), |
|---|
| 792 | | - FIELD_SIZEOF(struct prev_params, blkadj), |
|---|
| 789 | + sizeof_field(struct prev_params, blkadj), |
|---|
| 793 | 790 | offsetof(struct omap3isp_prev_update_config, blkadj), |
|---|
| 794 | 791 | }, /* OMAP3ISP_PREV_RGB2RGB */ { |
|---|
| 795 | 792 | preview_config_rgb_blending, |
|---|
| 796 | 793 | NULL, |
|---|
| 797 | 794 | offsetof(struct prev_params, rgb2rgb), |
|---|
| 798 | | - FIELD_SIZEOF(struct prev_params, rgb2rgb), |
|---|
| 795 | + sizeof_field(struct prev_params, rgb2rgb), |
|---|
| 799 | 796 | offsetof(struct omap3isp_prev_update_config, rgb2rgb), |
|---|
| 800 | 797 | }, /* OMAP3ISP_PREV_COLOR_CONV */ { |
|---|
| 801 | 798 | preview_config_csc, |
|---|
| 802 | 799 | NULL, |
|---|
| 803 | 800 | offsetof(struct prev_params, csc), |
|---|
| 804 | | - FIELD_SIZEOF(struct prev_params, csc), |
|---|
| 801 | + sizeof_field(struct prev_params, csc), |
|---|
| 805 | 802 | offsetof(struct omap3isp_prev_update_config, csc), |
|---|
| 806 | 803 | }, /* OMAP3ISP_PREV_YC_LIMIT */ { |
|---|
| 807 | 804 | preview_config_yc_range, |
|---|
| 808 | 805 | NULL, |
|---|
| 809 | 806 | offsetof(struct prev_params, yclimit), |
|---|
| 810 | | - FIELD_SIZEOF(struct prev_params, yclimit), |
|---|
| 807 | + sizeof_field(struct prev_params, yclimit), |
|---|
| 811 | 808 | offsetof(struct omap3isp_prev_update_config, yclimit), |
|---|
| 812 | 809 | }, /* OMAP3ISP_PREV_DEFECT_COR */ { |
|---|
| 813 | 810 | preview_config_dcor, |
|---|
| 814 | 811 | preview_enable_dcor, |
|---|
| 815 | 812 | offsetof(struct prev_params, dcor), |
|---|
| 816 | | - FIELD_SIZEOF(struct prev_params, dcor), |
|---|
| 813 | + sizeof_field(struct prev_params, dcor), |
|---|
| 817 | 814 | offsetof(struct omap3isp_prev_update_config, dcor), |
|---|
| 818 | 815 | }, /* Previously OMAP3ISP_PREV_GAMMABYPASS, not used anymore */ { |
|---|
| 819 | 816 | NULL, |
|---|
| .. | .. |
|---|
| 831 | 828 | preview_config_noisefilter, |
|---|
| 832 | 829 | preview_enable_noisefilter, |
|---|
| 833 | 830 | offsetof(struct prev_params, nf), |
|---|
| 834 | | - FIELD_SIZEOF(struct prev_params, nf), |
|---|
| 831 | + sizeof_field(struct prev_params, nf), |
|---|
| 835 | 832 | offsetof(struct omap3isp_prev_update_config, nf), |
|---|
| 836 | 833 | }, /* OMAP3ISP_PREV_GAMMA */ { |
|---|
| 837 | 834 | preview_config_gammacorrn, |
|---|
| 838 | 835 | preview_enable_gammacorrn, |
|---|
| 839 | 836 | offsetof(struct prev_params, gamma), |
|---|
| 840 | | - FIELD_SIZEOF(struct prev_params, gamma), |
|---|
| 837 | + sizeof_field(struct prev_params, gamma), |
|---|
| 841 | 838 | offsetof(struct omap3isp_prev_update_config, gamma), |
|---|
| 842 | 839 | }, /* OMAP3ISP_PREV_CONTRAST */ { |
|---|
| 843 | 840 | preview_config_contrast, |
|---|
| .. | .. |
|---|
| 2268 | 2265 | |
|---|
| 2269 | 2266 | v4l2_subdev_init(sd, &preview_v4l2_ops); |
|---|
| 2270 | 2267 | sd->internal_ops = &preview_v4l2_internal_ops; |
|---|
| 2271 | | - strlcpy(sd->name, "OMAP3 ISP preview", sizeof(sd->name)); |
|---|
| 2268 | + strscpy(sd->name, "OMAP3 ISP preview", sizeof(sd->name)); |
|---|
| 2272 | 2269 | sd->grp_id = 1 << 16; /* group ID for isp subdevs */ |
|---|
| 2273 | 2270 | v4l2_set_subdevdata(sd, prev); |
|---|
| 2274 | 2271 | sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; |
|---|