Commit Graph

27 Commits

Author SHA1 Message Date
Seemanta Dutta 7cda08880a msm: camera: Return correct code when camera open fails
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>
2015-06-11 18:08:30 -07:00
Linux Build Service Account cc81070826 Merge "msm: camera: SOF freeze debug mechanism" 2015-04-24 08:20:53 -07:00
Linux Build Service Account e779492d27 Merge "msm: camera: Add support to return session id through g_ctrl ioctl" 2015-04-24 04:13:49 -07:00
Aditya Jonnalagadda 8c4b939e57 msm: camera: SOF freeze debug mechanism
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>
2015-04-20 10:14:42 +05:30
Seemanta Dutta 151a9c8e1f msm: camera: Add support to return session id through g_ctrl ioctl
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>
2015-03-26 17:03:30 -07:00
Linux Build Service Account 61a83a49a2 Merge "msm: camera: Add dummy sub module in sensor pipeline" 2015-03-23 19:24:29 -07:00
Linux Build Service Account dae65021d0 Merge "msm: Add logsync support in kernel space" 2015-03-17 17:52:54 -07:00
Nishant Pandit 711602e78a msm: camera: Add dummy sub module in sensor pipeline
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>
2015-03-12 17:01:58 -07:00
Seemanta Dutta 72f339ba2c msm: Add logsync support in kernel space
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>
2015-03-06 12:46:22 -08:00
Sagar Gore a90e9f2bd3 msm: camera: cpp: Increase num of stream buffers
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>
2015-03-05 16:44:37 -08:00
Hariram Purushothaman 7b5f7e136a msm📷 Support batch processing in generic buf mgr
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>
2015-02-26 17:10:55 -08:00
Rajesh Bondugula c1592988d7 msm: camera: sensor: Add unified flash driver
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>
2014-10-15 13:04:55 -07:00
Vasko Kalanoski a7cf31ced5 msm: camera: kernel driver for OIS
Add support to driver OIS in kernel.

Change-Id: I059b077d5d8873d516015134324e655a93ddfe55
Signed-off-by: Vasko Kalanoski <vaskok@codeaurora.org>
2014-06-26 11:57:52 -07:00
Linux Build Service Account 544b745e13 Merge "msm: camera: Do not use struct v4l2_event for private ioctl" 2014-04-30 02:34:52 -07:00
Linux Build Service Account fac2b313c0 Merge "msm: camera: Support for secure context bank in vfe" 2014-04-30 02:34:39 -07:00
Lakshmi Narayana Kalavala 86dd265c3b msm: camera: Support for secure context bank in vfe
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>
2014-04-29 15:37:28 -07:00
Linux Build Service Account 0a3b06d573 Merge "msm: camera: sensor: Add compat ioctl support in sensor drivers" 2014-04-26 00:54:08 -07:00
Seemanta Dutta 2b092da506 msm: camera: Do not use struct v4l2_event for private ioctl
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>
2014-04-23 16:22:16 -07:00
Rajesh Bondugula 450f1af6a4 msm: camera: sensor: Add compat ioctl support in sensor drivers
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>
2014-04-22 13:39:13 -07:00
Lakshmi Narayana Kalavala 4f8de5b0c6 msm: camera2: cpp: Add IOMMU Attach and Detach IOCTL for cpp
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>
2014-04-21 12:01:47 -07:00
Evgeniy Borisov 789cabe576 msm: camera: Multi module support in sensor architecture
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>
2013-10-18 14:20:43 -07:00
Nishant Pandit ca9411815b msm: camera: Add fix to avoid array index out of bound in cpp
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)
2013-09-04 17:10:20 -07:00
Ankit Premrajka fec1c93a64 msm: camera_v2: handle error notify private ioctl.
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>
2013-09-04 16:49:24 -07:00
Ankit Premrajka cb9d84c6fa msm: camera: pass control value with event
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>
2013-09-04 16:12:39 -07:00
Jignesh Mehta fac0b9a8ae msm: camera: Add buffer manager driver.
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>
2013-09-04 15:57:16 -07:00
Shuzhen Wang 923b49a7d4 msm: camera: reimplement camera sensor driver
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>
2013-09-04 15:49:07 -07:00
Jignesh Mehta 9d281dd01f camera: Reimplement camera driver for Android camera 2.0
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>
2013-09-04 15:49:07 -07:00