History log of /openbmc/linux/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c (Results 51 – 75 of 87)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 387041cd 04-Jun-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: improve sensor detection code to use _DSM table

Instead of keep hardcoding device-specific tables, read them
directly from the ACPI BIOS, if available.

This method is know to work w

media: atomisp: improve sensor detection code to use _DSM table

Instead of keep hardcoding device-specific tables, read them
directly from the ACPI BIOS, if available.

This method is know to work with Asus T101HA device. the
same table is also visible on EzPad devices. So, it seems
that at least some BIOSes use this method to pass data about
ISP2401-connected sensors.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


Revision tags: v5.4.44
# 48b532b9 03-Jun-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: use strscpy() instead of less secure variants

Replace usages of strcpy(), strlcpy() and strncpy() in favor
of strscpy().

Suggested-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-b

media: atomisp: use strscpy() instead of less secure variants

Replace usages of strcpy(), strlcpy() and strncpy() in favor
of strscpy().

Suggested-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


Revision tags: v5.7
# f5fbb83f 30-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: add SPDX headers

This driver is licensed under GPL 2.0, as stated inside their
headers.

Add the proper tag there. We should probably latter cleanup
the reduntant licensing text, but

media: atomisp: add SPDX headers

This driver is licensed under GPL 2.0, as stated inside their
headers.

Add the proper tag there. We should probably latter cleanup
the reduntant licensing text, but this could be done later,
after we get rid of other abstraction layers.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


# abbd669d 28-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: do another round of coding style cleanup

Run checkpatch --fix-inline again, in order to get rid
of some additional issues that got introduced (or that
checkpatch can now detect).

Th

media: atomisp: do another round of coding style cleanup

Run checkpatch --fix-inline again, in order to get rid
of some additional issues that got introduced (or that
checkpatch can now detect).

This should help preventing receiving random cleanups,
while keeping the code on a better shape.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


Revision tags: v5.4.43, v5.4.42
# 1d6e5c30 19-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: change the code to properly wait for sensor

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 tu

media: atomisp: change the code to properly wait for sensor

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>

show more ...


# 39c91e18 18-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: fix the value for CamClk on Asus T101HA

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@k

media: atomisp: fix the value for CamClk on Asus T101HA

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>

show more ...


Revision tags: v5.4.41
# b4dc4e13 11-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: add support for different PMIC configurations

This patch required lots of research and work. The existing
atomisp driver at staging assumed that all Intel PMIC would
be using regulat

media: atomisp: add support for different PMIC configurations

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>

show more ...


# 0741bf66 11-May-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: move atomisp_gmin_platform.c to pci/ dir

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 th

media: atomisp: move atomisp_gmin_platform.c to pci/ dir

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>

show more ...


Revision tags: v5.10.39, v5.4.119, v5.10.36, v5.10.35, v5.10.34, v5.4.116, v5.10.33, v5.12, v5.10.32, v5.10.31, v5.10.30, v5.10.27, v5.10.26, v5.10.25, v5.10.24, v5.10.23, v5.10.22, v5.10.21, v5.10.20, v5.10.19, v5.4.101, v5.10.18, v5.10.17, v5.11, v5.10.16, v5.10.15, v5.10.14, v5.10, v5.8.17, v5.8.16, v5.8.15, v5.9, v5.8.14, v5.8.13, v5.8.12, v5.8.11, v5.8.10, v5.8.9, v5.8.8, v5.8.7, v5.8.6, v5.4.62
# 815ac856 02-Sep-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: atomisp_gmin_platform: check before use

solve this smatch warning:
drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c:842 gmin_v1p8_ctrl() warn: variable d

media: atomisp: atomisp_gmin_platform: check before use

solve this smatch warning:
drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c:842 gmin_v1p8_ctrl() warn: variable dereferenced before check 'gs' (see line 832)

By moving the check to happen before its usage.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


Revision tags: v5.8.5, v5.8.4, v5.4.61, v5.8.3, v5.4.60, v5.8.2, v5.4.59, v5.8.1, v5.4.58, v5.4.57, v5.4.56, v5.8
# 9b734bb9 01-Aug-2020 Cengiz Can <cengiz@kernel.wtf>

media: atomisp: move null check to earlier point

