cpufreq: ondemand: Remove input boost

A probably imperfect extermination of ondemand's input boost.
We rely on the universal cpu boost input handler now.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera:v2: Fix for broken video HDR

If there is RDI stream, we should continue the loop,
iotherwise pix_stream_count is never incremented for PIX stream.

Change-Id: I3dad2a1c52926bf02cde7695ee5e7127dba2fde7
Signed-off-by: Sagar Gore <csgore@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Enqueue native buffer directly

For native buffer, when userspace queue back
the buffer from userspace, whether the buffer
is clean/dirty, the buffer should go back to
the native buffer queue, otherwise the buffer
will be in invalid state.

Change-Id: Ia41bb950d39e144e251d0feea099d4a517a11852
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: Add support for JPEG RAW & META RAW cam format

Add num of planes, size, xbar config and v4l2 support for
JPEG and META RAW formats

Change-Id: I940c72c43321390fe95deb3e0a0e649fa9a98a1e
Signed-off-by: Harsh Shah <harshs@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera_v2: Use stream cnt for unique stream id

Add new atomic counter for keeping track of stream counts.
The exisitng open_cnt counter is not full-proff since there could
be multiple streams with the stream id in the folowing
scenario:
a) Create stream 1, 2, and 3
b) Destroy stream 2
c) Add new stream; will result in another stream with id 3.

CRs-fixed: 493632
Change-Id: Icfa3cb2fd2c34c6da7e5f09d016fef4577331264
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm_sensor: fix vreg dt parsing logic

Previously, dt parsing code for sensor power up sequence assumes certain
value and order in "qcom,cam-vreg-name".  Such assumption can't be
enforced by dt itself.  It leads to kernel panic when enum value of a vreg
is larger than total number of specified vregs.

New implementation dynamically search and match available vregs, instead of
relying on order and enum assumptions.

Change-Id: Iea519f2e4b4d805fecf6dd699ade2af4a00caa43
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Improve interface for large SPI reads

For each SPI read, two buffers of read size + header need to be
allocated.  These allocation might fail if read size is large.  It's also
expensive to allocate memory each time for repeated transfers.
Therefore, msm_camera_spi_read_seq_l() is provided to use pre-allocated
buffers instead of allocating them each time.

Change-Id: Ibd52fd26bb0a4fdd913bef9c2bfc410152245c3b
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Add advanced feature for yuv sensor

Add set auto focus and call back for auto focus for yuv
sensor. Enable the features saturation, brightness,
sharpness for the YUV sensors.

Change-Id: I8003465f337848d8728dcc6cd073eb5047e26e77
Signed-off-by: Lokesh Kumar Aakulu <lkumar@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm:camera: change to add the gpio control Vreg enable

Some auto focus module has PWDM pin to be enabled by gpio, and we
also need to add gpio enable vreg to support different customers.

Change-Id: Id9b230c855a7665697d1ddc80fa845e44ba6f4b0
Signed-off-by: feim <Flynn@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera2: Enhance processed divert in cpp driver.

The processed divert frames from cpp driver can be queued back
to free queue or queued in done queue. This change enhances
cpp driver to support both modes of operation.

Change-Id: I2ec08bd9c25fdb1db089d974c935e97898840e39
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm:cpp: Check number of buffers before allocate stream_info

Number of buffers used by cpp is defined by user space. In
case this number is ZERO the allocated memory space will be
pointed by ZERO_SIZE_PTR. Referencing ZERO_SIZE_PTR, causes
same type of behavior as referencing the NULL pointer

Change-Id: I42665225c7d055cda6749198c35e94c1442c6d3e
Signed-off-by: Iliya Varadzhakov <ivarad@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera2: Validate frame during timeout in cpp driver

During long stability stress runs, invalid frames are encountered
in timeout processing. When frame acknowledgement is delayed by
firmware due to various reasons the timeout handler could hit
frame that are already processed. Hence adding NULL condition
check to avoid invalid frame access.

Change-Id: Icaa5e630d5190a7bf0a4e07a95d08e116cb304db
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Use default value if CSIPHY param is NULL

Use default value if CSIPHY lane mask is NULL. This value will be
0x0 if open camera fails and releases CSIPHY driver in error
handling case.

Change-Id: I2ba1e2f3559de208974deb2598278298909ce208
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Update CPP driver for new hardware version

Update CPP driver for 0x10010001 version which is used in 8974 v3
pro.

Change-Id: Iefb7d4fa852a3548e866f460994a0c1744578e36
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Fix VFE IOMMU page faults

To avoid VFE IOMMU page faults in case of
vfe write masters bus overflows, enable
bus overflow override flag to allow
non overflowing write masters to continue
thier operation.

Change-Id: I9452acac2b70786217b3d65029e1b68cee2fdf3e
Signed-off-by: Suresh Vankadara <svankada@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
camera_v2: jpeg: Use buf_cmd.offset for v2p size calculation

Start using buf_cmd.offset when calculating the memory map
size for v2p. This is needed to enable ION input buffer support
for JPEG decoding.The input buffer has a header before the actual
bitstream.

Signed-off-by: Kamen Kirov <kkirov@codeaurora.org>
Change-Id: If9bdcefe3628bd21c9e76916e4d7e3dc3cc39447
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Check stats index MAX in ISP driver

Add a check for the stats index MAX using
MSM_ISP_STATS_MAX before accessing stream info
using that index to avoid any invalid memory access.

Change-Id: Iaade2af5d0e3e073e9519961a0f84a93038284bf
CRs-Fixed: 514711
Signed-off-by: Hariram Purushothaman <hpurus@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Implements ISPIF HW reset.

1. Add version and ISPs number properties in DT ISPIF node
  ISPIF driver needs to know HW version of ISPIF module and number of
  ISPs to which it is connected in order to execute proper reset of
  ISPIF module. For this purpose, two optional properties for these
  are added to ISPIF node. Both properties are optional - if not
  present, ISPIF driver will use default values.

2. Resets ISPIF HW
  Force hardware reset during hardware start to ensure
  all the line buffers are cleared. Reset is done once after first
  open of the module. In order to reset module clocks of CSID and ISPs
  connected to it should be enabled.

Change-Id: I6570ea45d1211c66fe5d6e80d1d2faa019415b68
Signed-off-by: Petar Sivenov <psiven@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: Non-busy polling and timeout when stopping ISPIF.

Previously a busy loop used to wait for ISPIF stop on frame
boundary. This was bad not only for busy polling, but
because if sensor has stopped streaming for some reason, the ISPIF
will never stop thus making the loop endless.
The new solution uses readl_poll_timeout macro, polling once in
millisecond for maximum of 500 milliseconds (which corresponds to
2FPS - minimum supported frame rate). If polling times out, driver
reports the error to the user space for appropriate recovery.

Change-Id: I14e9825e2c8b67bab7a2e13fa0b0ef4710456805
Signed-off-by: Petar Sivenov <psiven@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
msm: camera: ISPIF HW reset is incorrecty invoked

Currently ISPIF HW reset is implemented for msm8974 ISPIF HW module only.
However, the check for module is not correct and reset sequence is executed
for 8226 also, putting HW in bad state. The patch uses correct check
against HW version to prevent that.

Change-Id: Iff9ab2deb7c6c207d9493ce2abe56bad4d9d7f6f
Signed-off-by: Petar Sivenov <psiven@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>