reg property is not used in Rockchip MIPI DPHY RX0 bindings, thus remove
it.
Suggested-by: Johan Jonker <jbx6244@gmail.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Based on Yocto Aero's repository, the file name for the isp2401
is the same for the B0 release.
So, unify it at the driver.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
When checking sh_css.c against the Yocto Aero's version, it can
be noticed that some isp2401 dependencies may have been taken
wrongly.
Change the code to work like the Yocto Aero, as this driver
was tested in the past with an ISP2401 device.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Depending on the ISP-specific HAS_NO_INPUT_FORMATTER macro,
some IRQs will be ignored by the driver. Yet, those keep
happening, as reported by this debug print:
[ 61.620746] atomisp-isp2 0000:00:03.0: atomisp_css_irq_enable: css irq info 0x00000004: disable.
Causing this warning:
[ 61.620749] atomisp-isp2 0000:00:03.0: atomisp_css_irq_enable:Invalid irq info.
Well, if this is a normal situation, just ignore it without
warnings.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Calling acpi_bus_get_device() may end allocating resources that
aren't freed. So, add a notice about that, as, if those drivers
get out of staging, we may need some changes.
Fixes: 0d64e94205 ("media: atomisp: Add some ACPI detection info")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
The memory management code for atomisp is complex: it has 2
extra pools (plus some ION-specific code).
The code for those extra pools are complex, and there are even
some parts of code over there that were forked from some
mm/ code, probably from Kernel 3.10.
Let's just use a single one, in order to make the driver
simpler.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Instead of trying to send multiple bytes at the same time,
just go one by one, like the upstream driver does.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
There is an ov2680 driver mainstream. Use the read/write
routines from it, as the ones inside this driver are
generating some errors:
ov2680 i2c-OVTI2680:00: ov2680_i2c_write: i2c write reg=0x3086, value 0x00, error -121
Maybe the code that changes from/to BE are not right.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Change some code at ov2680 for it to better report what's
happening there at sensor's level.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
The sensor should finish its init before atomisp driver, as
otherwise the atomisp driver won't be able to talk with it.
So, we need to turn atomisp_gmin_platform into a module
again, for it to not depend on atomisp driver to finish
probing, and add some delay at atomisp to let the sensor
driver to finish probing.
Yeah, this is hacky. The real solution here would be to use
the async framework, but for now, our goal is to make the
driver to work. So, let's postpone such change to be done
later.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
The current code causes ISP2401 to power down and never return
back to live, causing the driver to crash.
Fix it by commenting out the bad code. It should be noticed that
the Yocto Aero code has something similar to it.
Maybe the issue is related to an ISP bug (or maybe PM is
controlled on a different way for this hardware).
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
The value returned by BIOS is 1. Fix it at the driver,
as it won't read this from EFI.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Simplify the hmm_bo a little bit by removing this
macro. This will avoid printing twice errors when
allocations happen.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Those files seem to be firmware-dependent, probably being used
by some debug interface.
Well, their contents are not really used by atomisp, so let's
just send them to the trash can, as it shouldn't have any
usage upstream.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
When changing the IFs to select isp2401 at runtime, one of
the conditions ended by being written wrong.
Code double-checked on both Yocto Aero's driver version and
against the previous code.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Use the version from intel_atomisp2_pm.c for power up/down,
removing some code duplication and using just one kAPI call
for modifying the ISPSSPM0 register.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Changing to pci_enable_device() didn't produce the expected
result. It could also eventually led to problems when driver
is removed, due to object lifetime issues. So, let's just
return to the previous behavior.
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This patch required lots of research and work. The existing
atomisp driver at staging assumed that all Intel PMIC would
be using regulators, but upstream didn't follow it. Instead,
the intel_pmic.c driver added a hack, instead of using i2c_transfer,
it writes I2C values directly via regmapped registers.
Oh, well... At least, it provided a common API for doing that.
The PMIC settings used here came from the driver at the
yocto Aero distribution:
https://download.01.org/aero/deb/pool/main/l/linux-4.4.76-aero-1.3/
The logic itself was re-written, in order to use the I2C address
detected by the probing part.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
The atomisp_gmin_platform.c is not a platform driver anymore,
but it is, instead, part of the atomisp driver.
Move it to be together with the driver. As a bonus, as the
atomisp i2c drivers depends on its contents, probing them
should load automatically the atomisp core. This should
likely avoid some possible race conditions.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sub-device's power management can be provided via different ways.
Instead of hardcoding it, add a code that would be detecting it.
This uses a code similar to what's found at the atomisp driver
inside the Intel Aero repository:
https://github.com/intel-aero/meta-intel-aero.git
(driver was removed on some commit, but it can be found on
git history).
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Right now, the driver supports just one VCM and just one
flash device. Warn if more than one such devices were
probed.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This driver is really on bad shape. One of the problems
is that, as soon as the I2C transfers start to happen, it
timeouts detecting a camera:
ov2680 i2c-OVTI2680:00: ov2680_probe: ACPI detected it on bus ID=CAM1, HID=OVTI2680
atomisp-isp2 0000:00:03.0: no camera attached or fail to detect
ov2680 i2c-OVTI2680:00: gmin: initializing atomisp module subdev data using PMIC regulator
...
The right fix here would be to use defer probe, but driver is
still on too bad shape.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
While the current code is hardcoded to just one specific
type of PMIC, it can support several types. Those should
be board-dependent. Instead of just printing a number,
change the message to display what type of PMIC control
is used at runtime.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
There are several device-specific data that are obtained
either via DMI or EFI, with changes the driver's behavior.
Display what has been detected, as such info may help
identifying troubles at the driver.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
When someone would report problems with a new device, we
need to know the DMI product ID and the ACPI name for the
detected sensor. So, print them at dmesg.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This driver still has lots of issues. Let's enable debug
there inconditionally, as we need more information in order
to address the pending issues.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This setting is used only for one of te Merryfield PCI IDs.
As this is an ISP2400, we can just get rid of a version
test, writing the right value directly inside the struct.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
The atomisp probe error logic is incomplete. Add the missing
bits to return the PCI device to its original state.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
As getting the exact version used by the driver is not easy,
let's relax the version detection and hope for the best,
producing just a warning.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
- Remove useless check if !dev at the probe function: if
such function is called, the device is defined.
- Cleanup the PCI ID table using macros.
- Use the same macros at the version-dependent part of the
atomisp_v4l2.c file;
- Add print messages to help understand what model the
driver detect;
- If device is not valid, better explain why.
Signed-off-by: Mauro Carvalho Chehehab <mchehab+huawei@kernel.org>
changeset d5426f4c2e ("media: staging: atomisp: use clock framework for camera clocks")
removed a platform-specific code to set the clock rate, in favor of
using the Kernel clock framework.
However, instead of passing the frequency for clk_set_rate(),
it is passing either 0 or 1.
Looking at the original patchset, it seems that there are two
possible configurations for the ISP:
0 - it will use a 25 MHz XTAL to provide the clock;
1 - it will use a PLL with is set to 19.2 MHz
(only for the CHT version?)
Eventually, different XTALs and/or PLL frequencies might
be possible some day, so, re-implent the logic for it to be
more generic.
Fixes: d5426f4c2e ("media: staging: atomisp: use clock framework for camera clocks")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
The printed message when a firmware version is wrong says nothing
usefull:
atomisp-isp2 0000:00:03.0: Fw version check failed.
atomisp-isp2: probe of 0000:00:03.0 failed with error -22
Print the expected and the received firmware version instead.
In order to do that, the firmware functions will need at least
a struct device pointer, so pass it.
While writing this patch, it was noticed that some of the
abstraction layers of this driver have functions that are never
called, but use this interface. Get rid of them.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
As the atomisp driver should already be handling the ISP
PCI ID, there's no sense on keeping the dummy driver enabled
in tis case.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
With the changes, this function is now undefined if built
for ISP2400. So, move its implementation to the file which
calls it.
Reported-by: Francescodario Cuzzocrea <francescodario.cuzzocrea@mail.polimi.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Some recent changes at V4L2 core changed the way querycap is handled.
Due to that, this warning is generated:
WARNING: CPU: 1 PID: 503 at drivers/media/v4l2-core/v4l2-dev.c:885 __video_register_device+0x93e/0x1120 [videodev]
as introduced by this commit:
commit 3c1350501c
Author: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Date: Tue Jul 23 04:21:25 2019 -0400
media: v4l2-dev/ioctl: require non-zero device_caps, verify sane querycap results
Now that all V4L2 drivers set device_caps in struct video_device, we can add
a check for this to ensure all future drivers fill this in.
The fix is simple: we just need to initialize dev_caps before
registering the V4L2 dev.
While here, solve other problems at VIDIOC_QUERYCAP ioctl.
Reported-by: Patrik Gfeller <patrik.gfeller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
There are currently two identical copies of some files, one
at css_2401_csi2p_system/ and another one at css_2401_system/.
Get rid of one of them, moving the remaining files to the
directory with the shortest name.
While here, do more renames, in order to get smaller path
names.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
The Asus Transformer T101HA comes with a newer hardware
version. Add support to load firmware for it.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
There are lots of places inside this driver checking for
ISP2400/ISP2401 verison. Get rid of most of those, while
keep building for both.
Most of stuff in this patch is trivial to solve.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>