There can be situations when opening camera will fail, not
due to an error but due to the fact that the current hardware
configuration can only support either the front or back camera
and can't support opening another the camera at the moment.
In such cases, rather than returning -EFAULT to user space, camera
should return -EBUSY so as to distinguish between a genuine failure
to open the camera and a failure due to current configuration which
precludes from opening another instance of the camera.
So, correct the return code in the camera open failure handling code.
Change-Id: Ib99ed919be44b40a1b0270a3d2a8a1794a0373cb
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
When sof freeze happens, before notifying hal, backend
now notifies kernel. This helps us in contacting all the
sub devices and printing the required information to
understand why freeze happened.
Change-Id: Ia610f341fc4761a8be89906633d10d4c2a4e9419
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
User space needs a mechanism to return the current session id. Use the
g_ctrl ioctl to return the session id.
Change-Id: I8404c8d627c771e0a2f4535d6f66b1b85288808a
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
Add dummy module which may be plugged in or out of
sensor pipeline if its probed successfully.
Change-Id: I3cb5d01c8222f459ca1a1dbe6b89c208944122e2
Signed-off-by: Nishant Pandit <npandit@codeaurora.org>
Add support to print a log with a numeric sequence number
when sysfs file is written with the sequence number from
user space. This can be used to synchronize user and kernel
space logs in camera.
Change-Id: I038773ef55616c241459607d4202b56263c6261a
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
Num of stream buffers will be increased with group
processing mode, adding support for handling the same.
Change-Id: If173495bd57a743a213213650cbdc225734b92c4
Signed-off-by: Sagar Gore <sgore@codeaurora.org>
Support batch user buffer handling in generic buf mgr
to provide clients with list of buffer indexes based
on the container index from vb2.
Change-Id: Ide306d422915a8035555271bb8d30c3bbee9c44c
Signed-off-by: Hariram Purushothaman <hariramp@codeaurora.org>
pmic and i2c based flash use common driver.
Single driver handles all types of flashes
like i2c based / pmic based / strobe flash
unlike previous driver.
Receives same ioctls from userspace to control
the flash hardware for all types of flashes.
Flash driver is driven from usersapce like
the previous implementation.
Change-Id: Ie6e4aad6056af6ebb7242d7327abf8f003a7bec2
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
VFE is currently using two context Banks in the VFE
SMMU. However, one CB is sufficient. Reconfigure the
CB configuration to free up 1 CB and add support
for secure context bank in VFE
Change-Id: I1e0379de2cc4091a9a7478a845b5bb25c39d7516
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
struct v4l2_event should not be used for communication via
private ioctl because v4l2_event type is meant only for communication
through the V4L2 framework. Using this outside the framework for
custom ioctls will result in improper handling when 32/64 conversion
are needed.
So change the private ioctl handler in msm.c to not use this struct.
Also update the ioctl codes to use msm_v4l2_event_data instead of
v4l2_event.
Change-Id: I556de94de8676e4c1eb217f25c77a22a62465ee5
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
Add compat ioctl support in actuator and flash drivers so that
32 bit userpsace ioctl calls are directed to proper ioctl handler
functions in those drivers.
Change-Id: Ia987900078fa2d36212dc9df63d553c4a44bd3da
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
Add new IOCTL for IOMMU attach and detach for cpp, So it
can be called in stream ON/OFF to avoid multiple attach
in secure camera use case
Change-Id: I94427a9dab84e52d6c36820fe6061734edd41ea9
Signed-off-by: Azam Sadiq Pasha Kapatrala Syed <akapatra@codeaurora.org>
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
In current sensor architecture, one platform device is created for
every sensor defined in dtsi for that platform. It creates redundancy
since only one camera can be connected in camera slot for particular
target. To avoid this redundancy, create platform device for every
camera slot for that platform and probe using single compatible name
"qcom,camera" for all drivers. Add sensor utility functions to be
used by all camera sensors.
Change-Id: I135bda007f8eec2f339a6b3dbf1116c5ab600b94
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
Signed-off-by: Evgeniy Borisov <eborisov@codeaurora.org>
The parameter for number of buffers passed from user space
may be very large. While allocating memory, this could result
in integer overflow. As a result lesser memory will be allocated
then expected. This inturn may result in array index out of bound
error when the pointer is used to access memory.
The fix is to limit the maximum requested buffers per stream. If
request is greater than the maximum value, error is returned back
to user space.
CRs-Fixed: 489273
Change-Id: I3d316f439610609cd36615eea3e68d0e8a0be0d7
Signed-off-by: Nishant Pandit <npandit@codeaurora.org>
(cherry picked from commit b7126cdd15b764bad8fe9fafe3dbd6ee3e8d44ec)
Handle the error notify private ioctl by adding the appropriate
error event to the HAL queue.
Change-Id: Icbfa0ee78ba5209b347fb500b58e718c0cae4999
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
This change makes sure that the control value coming
with the s_ctrl ioctl is passed along to the back-end
along with the rest of the event. Also, the return value
is copied back into the v4l2_control structure for HAL's
usage.
Change-Id: I2e1df270bff0cd1ce67da4490dff57d9bce6dc16
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
This change adds a subdev for buffer management.
Change-Id: I94c9aaa0560497c9d15299f30d0b4887e244d986
Signed-off-by: Jignesh Mehta <jigneshm@codeaurora.org>
[smuckle@codeaurora.org: backported from msm-3.7]
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
Camera sensor driver architecture is redesigned to have move control
at user space. The current kernel driver has provision for probing
to find whether a particular camera sensor is connected. A video node
is created for every successful camera probe. This request consists of
samsung S5K3L1YX 12 MP sensor driver, CCI (Camera Control Interface)
driver to perform I2C calls on I2C master bus, I2C MUX driver to select
2D / 3D MUX, QUP driver to perform legacy I2C calls and other utility
functions (msm_sensor) that can be reused by kernel sensor drivers.
Change-Id: I057e3a36b9e08e5b57eb7b90cb0643c84777d0bc
Signed-off-by: Hody Hung <hhung@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
This change reimplements MSM camera V4L2 driver for camera
2.0. Current architecture cannot support 2.0 API very well.
This initial change contains plumbing code for v4l2 device
node creation, ioctls, events, videobuf2, etc.
The new code avoids payload deep-copy by passing them
between user space processes via IPC.
Change-Id: I8598cce8dd25fbd19743398ae0d228081f847d98
Signed-off-by: Jignesh Mehta <jigneshm@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>