`find_gmin_subdev()` that returns a pointer to `struct
gmin_subdev` can return NULL.

In `gmin_v2p8_ctrl()` there's a call to thi

media: atomisp: move null check to earlier point

`find_gmin_subdev()` that returns a pointer to `struct
gmin_subdev` can return NULL.

In `gmin_v2p8_ctrl()` there's a call to this function but the
possibility of a NULL was not checked before its being dereferenced,
i.e.:

/* Acquired here --------v */
struct gmin_subdev *gs = find_gmin_subdev(subdev);

/* v------Dereferenced here */
if (gs->v2p8_gpio >= 0) {
...
}

With this change we're null checking `find_gmin_subdev()` result
and we return an error if that's the case. We also WARN()
for the sake of debugging.

Signed-off-by: Cengiz Can <cengiz@kernel.wtf>
Reported-by: Coverity Static Analyzer CID 1465536
Suggested-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


Revision tags: v5.7.12, v5.4.55, v5.7.11, v5.4.54, v5.7.10, v5.4.53, v5.4.52, v5.7.9, v5.7.8, v5.4.51, v5.4.50, v5.7.7
# e8b4a890 29-Jun-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

media: atomisp: Get rid of ACPI specifics in gmin_subdev_add()

First of all ACPI HID is a part of the device name which is printed
as a part of the dev_info(dev, ...); line. Second, sinc

media: atomisp: Get rid of ACPI specifics in gmin_subdev_add()

First of all ACPI HID is a part of the device name which is printed
as a part of the dev_info(dev, ...); line. Second, since the only BID
is left, it's a part of ACPI path, which can be printed via %pfw.

Besides that, drop ACPI handle from atomisp_get_acpi_power() parameters.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


# 5cb30aed 29-Jun-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

media: atomisp: Provide Gmin subdev as parameter to gmin_subdev_add()

Provide Gmin subdev as parameter to gmin_subdev_add()
to avoid direct global variable usage.

Signed-off-by:

media: atomisp: Provide Gmin subdev as parameter to gmin_subdev_add()

Provide Gmin subdev as parameter to gmin_subdev_add()
to avoid direct global variable usage.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


# fecd8833 29-Jun-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

media: atomisp: Use temporary variable for device in gmin_subdev_add()

Use temporary variable for device in gmin_subdev_add().

While here, drop unused temporary variable for device

media: atomisp: Use temporary variable for device in gmin_subdev_add()

Use temporary variable for device in gmin_subdev_add().

While here, drop unused temporary variable for device in other places.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


# c30f4cb2 29-Jun-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

media: atomisp: Refactor PMIC detection to a separate function

Refactor PMIC detection to a separate function. In the future
we may move this code somewhere else where it's more suitable

media: atomisp: Refactor PMIC detection to a separate function

Refactor PMIC detection to a separate function. In the future
we may move this code somewhere else where it's more suitable.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


# e4fb745c 26-Jun-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

media: atomisp: Deduplicate return ret in gmin_i2c_write()

Deduplicate return ret in gmin_i2c_write().

While here, replace 'Kernel' by 'kernel' in the message and
reduce amount

media: atomisp: Deduplicate return ret in gmin_i2c_write()

Deduplicate return ret in gmin_i2c_write().

While here, replace 'Kernel' by 'kernel' in the message and
reduce amount of LOCs.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


# 2e31e6f8 26-Jun-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

media: atomisp: Make pointer to PMIC client global

When we enumerate second device when PMIC has been successfully detected
to AXP, we got into troubles dereferencing NULL pointer. It se

media: atomisp: Make pointer to PMIC client global

When we enumerate second device when PMIC has been successfully detected
to AXP, we got into troubles dereferencing NULL pointer. It seems
we have to detect PMIC only once because pmic_id is a global variable
and code doesn't expect the change of it: Two PMICs on one platform?
It's impossible.

Crash excerpt:
[ 34.335237] BUG: kernel NULL pointer dereference, address: 0000000000000002
...
[ 35.652036] RIP: 0010:gmin_subdev_add.cold+0x32f/0x33e [atomisp_gmin_platform]

So, as a quick fix make power a global variable. In next patches we move
PMIC detection to be more independent from subdevices.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


