Re: [RFC v3 10/13] [media] exynos5-fimc-is: Add the hardware interface module

2013-08-04 Thread Sylwester Nawrocki

Hi Arun,

On 08/02/2013 05:02 PM, Arun Kumar K wrote:

The hardware interface module finally sends the commands to the
FIMC-IS firmware and runs the interrupt handler for getting the
responses.

Signed-off-by: Arun Kumar Karun...@samsung.com
Signed-off-by: Kilyeon Imkilyeon...@samsung.com
---
  .../media/platform/exynos5-is/fimc-is-interface.c  |  861 
  .../media/platform/exynos5-is/fimc-is-interface.h  |  128 +++
  2 files changed, 989 insertions(+)
  create mode 100644 drivers/media/platform/exynos5-is/fimc-is-interface.c
  create mode 100644 drivers/media/platform/exynos5-is/fimc-is-interface.h

diff --git a/drivers/media/platform/exynos5-is/fimc-is-interface.c 
b/drivers/media/platform/exynos5-is/fimc-is-interface.c
new file mode 100644
index 000..12073be
--- /dev/null
+++ b/drivers/media/platform/exynos5-is/fimc-is-interface.c
@@ -0,0 +1,861 @@
+/*
+ * Samsung EXYNOS5 FIMC-IS (Imaging Subsystem) driver
+*
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ * Kil-yeon Limkilyeon...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#includelinux/debugfs.h
+#includelinux/seq_file.h
+#include fimc-is.h
+#include fimc-is-cmd.h
+#include fimc-is-regs.h
+
+#define init_request_barrier(itf) mutex_init(itf-request_barrier)
+#define enter_request_barrier(itf) mutex_lock(itf-request_barrier)
+#define exit_request_barrier(itf) mutex_unlock(itf-request_barrier)
+
+static inline void itf_get_cmd(struct fimc_is_interface *itf,
+   struct fimc_is_msg *msg, unsigned int index)
+{
+   struct is_common_reg __iomem *com_regs = itf-com_regs;
+
+   memset(msg, 0, sizeof(*msg));
+
+   switch (index) {
+   case INTR_GENERAL:
+   msg-command = com_regs-ihcmd;
+   msg-instance = com_regs-ihc_sensorid;


nit: How about doing something like:

memcpy(msg-param, com_regs-ihc_param,
4 * sizeof(mgs-iparam[0]);

for such repeated assignments ?


+   msg-param[0] = com_regs-ihc_param[0];
+   msg-param[1] = com_regs-ihc_param[1];
+   msg-param[2] = com_regs-ihc_param[2];
+   msg-param[3] = com_regs-ihc_param[3];
+   break;
+   case INTR_SCC_FDONE:
+   msg-command = IHC_FRAME_DONE;
+   msg-instance = com_regs-scc_sensor_id;
+   msg-param[0] = com_regs-scc_param[0];
+   msg-param[1] = com_regs-scc_param[1];
+   msg-param[2] = com_regs-scc_param[2];
+   break;
+   case INTR_SCP_FDONE:
+   msg-command = IHC_FRAME_DONE;
+   msg-instance = com_regs-scp_sensor_id;
+   msg-param[0] = com_regs-scp_param[0];
+   msg-param[1] = com_regs-scp_param[1];
+   msg-param[2] = com_regs-scp_param[2];
+   break;
+   case INTR_META_DONE:
+   msg-command = IHC_FRAME_DONE;
+   msg-instance = com_regs-meta_sensor_id;
+   msg-param[0] = com_regs-meta_param1;
+   break;
+   case INTR_SHOT_DONE:
+   msg-command = IHC_FRAME_DONE;
+   msg-instance = com_regs-shot_sensor_id;
+   msg-param[0] = com_regs-shot_param[0];
+   msg-param[1] = com_regs-shot_param[1];
+   break;
+   default:
+   pr_err(unknown command getting\n);


Would be nice to have at least function name in that log message.


+   break;
+   }
+}
+
+static inline unsigned int itf_get_intr(struct fimc_is_interface *itf)
+{
+   unsigned int status;
+   struct is_common_reg __iomem *com_regs = itf-com_regs;
+
+   status = readl(itf-regs + INTMSR1) | com_regs-ihcmd_iflag |
+   com_regs-scc_iflag |
+   com_regs-scp_iflag |
+   com_regs-meta_iflag |
+   com_regs-shot_iflag;
+
+   return status;
+}
+
+static void itf_set_state(struct fimc_is_interface *itf,
+   unsigned long state)
+{
+   unsigned long flags;
+   spin_lock_irqsave(itf-slock_state, flags);
+   __set_bit(state,itf-state);
+   spin_unlock_irqrestore(itf-slock_state, flags);
+}
+
+static void itf_clr_state(struct fimc_is_interface *itf,
+   unsigned long state)
+{
+   unsigned long flags;
+   spin_lock_irqsave(itf-slock_state, flags);
+   __clear_bit(state,itf-state);
+   spin_unlock_irqrestore(itf-slock_state, flags);
+}
+
+static int itf_get_state(struct fimc_is_interface *itf,
+   unsigned long state)
+{
+   int ret = 0;
+   unsigned long flags;
+
+   spin_lock_irqsave(itf-slock_state, flags);
+   ret = test_bit(state,itf-state);


Shouldn't it be __test_bit() ?


+   spin_unlock_irqrestore(itf-slock_state, flags);
+   return ret;
+}
+
+static void 

Re: [PATCH V2 7/8] ARM: dts: wm8994: Add wm8994 support on smdk5420

2013-08-04 Thread Mark Brown
On Fri, Aug 02, 2013 at 04:15:28PM +0530, Padma Venkat wrote:

 Sorry for giving some what wrong info here. I verified the schemata.
 There is a switch on the board which can be used to select the input
 clock of codec MCLK1. We can either select oscillator clock which is
 16.9MHz which is on the board or XCLKOUT which is from PMU or
 i2scdclk(codec slave mode). Right now we are using oscillator clock as
 input clock to MCLK1.

I agree that going with whatever the board ships with as default seems
sensible.  Might be worth putting in a comment with the XCLKOUT option
saying how it maps into the control on the board.


signature.asc
Description: Digital signature


Re: [PATCH v4 00/20] Samsung PWM support cleanup

2013-08-04 Thread Olof Johansson
On Wed, Jul 31, 2013 at 12:03 PM, Tomasz Figa tomasz.f...@gmail.com wrote:
 Hi Kukjin,

 Since I think we already got all the necessary Acks, do you want me to
 send you a pull request or you already have this series applied (I can't
 see it in your tree on kernel.org)?

I'll take it directly. Please send me a pull request.


Thanks,

-Olof
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC v3 00/13] Exynos5 IS driver

2013-08-04 Thread Arun Kumar K
Hi Sylwester,

On Sun, Aug 4, 2013 at 3:10 AM, Sylwester Nawrocki
sylvester.nawro...@gmail.com wrote:
 Hi Arun,


 On 08/02/2013 05:02 PM, Arun Kumar K wrote:

 The patch series add support for Exynos5 camera subsystem. It
 re-uses mipi-csis and fimc-lite from exynos4-is and adds a new
 media device and fimc-is device drivers for exynos5.
 The media device supports asynchronos subdev registration for the
 fimc-is sensors and is based on the patch series from Sylwester
 for exynos4-is [1].

 [1]http://www.mail-archive.com/linux-media@vger.kernel.org/msg64653.html

 Changes from v2
 ---
 - Added exynos5 media device driver from Shaik to this series
 - Added ISP pipeline support in media device driver
 - Based on Sylwester's latest exynos4-is development
 - Asynchronos registration of sensor subdevs
 - Made independent IS-sensor support
 - Add s5k4e5 sensor driver
 - Addressed review comments from Sylwester, Hans, Andrzej, Sachin


 This is starting to look pretty good to me, I hope we can merge this
 patch set for v3.12. Let use coming two weeks for one or two review/
 corrections round.

Sure. I will address the review comments quickly and send v4 version.

 In the meantime I've done numerous fixes to the patch series [1],
 especially the clock provider code was pretty buggy on the clean up
 paths. Let's go through the patches and see what can be improved yet.


Ok. Is the updated version available in your git repository
git://linuxtv.org/snawrocki/samsung.git?

Regards
Arun
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC v3 01/13] [media] exynos5-is: Adding media device driver for exynos5

2013-08-04 Thread Sachin Kamat
On 2 August 2013 20:32, Arun Kumar K arun...@samsung.com wrote:
 From: Shaik Ameer Basha shaik.am...@samsung.com

 This patch adds support for media device for EXYNOS5 SoCs.
 The current media device supports the following ips to connect
 through the media controller framework.

 * MIPI-CSIS
   Support interconnection(subdev interface) between devices

 * FIMC-LITE
   Support capture interface from device(Sensor, MIPI-CSIS) to memory
   Support interconnection(subdev interface) between devices

 * FIMC-IS
   Camera post-processing IP having multiple sub-nodes.

 G-Scaler will be added later to the current media device.

 The media device creates two kinds of pipelines for connecting
 the above mentioned IPs.
 The pipeline0 is uses Sensor, MIPI-CSIS and FIMC-LITE which captures
 image data and dumps to memory.
 Pipeline1 uses FIMC-IS components for doing post-processing
 operations on the captured image and give scaled YUV output.

 Pipeline0
   ++ +---+ +---+ ++
   | Sensor | -- | MIPI-CSIS | -- | FIMC-LITE | -- | Memory |
   ++ +---+ +---+ ++

 Pipeline1
  ++  ++ +---+ +---+
  | Memory | --  |  ISP   | -- |SCC| -- |SCP|
  ++  ++ +---+ +---+

 Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
 Signed-off-by: Arun Kumar K arun...@samsung.com

[snip]

 +
 +Common 'camera' node
 +
 +
 +Required properties:
 +
 +- compatible   : must be samsung,exynos5-fimc, simple-bus

I am not sure if this point was discusssed during the previous
versions. samsung,exynos5-fimc seems a bit generic.
The compatible string should generally point to a specific SoC (the
first one to have this IP), something like samsung,exynos5250-fimc.

 +- clocks   : list of clock specifiers, corresponding to entries in
 + the clock-names property;
 +- clock-names  : must contain sclk_cam0, sclk_cam1 entries,
 + matching entries in the clocks property.
 +

[snip]

 +Example:
 +
 +   aliases {
 +   fimc-lite0 = fimc_lite_0
 +   };
 +
 +   /* Parallel bus IF sensor */
 +   i2c_0: i2c@1386 {
 +   s5k6aa: sensor@3c {
 +   compatible = samsung,s5k6aafx;
 +   reg = 0x3c;
 +   vddio-supply = ...;
 +
 +   clock-frequency = 2400;
 +   clocks = ...;
 +   clock-names = mclk;
 +
 +   port {
 +   s5k6aa_ep: endpoint {
 +   remote-endpoint = fimc0_ep;
 +   bus-width = 8;
 +   hsync-active = 0;
 +   vsync-active = 1;
 +   pclk-sample = 1;
 +   };
 +   };
 +   };
 +   };
 +
 +   /* MIPI CSI-2 bus IF sensor */
 +   s5c73m3: sensor@0x1a {

0x not needed.

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html