summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-05-20media: atomisp: allow building for isp2401Mauro Carvalho Chehab
Now that everything needed to build for ISP2401 is solved, we can setup atomisp to build either for ISP2400 or ISP2401. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: change function worders and fix includeMauro Carvalho Chehab
With the current way, it will produce lots of errors because the public header contains wrong definitions and the private one has functions defined at the wrong order. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: get rid of some broken codeMauro Carvalho Chehab
Probably due to some version conflicts while the atomisp code were generated, some things don't build for ISP2401. So, use the ISP2400 variant when available, or get rid of the code that doesn't build. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: cleanup directory hierarchyMauro Carvalho Chehab
This driver has very long directories without a good reason (IMHO). Let's drop two directories from such hierarchy, in order to simplify things a little bit and make the dir output a bit more readable. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: simplify makefilesMauro Carvalho Chehab
Remove an uneeded define and Makefile. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: make all file names unique at atomisp driverMauro Carvalho Chehab
The *system_*.h files contain ISP-specific definitions, and are used everywhere. While the best would be to get rid of those in favor of some ISP-specific structs, a change like that would require lots of changes. So, instead, let's rename those files replacing them by new ones with ISP ifdefs on it, in order to select between the two different versions. We shall later convert this to some abrstraction layer, but this change should help to be able to build support for either ISP2400 or ISP2401. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: get rid of __ISP define testsMauro Carvalho Chehab
This is not defined anywhere, so just get rid of the dead source code. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: get rid of ISP_VMEM_IS_BAMEM unused definesMauro Carvalho Chehab
There are several defines on ISP-specific definition sets that are unused, related to VMEM_BAMEM. Get rid of those. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: get rid of ia_css_sc_param.h version dependencyMauro Carvalho Chehab
That's the last header file which had ifdefs for ISP2401. The problem is that the conflicting dependencies were on another file (sh_css_defs.h). Move the conflicting code to it, adding a prefix which would describe what version the macro applies. Then, ensure that binary.c will use the right version, according with the hardware version. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: get rid of trivial version checks at *.hMauro Carvalho Chehab
Most of the remaining ifdefs check for ISP2401 are trivial. Get rid of them. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: remove unused duplicated filesMauro Carvalho Chehab
Those files aren't used. So, just get rid of them. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: get rid of io_ls/ subdirMauro Carvalho Chehab
The contents of this file is identical to ipu2_io_ls, except for the bayer directory, with is only at ipu2_io_ls. So, get rid of the duplicated code. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: rename anr2 param header fileMauro Carvalho Chehab
This file is different than the anr1 version. So, let's name it differently. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: remove bayer_io_ls duplicationMauro Carvalho Chehab
There are two instances of those, one for isp2401 and another one for isp2400, both with identical contents, except for comments and an ifdef. Get rid of one of them. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: use regulator_get_optional() for first attemptMauro Carvalho Chehab
Some BIOSes seem to use different names for some regulators. Use regulator_get_optional() for the first attempt, in order to avoid using the dummy regulator and produce a warning, in the case that the first attempt fails. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: add Asus Transform T101HA ACPI varsMauro Carvalho Chehab
Those were extracted from an ACPI dump: * Original Table Header: * Signature "DSDT" * Length 0x0001A0BD (106685) * Revision 0x02 * Checksum 0x76 * OEM ID "_ASUS_" * OEM Table ID "Notebook" * OEM Revision 0x01072009 (17244169) * Compiler ID "INTL" * Compiler Version 0x20120913 (538052883) */ DefinitionBlock ("", "DSDT", 2, "_ASUS_", "Notebook", 0x01072009) ... Local0 = Package (0x12) { "CamId", "ov2680", "CamType", "1", "CsiPort", "0", "CsiLanes", "1", "CsiFmt", "15", "CsiBayer", "0", "CamClk", "1", "Regulator1p8v", "0", "Regulator2p8v", "0" } Note: the DMI_MATCH() line probably needs to be tweaked. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: get finish de-duplication of hrt/hive*.hMauro Carvalho Chehab
The last header (hive_isp_css_2401_irq_types_hrt.h) is also almost identical, except by an if ISP2400 inside a comment block. Remove the duplication and keep just one file. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: hive_isp_css_defs.h: keep just one copy of itMauro Carvalho Chehab
While those headers are different, the different fields aren't used at the driver. So, remove those different unused fields, rename one define and use just one header for all 3 different versions of the ISP. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: remove unused hive_isp_css_host_ids_hrt.hMauro Carvalho Chehab
Nothing here is really used by the driver. So, let's just get rid of them. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: remove several duplicated filesMauro Carvalho Chehab
Those files have identical contents, but are located at different parts of the driver. As their contents are identical, we can simply remove them. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: remove unused definitions at */isp_capture_defs.hMauro Carvalho Chehab
The isp_capture_defs.h contain several unused defines. Get rid of some of them, making all 3 instances identical. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: get rid of unused header filesMauro Carvalho Chehab
Those 4 header files aren't used anyware. So, send them to the trash can. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: get rid of trivial ISP2401 dependencies on header filesMauro Carvalho Chehab
On several header files, the dependency for ISP2401 is trivial: for example, it just adds new fields on structs or declare new functions. Get rid of those trivial cases. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: get rid of several typedef-style definesMauro Carvalho Chehab
Those vars aren't used anymore at this driver. Get rid of them. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: isp_const.h: get rid of an unused big define listMauro Carvalho Chehab
None of those SH_CSS_BINARY_ID_* symbols are used by this driver anymore. So, get rid of all of them. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: sh_css: detect ISP version at runtimeMauro Carvalho Chehab
Get rid of all those ifdefs that were checking for ISP2401 inside sh_css.c. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: make util.c work with ISP2401 runtime detectionMauro Carvalho Chehab
Don't hide those small functions behind ifdefs. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: get rid of some non-existing functions for ISP2401Mauro Carvalho Chehab
There are no ia_css_set_system_mode() nor ia_css_is_system_mode_suspend_or_resume() functions at the driver. So, get rid of the code that would try to call it. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: ia_css_binary_get_shading_info(): don't test versionMauro Carvalho Chehab
It doesn't make any sense to change the number of parameters for this function depending on the ISP version. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: css_trace.h: use the newest tracing codeMauro Carvalho Chehab
The css_trace header for ISP2401 also builds on older versions, and seems to be compatible with all versions. So, remove all ifdefs in favor of the CSP2401 version. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: add support for possible new namesMauro Carvalho Chehab
This patch addresses what it sounds to be a change at the name of some ACPI registers on newer ACPI tables. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: print css_version in runtimeMauro Carvalho Chehab
The CSS version returned by ISP2400 is different than the one returned by ISP2401. While we could return just one version for both, as this sounds like just an informative string, for now, let's keep returning different versions, as we don't know if this would affect userspace. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: sh_css_param_dvs.h remove ISP version macrosMauro Carvalho Chehab
As namespaces aren't duplicated here, just remove the ifdefs. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: unify sh_css_params_shading_id_table_generate()Mauro Carvalho Chehab
Instead of packing parameters differently on ISP2400 and ISP2401, use just one way of passing them for both. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: remove table duplication from dfs tablesMauro Carvalho Chehab
The way atomisp_dfs_tables.h is defined, it ends by duplicating all data structs there on both atomisp_v4l2.c and atomisp_cmd.c. Change the logic in order to place the definitions only on a single place. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: remove ISP version macros from sh_css_legacy.hMauro Carvalho Chehab
This header is really version-independent. So, just get rid of the macros from it. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: make sh_css_sp_init_pipeline() ISP version independentMauro Carvalho Chehab
This function call has two parameters that are used only with ISP2401, enclosed on some ugly ifdefs. Make the function independent, passing NULL values for ISP2400. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: make sh_css_struct.h independent of ISP versionMauro Carvalho Chehab
Use the same struct for both ISP2400 and ISP2401. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: sh_css_defs.h: get rid of build time dependenciesMauro Carvalho Chehab
There are several #ifdefs checking for ISP version there. Some of them are just two different ways to represent the same contants, while 3 parameters are actually different, depending on the ISP version. Change the header in a way that it will be compatible with both versions, and change dependent code to keep running, removing ifdefs there only when possible. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: atomisp_compat_ioctl32.c: be independent of ISP versionMauro Carvalho Chehab
There are two ioctls that are only available with ISP2401. Yet, at the compat level, we don't really need to take care, as the native ioctl handler will already return an error code if the ioctl doesn't exist. So, let's just remove the ifdefs here. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: atomisp_compat_css20.c: detect ISP at runtimeMauro Carvalho Chehab
Remove ifdefs that check ISP version from the code, switching to specific ISP-dependent code at runtime. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: atomisp_csi2.c: remove useless ifdefsMauro Carvalho Chehab
The ifdefs there are meaningless. Just remove them for good. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: atomisp_subdev.c check ISP version on runtimeMauro Carvalho Chehab
Remove ISP-version-dependent ifdefs. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: atomisp_v4l2.c: set wdt timers according with ISP versionMauro Carvalho Chehab
Add a runtime check to use the proper wdt timer init at runtime, depending on the chipset revision. For now, we can't get rid of the remaining version checks, as the rest of the code is not prepared yet to detect the ISP version on runtime. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: atomisp_ioctl.c: get rid of a ISP2400/ISP2401 dependencyMauro Carvalho Chehab
Replace #ifdef occurrences there with runtime checks. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: pci/atomisp2/*.h remove #ifdef ISP2401Mauro Carvalho Chehab
Those ifs can easily be removed without breaking the code. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: atomisp_dfs_tables.h: don't depend on ISP versionMauro Carvalho Chehab
There's a dependency on this header for the ISP model. While this sounds really weird (as just one resolution needs it), as we don't know what's the right value, let's just keep it. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: atomisp_cmd.c test ISP version in runtimeMauro Carvalho Chehab
The logic there has lots of ifdef dependencies if the hardware is either ISP2400 or ISP2041. Replace them by runtime checks. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: add a way for the driver to know the chipset versionMauro Carvalho Chehab
The atomisp supports two different chipsets: ISP2400 and ISP2401. Right now, this is controlled by ugly #defines inside the driver. Add a global bolean to identify the type of hardware. While this is hacky, it would be a quick way to start removing the ugly ifdefs. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-05-20media: atomisp: simplify math_support.hMauro Carvalho Chehab
There are some uneeded defines there. Simplify it, and make it independent of defines. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>