# 0f46ab46 26-Jun-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

media: atomisp: Don't try to parse unexpected ACPI object type

There are devices with completely different _DSM() format,
and accessing object as a package leads to crashes.

Bai

media: atomisp: Don't try to parse unexpected ACPI object type

There are devices with completely different _DSM() format,
and accessing object as a package leads to crashes.

Bail out in the case of unexpected object type.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


# 96310fd8 26-Jun-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

media: atomisp: make platform data more readable

Add few blank lines to make platform data more readable.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Sign

media: atomisp: make platform data more readable

Add few blank lines to make platform data more readable.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


# 89027fea 26-Jun-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

media: atomisp: Unify pdev to be pointer to struct pci_device

Unify pdev to be pointer to struct pci_device.

While here, reindent some (touched) lines for better readability.

media: atomisp: Unify pdev to be pointer to struct pci_device

Unify pdev to be pointer to struct pci_device.

While here, reindent some (touched) lines for better readability.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


# 4f307131 26-Jun-2020 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

media: atomisp: Use proper APIs to find I²C client device by ACPI HID

There are specific ACPI and I\xB2C APIs to match device by different
parameters, such as ACPI HID, and retrieve an I

media: atomisp: Use proper APIs to find I²C client device by ACPI HID

There are specific ACPI and I\xB2C APIs to match device by different
parameters, such as ACPI HID, and retrieve an I\xB2C client.
Use them instead of home grown approach.

Note, it fixes a resource leak as well.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


Revision tags: v5.4.49, v5.7.6, v5.7.5, v5.4.48
# 79317baa 21-Jun-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: place all gpio parsing together

Instead of parsing GPIO for two exceptions inside the logic
which would be trying to use the GPIO, move the init code
to the routine w

media: atomisp: place all gpio parsing together

Instead of parsing GPIO for two exceptions inside the logic
which would be trying to use the GPIO, move the init code
to the routine which adds a new gmin device.

Move the notes to it too, as this helps to identify where
those two GPIO settings are used, explaining why they're
defaulting to -1 when not found.

Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


# 2b5b3221 21-Jun-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: split add from find subdev

There's only one place where a subdev can be added: when the
sensor driver registers it. Trying to do it elsewhere will
cause problems, as

media: atomisp: split add from find subdev

There's only one place where a subdev can be added: when the
sensor driver registers it. Trying to do it elsewhere will
cause problems, as the detection code needs to access the
I2C bus in order to probe some things.

Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


# 1153cb48 21-Jun-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: print info if gpio0 and gpio2 were detected

If the ACPI DSDT tables provide _CRS for the camera, the
GPIO core code should be able to handle them automatically.

media: atomisp: print info if gpio0 and gpio2 were detected

If the ACPI DSDT tables provide _CRS for the camera, the
GPIO core code should be able to handle them automatically.

Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


# e2c57942 20-Jun-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: properly parse CLK PMIC on newer devices

Newer devices don't place the PMIC CLK line inside an EFI
var. Instead, those are found at the _PR0 table.

Add a parser

media: atomisp: properly parse CLK PMIC on newer devices

Newer devices don't place the PMIC CLK line inside an EFI
var. Instead, those are found at the _PR0 table.

Add a parser for it, using info stored via the DSDT table.

Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


Revision tags: v5.7.4, v5.7.3, v5.4.47
# d6697288 14-Jun-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

media: atomisp: Prepare sensor support for ACPI PM

Add support code for this driver to use ACPI power management.

Yet, at least with known devices, this won't work without
furth

media: atomisp: Prepare sensor support for ACPI PM

Add support code for this driver to use ACPI power management.

Yet, at least with known devices, this won't work without
further changes.

The rationale is that the ACPI handling code checks for the _PR? tables
in order to know what is required to switch the device from power state
D0 (_PR0) up to D3COLD (_PR3).

The adev->flags.power_manageable is set to true if the device has a _PR0
table, which can be checked by calling acpi_device_power_manageable(adev).

However, this only says that the device can be set to power off mode.

At least on the DSDT tables we've seen so far, there's no _PR3 nor _PS3
(which would have a somewhat similar effect).

So, using ACPI for power management won't work, except if adding
an ACPI override logic somewhere.

Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


1234