[PATCH] soc: xilinx: xlnx_vcu: Depends on HAS_IOMEM for xlnx_vcu

2018-01-15 Thread Dhaval Shah
xlnx_vcu driver uses devm_ioremap_nocache, which is included
only when HAS_IOMEM is enabled.

drivers/soc/xilinx/xlnx_vcu.o: In function `xvcu_probe':
   xlnx_vcu.c:(.text+0x116): undefined reference to `devm_ioremap_nocache'
   xlnx_vcu.c:(.text+0x1ae): undefined reference to `devm_ioremap_nocache'

Signed-off-by: Dhaval Shah 
---
 drivers/soc/xilinx/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/xilinx/Kconfig b/drivers/soc/xilinx/Kconfig
index 266b50f..bf657ab 100644
--- a/drivers/soc/xilinx/Kconfig
+++ b/drivers/soc/xilinx/Kconfig
@@ -3,6 +3,7 @@ menu "Xilinx SoC drivers"

 config XILINX_VCU
 tristate "Xilinx VCU logicoreIP Init"
+   depends on HAS_IOMEM
 help
   Provides the driver to enable and disable the isolation between the
   processing system and programmable logic part by using the logicoreIP
--
2.7.4

This email and any attachments are intended for the sole use of the named 
recipient(s) and contain(s) confidential information that may be proprietary, 
privileged or copyrighted under applicable law. If you are not the intended 
recipient, do not read, copy, or forward this email message or any attachments. 
Delete this email message and any attachments immediately.


[PATCH v6 2/2] soc: xilinx: xlnx_vcu: Add Xilinx ZYNQMP VCU logicoreIP init driver

2017-12-21 Thread Dhaval Shah
Xilinx ZYNQMP logicoreIP Init driver is based on the new
LogiCoreIP design created. This driver provides the processing system
and programmable logic isolation. Set the frequency based on the clock
information get from the logicoreIP register set.

Signed-off-by: Dhaval Shah 
---
Changes since v6:
 * Path of the driver is updated to "drivers/soc/xilinx/" from "drivers/misc"
 * Patch is rebase on top of the https://patchwork.kernel.org/patch/10123235/   
Changes since v5:
 * Changes made to include index 0 of the array.
Changes since v4:
 * Indent the help text (below) by 2 additional spaces, as documented in 
coding-style.rst
 * Spell check are resolved as per the review comment.
 * inline the read() and write() functions..
 * multi-line comment style
 * Updated subject line prefix
Changes since v3:
 No Changes.
Changes since v2:
 * Removed the "default n" from the Kconfig
 * More help text added to explain more about the logicoreIP driver
 * SPDX id is relocated at top of the file with // style comment
 * Removed the export API and header file and make it a single driver
   which provides logocoreIP init.
 * Provide the information in commit message as well for the why driver
   in drivers/misc.

 drivers/soc/xilinx/Kconfig|  15 +
 drivers/soc/xilinx/Makefile   |   1 +
 drivers/soc/xilinx/xlnx_vcu.c | 630 ++
 3 files changed, 646 insertions(+)
 create mode 100644 drivers/soc/xilinx/xlnx_vcu.c

diff --git a/drivers/soc/xilinx/Kconfig b/drivers/soc/xilinx/Kconfig
index ffaaa2f..266b50f 100644
--- a/drivers/soc/xilinx/Kconfig
+++ b/drivers/soc/xilinx/Kconfig
@@ -1,4 +1,19 @@
 # SPDX-License-Identifier: GPL-2.0
 menu "Xilinx SoC drivers"
 
+config XILINX_VCU
+tristate "Xilinx VCU logicoreIP Init"
+help
+  Provides the driver to enable and disable the isolation between the
+  processing system and programmable logic part by using the logicoreIP
+  register set. This driver also configures the frequency based on the
+  clock information from the logicoreIP register set.
+
+  If you say yes here you get support for the logicoreIP.
+
+  If unsure, say N.
+
+  To compile this driver as a module, choose M here: the
+  module will be called xlnx_vcu.
+
 endmenu
diff --git a/drivers/soc/xilinx/Makefile b/drivers/soc/xilinx/Makefile
index f66554c..dee8fd5 100644
--- a/drivers/soc/xilinx/Makefile
+++ b/drivers/soc/xilinx/Makefile
@@ -1 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0
+obj-$(CONFIG_XILINX_VCU)   += xlnx_vcu.o
diff --git a/drivers/soc/xilinx/xlnx_vcu.c b/drivers/soc/xilinx/xlnx_vcu.c
new file mode 100644
index 000..46ec3fd
--- /dev/null
+++ b/drivers/soc/xilinx/xlnx_vcu.c
@@ -0,0 +1,630 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Xilinx VCU Init
+ *
+ * Copyright (C) 2016 - 2017 Xilinx, Inc.
+ *
+ * Contacts   Dhaval Shah 
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Address map for different registers implemented in the VCU LogiCORE IP. */
+#define VCU_ECODER_ENABLE  0x00
+#define VCU_DECODER_ENABLE 0x04
+#define VCU_MEMORY_DEPTH   0x08
+#define VCU_ENC_COLOR_DEPTH0x0c
+#define VCU_ENC_VERTICAL_RANGE 0x10
+#define VCU_ENC_FRAME_SIZE_X   0x14
+#define VCU_ENC_FRAME_SIZE_Y   0x18
+#define VCU_ENC_COLOR_FORMAT   0x1c
+#define VCU_ENC_FPS0x20
+#define VCU_MCU_CLK0x24
+#define VCU_CORE_CLK   0x28
+#define VCU_PLL_BYPASS 0x2c
+#define VCU_ENC_CLK0x30
+#define VCU_PLL_CLK0x34
+#define VCU_ENC_VIDEO_STANDARD 0x38
+#define VCU_STATUS 0x3c
+#define VCU_AXI_ENC_CLK0x40
+#define VCU_AXI_DEC_CLK0x44
+#define VCU_AXI_MCU_CLK0x48
+#define VCU_DEC_VIDEO_STANDARD 0x4c
+#define VCU_DEC_FRAME_SIZE_X   0x50
+#define VCU_DEC_FRAME_SIZE_Y   0x54
+#define VCU_DEC_FPS0x58
+#define VCU_BUFFER_B_FRAME 0x5c
+#define VCU_WPP_EN 0x60
+#define VCU_PLL_CLK_DEC0x64
+#define VCU_GASKET_INIT0x74
+#define VCU_GASKET_VALUE   0x03
+
+/* vcu slcr registers, bitmask and shift */
+#define VCU_PLL_CTRL   0x24
+#define VCU_PLL_CTRL_RESET_MASK0x01
+#define VCU_PLL_CTRL_RESET_SHIFT   0
+#define VCU_PLL_CTRL_BYPASS_MASK   0x01
+#define VCU_PLL_CTRL_BYPASS_SHIFT  3
+#define VCU_PLL_CTRL_FBDIV_MASK0x7f
+#define VCU_PLL_CTRL_FBDIV_SHIFT   8
+#define VCU_PLL_CTRL_POR_IN_MASK   0x01
+#define VCU_PLL_CTRL_POR_IN_SHIFT  1
+#define VCU_PLL_CTRL_PWR_POR_MASK  0x01
+#define VCU_PLL_CTRL_PWR_POR_SHIFT 2
+#define VCU_PLL_CTRL_CLKOUTDIV_

[PATCH v6 1/2] dt-bindings: soc: xilinx: Add DT bindings to xlnx_vcu driver

2017-12-21 Thread Dhaval Shah
Add Device Tree binding document for logicoreIP. This logicoreIP
provides the isolation between the processing system and
programmable logic. Also provides the clock related information.

Signed-off-by: Dhaval Shah 
Reviewed-by: Rob Herring 
---
Changes since v6:
 * Updated path of the dt-bindings doc as driver path is updated.
Chnages since v5:
 No Changes.
Chnages since v4:
 No Changes.
Chnages since v3:
 * Use "dt-bindings: misc: ..." for the subject.
Changes since v2:
 * Describe the h/w
 * compatible string is updated to make it more specific
   based on the logicoreIP version.
 * Removed that encoder and decoder child nodes and relatd properties as that
   will be a separate driver and dts nodes. other team is working on that.
 * Updated to use as a single driver.

 .../devicetree/bindings/soc/xilinx/xlnx,vcu.txt| 31 ++
 1 file changed, 31 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/xilinx/xlnx,vcu.txt

diff --git a/Documentation/devicetree/bindings/soc/xilinx/xlnx,vcu.txt 
b/Documentation/devicetree/bindings/soc/xilinx/xlnx,vcu.txt
new file mode 100644
index 000..6786d67
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/xilinx/xlnx,vcu.txt
@@ -0,0 +1,31 @@
+LogicoreIP designed compatible with Xilinx ZYNQ family.
+---
+
+General concept
+---
+
+LogicoreIP design to provide the isolation between processing system
+and programmable logic. Also provides the list of register set to configure
+the frequency.
+
+Required properties:
+- compatible: shall be one of:
+   "xlnx,vcu"
+   "xlnx,vcu-logicoreip-1.0"
+- reg, reg-names: There are two sets of registers need to provide.
+   1. vcu slcr
+   2. Logicore
+   reg-names should contain name for the each register sequence.
+- clocks: phandle for aclk and pll_ref clocksource
+- clock-names: The identification string, "aclk", is always required for
+   the axi clock. "pll_ref" is required for pll.
+Example:
+
+   xlnx_vcu: vcu@a004 {
+   compatible = "xlnx,vcu-logicoreip-1.0";
+   reg = <0x0 0xa004 0x0 0x1000>,
+<0x0 0xa0041000 0x0 0x1000>;
+   reg-names = "vcu_slcr", "logicore";
+   clocks = <&si570_1>, <&clkc 71>;
+   clock-names = "pll_ref", "aclk";
+   };
-- 
2.7.4



[PATCH v6 0/2] Documentation and driver of logicoreIP

2017-12-21 Thread Dhaval Shah
1st patch provide Device Tree binding document for logicoreIP
2nd patch provide the xlnx_vcu logicoreIP driver, Kconfig changes
and Makefile changes for the driver.

Dhaval Shah (2):
  dt-bindings: misc: Add DT bindings to xlnx_vcu driver
  misc: xlnx_vcu: Add Xilinx ZYNQMP VCU logicoreIP init driver

 .../devicetree/bindings/soc/xilinx/xlnx,vcu.txt|  31 +
 drivers/soc/xilinx/Kconfig |  15 +
 drivers/soc/xilinx/Makefile|   1 +
 drivers/soc/xilinx/xlnx_vcu.c  | 630 +
 4 files changed, 677 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/xilinx/xlnx,vcu.txt
 create mode 100644 drivers/soc/xilinx/xlnx_vcu.c

-- 
2.7.4



[PATCH] [linux][master][v1] devicetree: misc: Add binding for logicoreIP xlnx,vcu

2017-12-05 Thread Dhaval Shah
From: Dhaval Shah 

Added the txt file which contain the xlnx,vcu DT node
properties information. This also provides the information
of it's child node as well.

Signed-off-by: Dhaval Shah 
---
 .../devicetree/bindings/misc/xlnx,vcu.txt  | 59 ++
 1 file changed, 59 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/xlnx,vcu.txt

diff --git a/Documentation/devicetree/bindings/misc/xlnx,vcu.txt 
b/Documentation/devicetree/bindings/misc/xlnx,vcu.txt
new file mode 100644
index 000..e722ff3
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/xlnx,vcu.txt
@@ -0,0 +1,59 @@
+Xilinx VCU init Driver
+-
+
+General concept
+---
+
+Xilinx VCU init driver is developed to handle the LogiCore related
+new implementation. In this directory, The DT node of the Xilinx
+VCU init driver represents as a top level node.
+
+Required properties:
+- compatible: Must be "xlnx,vcu".
+- reg, reg-names: There are two sets of registers need to provide.
+   1. vcu slcr
+   2. Logicore
+   reg-names should contain name for the each register sequence.
+- clocks: phandle for aclk and pll_ref clocksource
+- clock-names: The identification string, "aclk", is always required for
+   the axi clock. "pll_ref" is required for pll.
+- ranges
+- VCU Init driver node define the following child nodes:
+   * Allegro encoder driver node
+   - compatible: Must be "al,al5e"
+   - reg: There is a one set of register.
+   - interrupts: interrupt number to the cpu.
+   - interrupt-parent: the phandle for the interrupt controller
+ that services interrupts for this device.
+   * Allegro decoder driver node
+   - compatible: Must be "al,al5d"
+   - reg: There is a one set of register.
+   - interrupts: interrupt number to the cpu.
+   - interrupt-parent: the phandle for the interrupt controller
+ that services interrupts for this device.
+Example:
+
+   xlnx_vcu: vcu@a004 {
+   compatible = "xlnx,vcu";
+   #address-cells = <2>;
+   #size-cells = <2>;
+   reg = <0x0 0xa004 0x0 0x1000>,
+<0x0 0xa0041000 0x0 0x1000>;
+   reg-names = "vcu_slcr", "logicore";
+   clocks = <&si570_1>, <&clkc 71>;
+   clock-names = "pll_ref", "aclk";
+   ranges;
+   encoder: al5e@a000 {
+   compatible = "al,al5e";
+   reg = <0x0 0xa000 0x0 0x1>;
+   interrupts = <0 89 4>;
+   interrupt-parent = <&gic>;
+   };
+
+   decoder: al5d@a002 {
+   compatible = "al,al5d";
+   reg = <0x0 0xa002 0x0 0x1>;
+   interrupts = <0 89 4>;
+   interrupt-parent = <&gic>;
+   };
+   };
-- 
2.7.4



[PATCH] [linux][master][v1] misc: Add Xilinx ZYNQMP VCU logicoreIP init driver

2017-12-05 Thread Dhaval Shah
Xilinx ZYNQMP VCU Init driver is based on the new LogiCoreIP design
created. This driver will provide the api which can be used
by the encoder and decoder driver to get the configured value.

Signed-off-by: Dhaval Shah 
---
 drivers/misc/Kconfig|   6 +
 drivers/misc/Makefile   |   1 +
 drivers/misc/xlnx_vcu.c | 664 
 include/misc/xlnx_vcu.h |  18 ++
 4 files changed, 689 insertions(+)
 create mode 100644 drivers/misc/xlnx_vcu.c
 create mode 100644 include/misc/xlnx_vcu.h

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index f1a5c23..3b7c796 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -496,6 +496,12 @@ config PCI_ENDPOINT_TEST
Enable this configuration option to enable the host side test driver
for PCI Endpoint.
 
+config XILINX_VCU
+   tristate "Xilinx VCU Init"
+   default n
+   help
+  Driver for the Xilinx VCU Init based on the logicoreIP.
+
 source "drivers/misc/c2port/Kconfig"
 source "drivers/misc/eeprom/Kconfig"
 source "drivers/misc/cb710/Kconfig"
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 5ca5f64..a6bd0b1 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -55,6 +55,7 @@ obj-$(CONFIG_CXL_BASE)+= cxl/
 obj-$(CONFIG_ASPEED_LPC_CTRL)  += aspeed-lpc-ctrl.o
 obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o
 obj-$(CONFIG_PCI_ENDPOINT_TEST)+= pci_endpoint_test.o
+obj-$(CONFIG_XILINX_VCU)   += xlnx_vcu.o
 
 lkdtm-$(CONFIG_LKDTM)  += lkdtm_core.o
 lkdtm-$(CONFIG_LKDTM)  += lkdtm_bugs.o
diff --git a/drivers/misc/xlnx_vcu.c b/drivers/misc/xlnx_vcu.c
new file mode 100644
index 000..373f7f9
--- /dev/null
+++ b/drivers/misc/xlnx_vcu.c
@@ -0,0 +1,664 @@
+/*
+ * Xilinx VCU Init
+ *
+ * Copyright (C) 2016 - 2017 Xilinx, Inc.
+ *
+ * Contacts   Dhaval Shah 
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+/* Address map for different registers implemented in the VCU LogiCORE IP. */
+#define VCU_ECODER_ENABLE  0x00
+#define VCU_DECODER_ENABLE 0x04
+#define VCU_MEMORY_DEPTH   0x08
+#define VCU_ENC_COLOR_DEPTH0x0c
+#define VCU_ENC_VERTICAL_RANGE 0x10
+#define VCU_ENC_FRAME_SIZE_X   0x14
+#define VCU_ENC_FRAME_SIZE_Y   0x18
+#define VCU_ENC_COLOR_FORMAT   0x1c
+#define VCU_ENC_FPS0x20
+#define VCU_MCU_CLK0x24
+#define VCU_CORE_CLK   0x28
+#define VCU_PLL_BYPASS 0x2c
+#define VCU_ENC_CLK0x30
+#define VCU_PLL_CLK0x34
+#define VCU_ENC_VIDEO_STANDARD 0x38
+#define VCU_STATUS 0x3c
+#define VCU_AXI_ENC_CLK0x40
+#define VCU_AXI_DEC_CLK0x44
+#define VCU_AXI_MCU_CLK0x48
+#define VCU_DEC_VIDEO_STANDARD 0x4c
+#define VCU_DEC_FRAME_SIZE_X   0x50
+#define VCU_DEC_FRAME_SIZE_Y   0x54
+#define VCU_DEC_FPS0x58
+#define VCU_BUFFER_B_FRAME 0x5c
+#define VCU_WPP_EN 0x60
+#define VCU_PLL_CLK_DEC0x64
+#define VCU_GASKET_INIT0x74
+#define VCU_GASKET_VALUE   0x03
+
+/* vcu slcr registers, bitmask and shift */
+#define VCU_PLL_CTRL   0x24
+#define VCU_PLL_CTRL_RESET_MASK0x01
+#define VCU_PLL_CTRL_RESET_SHIFT   0
+#define VCU_PLL_CTRL_BYPASS_MASK   0x01
+#define VCU_PLL_CTRL_BYPASS_SHIFT  3
+#define VCU_PLL_CTRL_FBDIV_MASK0x7f
+#define VCU_PLL_CTRL_FBDIV_SHIFT   8
+#define VCU_PLL_CTRL_POR_IN_MASK   0x01
+#define VCU_PLL_CTRL_POR_IN_SHIFT  1
+#define VCU_PLL_CTRL_PWR_POR_MASK  0x01
+#define VCU_PLL_CTRL_PWR_POR_SHIFT 2
+#define VCU_PLL_CTRL_CLKOUTDIV_MASK0x03
+#define VCU_PLL_CTRL_CLKOUTDIV_SHIFT   16
+#define VCU_PLL_CTRL_DEFAULT   0
+#define VCU_PLL_DIV2   2
+
+#define VCU_PLL_CFG0x28
+#define VCU_PLL_CFG_RES_MASK   0x0f
+#define VCU_PLL_CFG_RES_SHIFT  0
+#define VCU_PLL_CFG_CP_MASK0x0f
+#define VCU_PLL_CFG_CP_SHIFT   5
+#define VCU_PLL_CFG_LFHF_MASK  0x03
+#define VCU_PLL_CFG_LFHF_SHIFT 10
+#define VCU_PLL_CFG_LOCK_CNT_MASK  0x03ff
+#define VCU_PLL_CFG_LOCK_CNT_SHIFT 13
+#define VCU_PLL_CFG_LOCK_DLY_MASK  0x7f
+#define VCU_PLL_CFG_LOCK_DLY_SHIFT 25
+#define VCU_ENC_CORE_CTRL  0x30
+#define VCU_ENC_MCU_CTRL   0x34
+#define VCU_DEC_CORE_CTRL  0x38
+#define VCU_DEC_MCU_CTRL   0x3c
+#define VCU_PLL_DIVISOR_MASK   0x3f
+#define VCU_PLL_DIVISOR_SHIFT  4
+#define VCU_SRCSEL_MASK0x01
+#define VCU_SRCSEL_SHIFT

Re: [PATCH 3/3] misc: ad525x_dpot: macros should not use a trailing semicolon

2017-12-18 Thread Dhaval Shah
Hi Greg k-h,


> From: Greg KH 
> Sent: Monday, December 18, 2017 8:32 PM
> To: Dhaval Shah
> Cc: a...@arndb.de; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 3/3] misc: ad525x_dpot: macros should not use a trailing 
> semicolon
> 
> On Fri, Dec 08, 2017 at 01:43:05PM +0530, Dhaval Shah wrote:
> > Resolved all the macros should not use a trailing semicolon
> > checkpatch warnings. Issue found by checkpatch.
> >
> > Signed-off-by: Dhaval Shah 
> > ---
> >  drivers/misc/ad525x_dpot.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
> > index 577f5e76c8a8..bc591b7168db 100644
> > --- a/drivers/misc/ad525x_dpot.c
> > +++ b/drivers/misc/ad525x_dpot.c
> > @@ -515,11 +515,11 @@ set_##_name(struct device *dev, \
> >  #define DPOT_DEVICE_SHOW_SET(name, reg) \
> >  DPOT_DEVICE_SHOW(name, reg) \
> >  DPOT_DEVICE_SET(name, reg) \
> > -static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, set_##name);
> > +static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, set_##name)
> 
> This should be using DEVICE_ATTR_RW() instead of DEVICE_ATTR(), care to
> fix that up in a follow-on patch for this driver?
> 
Sure. I will update this change in follow-on patch for this driver once this 
patch set merged.

Thanks,
Dhaval
> thanks,
> 
> greg k-h


[PATCH v3 0/2] Documentation and driver of logicoreIP

2017-12-13 Thread Dhaval Shah
1st patch provide Device Tree binding document for logicoreIP
2nd patch provide the xlnx_vcu logicoreIP driver, Kconfig changes
and Makefile changes for the driver.

Dhaval Shah (2):
  Documentation: devicetree: Add DT bindings to xlnx_vcu driver
  misc: Add Xilinx ZYNQMP VCU logicoreIP init driver

 .../devicetree/bindings/misc/xlnx,vcu.txt  |  31 +
 drivers/misc/Kconfig   |  15 +
 drivers/misc/Makefile  |   1 +
 drivers/misc/xlnx_vcu.c| 629 +
 4 files changed, 676 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/xlnx,vcu.txt
 create mode 100644 drivers/misc/xlnx_vcu.c

-- 
2.7.4



[PATCH v3 2/2] misc: Add Xilinx ZYNQMP VCU logicoreIP init driver

2017-12-13 Thread Dhaval Shah
Xilinx ZYNQMP logicoreIP Init driver is based on the new
LogiCoreIP design created. This driver provides the processing system
and programmable logic isolation. Set the frequency based on the clock
information get from the logicoreIP register set.

It is put in drivers/misc as there is no subsystem for this logicoreIP.

Signed-off-by: Dhaval Shah 
---
Changes since v3:
 No Changes.
Changes since v2:
 * Removed the "default n" from the Kconfig
 * More help text added to explain more about the logicoreIP driver
 * SPDX id is relocated at top of the file with // style comment
 * Removed the export API and header file and make it a single driver
   which provides logocoreIP init.
 * Provide the information in commit message as well for the why driver
   in drivers/misc.

 drivers/misc/Kconfig|  15 ++
 drivers/misc/Makefile   |   1 +
 drivers/misc/xlnx_vcu.c | 629 
 3 files changed, 645 insertions(+)
 create mode 100644 drivers/misc/xlnx_vcu.c

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index f1a5c23..24ea516 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -496,6 +496,21 @@ config PCI_ENDPOINT_TEST
Enable this configuration option to enable the host side test driver
for PCI Endpoint.
 
+config XILINX_VCU
+   tristate "Xilinx VCU logicoreIP Init"
+   help
+ Provides the driver to enable and disable the isolation between the
+ processing system and programmable logic part by using the logicoreIP
+ register set. This driver also configure the frequency based on the
+ clock information get from the logicoreIP register set.
+
+ If you say yes here you get support for the logcoreIP.
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called xlnx_vcu.
+
 source "drivers/misc/c2port/Kconfig"
 source "drivers/misc/eeprom/Kconfig"
 source "drivers/misc/cb710/Kconfig"
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 5ca5f64..a6bd0b1 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -55,6 +55,7 @@ obj-$(CONFIG_CXL_BASE)+= cxl/
 obj-$(CONFIG_ASPEED_LPC_CTRL)  += aspeed-lpc-ctrl.o
 obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o
 obj-$(CONFIG_PCI_ENDPOINT_TEST)+= pci_endpoint_test.o
+obj-$(CONFIG_XILINX_VCU)   += xlnx_vcu.o
 
 lkdtm-$(CONFIG_LKDTM)  += lkdtm_core.o
 lkdtm-$(CONFIG_LKDTM)  += lkdtm_bugs.o
diff --git a/drivers/misc/xlnx_vcu.c b/drivers/misc/xlnx_vcu.c
new file mode 100644
index 000..41819f0
--- /dev/null
+++ b/drivers/misc/xlnx_vcu.c
@@ -0,0 +1,629 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Xilinx VCU Init
+ *
+ * Copyright (C) 2016 - 2017 Xilinx, Inc.
+ *
+ * Contacts   Dhaval Shah 
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Address map for different registers implemented in the VCU LogiCORE IP. */
+#define VCU_ECODER_ENABLE  0x00
+#define VCU_DECODER_ENABLE 0x04
+#define VCU_MEMORY_DEPTH   0x08
+#define VCU_ENC_COLOR_DEPTH0x0c
+#define VCU_ENC_VERTICAL_RANGE 0x10
+#define VCU_ENC_FRAME_SIZE_X   0x14
+#define VCU_ENC_FRAME_SIZE_Y   0x18
+#define VCU_ENC_COLOR_FORMAT   0x1c
+#define VCU_ENC_FPS0x20
+#define VCU_MCU_CLK0x24
+#define VCU_CORE_CLK   0x28
+#define VCU_PLL_BYPASS 0x2c
+#define VCU_ENC_CLK0x30
+#define VCU_PLL_CLK0x34
+#define VCU_ENC_VIDEO_STANDARD 0x38
+#define VCU_STATUS 0x3c
+#define VCU_AXI_ENC_CLK0x40
+#define VCU_AXI_DEC_CLK0x44
+#define VCU_AXI_MCU_CLK0x48
+#define VCU_DEC_VIDEO_STANDARD 0x4c
+#define VCU_DEC_FRAME_SIZE_X   0x50
+#define VCU_DEC_FRAME_SIZE_Y   0x54
+#define VCU_DEC_FPS0x58
+#define VCU_BUFFER_B_FRAME 0x5c
+#define VCU_WPP_EN 0x60
+#define VCU_PLL_CLK_DEC0x64
+#define VCU_GASKET_INIT0x74
+#define VCU_GASKET_VALUE   0x03
+
+/* vcu slcr registers, bitmask and shift */
+#define VCU_PLL_CTRL   0x24
+#define VCU_PLL_CTRL_RESET_MASK0x01
+#define VCU_PLL_CTRL_RESET_SHIFT   0
+#define VCU_PLL_CTRL_BYPASS_MASK   0x01
+#define VCU_PLL_CTRL_BYPASS_SHIFT  3
+#define VCU_PLL_CTRL_FBDIV_MASK0x7f
+#define VCU_PLL_CTRL_FBDIV_SHIFT   8
+#define VCU_PLL_CTRL_POR_IN_MASK   0x01
+#define VCU_PLL_CTRL_POR_IN_SHIFT  1
+#define VCU_PLL_CTRL_PWR_POR_MASK  0x01
+#define VCU_PLL_CTRL_PWR_POR_SHIFT 2
+#define VCU_PLL_CTRL_CLKOUTDIV_MASK0x03
+#define VCU_PLL_CTRL_CLKOUTDIV_SHIFT   16
+#define VCU_

[PATCH v3 1/2] dt-bindings: misc: Add DT bindings to xlnx_vcu driver

2017-12-13 Thread Dhaval Shah
Add Device Tree binding document for logicoreIP. This logicoreIP
provides the isolation between the processing system and
programmable logic. Also provides the clock related information.

Signed-off-by: Dhaval Shah 
---
Chnages since v3:
 * Use "dt-bindings: misc: ..." for the subject.
Changes since v2:
 * Describe the h/w
 * compatible string is updated to make it more specific
   based on the logicoreIP version.
 * Removed that encoder and decoder child nodes and relatd properties as that
   will be a separate driver and dts nodes. other team is working on that.
 * Updated to use as a single driver.

 .../devicetree/bindings/misc/xlnx,vcu.txt  | 31 ++
 1 file changed, 31 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/xlnx,vcu.txt

diff --git a/Documentation/devicetree/bindings/misc/xlnx,vcu.txt 
b/Documentation/devicetree/bindings/misc/xlnx,vcu.txt
new file mode 100644
index 000..6786d67
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/xlnx,vcu.txt
@@ -0,0 +1,31 @@
+LogicoreIP designed compatible with Xilinx ZYNQ family.
+---
+
+General concept
+---
+
+LogicoreIP design to provide the isolation between processing system
+and programmable logic. Also provides the list of register set to configure
+the frequency.
+
+Required properties:
+- compatible: shall be one of:
+   "xlnx,vcu"
+   "xlnx,vcu-logicoreip-1.0"
+- reg, reg-names: There are two sets of registers need to provide.
+   1. vcu slcr
+   2. Logicore
+   reg-names should contain name for the each register sequence.
+- clocks: phandle for aclk and pll_ref clocksource
+- clock-names: The identification string, "aclk", is always required for
+   the axi clock. "pll_ref" is required for pll.
+Example:
+
+   xlnx_vcu: vcu@a004 {
+   compatible = "xlnx,vcu-logicoreip-1.0";
+   reg = <0x0 0xa004 0x0 0x1000>,
+<0x0 0xa0041000 0x0 0x1000>;
+   reg-names = "vcu_slcr", "logicore";
+   clocks = <&si570_1>, <&clkc 71>;
+   clock-names = "pll_ref", "aclk";
+   };
-- 
2.7.4



Re: [PATCH] platform/x86: dell-rbtn: Block comments use * on subsequent lines

2017-12-14 Thread Dhaval Shah

> From: Joe Perches 
> Sent: Wednesday, December 13, 2017 9:09 PM
> To: Dhaval Shah; Philippe Ombredanne
> Cc: pali.ro...@gmail.com; Darren Hart; Andy Shevchenko; 
> platform-driver-...@vger.kernel.org; LKML
> Subject: Re: [PATCH] platform/x86: dell-rbtn: Block comments use * on 
> subsequent lines
> 
> On Wed, 2017-12-13 at 12:41 +, Dhaval Shah wrote:
> > > If anyone does conversions of these license texts
> > > you have to be _extremely_ careful about what
> > > specific license identifier you use.
> > > This license includes the text
> > > "or (at your option) any later version"
> > > which is not the same as using
> > > SPDX-License-Identifier: GPL-2.0
> >
> > I have given this SPDX ID based on the current license info in the driver.
> 
> No, you have not.
> You have done it incorrectly.
> 
> For a short description, read:
> https://spdx.org/sites/cpstandard/files/pages/files/using_spdx_license_list_short_identifiers.pdf
> page 5
I got your point. SPDX text should be "SPDX-License-Identifier: GPL-2.0+".
Am i Right?



Re: [PATCH 0/3] platform/x86: dell-laptop: All the warnings are resolved.

2017-12-14 Thread Dhaval Shah
Hi Andy Shevchenko,

Thanks for the review.

> From: Andy Shevchenko 
> Sent: Thursday, December 14, 2017 11:29 PM
> To: Dhaval Shah
> Cc: Matthew Garrett; Pali Rohár; Andy Shevchenko; Platform Driver; 
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 0/3] platform/x86: dell-laptop: All the warnings are 
> resolved.
> 
> On Wed, Dec 13, 2017 at 10:13 AM, Dhaval Shah
>  wrote:
> > There are total three types of warnings are resolved.
> > First patch  : Block comments use * on subsequent lines
> > Second patch : Missing a blank line after declarations
> > third patch  : braces {} are not necessary for single statement blocks.
> >
> 
> Can we survive without this? Does it break build or alike?
> 
Yes. We can survive without this. It will not break build or alike. This 
changes will not affects the functionality of the code.
But, it overall improves the code readability.
> 
> > Dhaval Shah (3):
> >   platform/x86: dell-laptop: Block comments use * on subsequent lines
> >   platform/x86: dell-laptop: Missing a blank line after declarations
> >   platform/x86: dell-laptop: braces {} are not necessary for single
> > statement blocks
> >
> >  drivers/platform/x86/dell-laptop.c | 10 +++---
> >  1 file changed, 7 insertions(+), 3 deletions(-)
> >
> > --
> > 2.11.0
> >



--
With Best Regards,
Andy Shevchenko


Re: [PATCH] platform/x86: dell-smbios: Block comments use * on subsequent lines

2017-12-14 Thread Dhaval Shah
Hi Andy Shevchenko,


> From: Andy Shevchenko 
> Sent: Thursday, December 14, 2017 11:29 PM
> To: Dhaval Shah
> Cc: Pali Rohár; Mario Limonciello; dvh...@infradead.org; Andy Shevchenko; 
> Platform Driver; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] platform/x86: dell-smbios: Block comments use * on 
> subsequent lines
> 
> On Wed, Dec 13, 2017 at 10:21 AM, Dhaval Shah
>  wrote:
> > Resolved Block comments use * on subsequent lines checkpatch warnings.
> > Issue found by checkpatch.
> >
> 
> Same comments as for the other like this
> 

This changes will not affect the functionality but improves the code 
readability.

> > Signed-off-by: Dhaval Shah 
> > ---
> >  drivers/platform/x86/dell-smbios.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/platform/x86/dell-smbios.c 
> > b/drivers/platform/x86/dell-smbios.c
> > index 6a60db515bda..25a296c90e08 100644
> > --- a/drivers/platform/x86/dell-smbios.c
> > +++ b/drivers/platform/x86/dell-smbios.c
> > @@ -353,7 +353,8 @@ static void __init parse_da_table(const struct 
> > dmi_header *dm)
> > container_of(dm, struct calling_interface_structure, 
> > header);
> >
> > /* 4 bytes of table header, plus 7 bytes of Dell header, plus at 
> > least
> > -  6 bytes of entry */
> > +* 6 bytes of entry
> > +*/
> >
> > if (dm->length < 17)
> > return;
> > --
> > 2.11.0
> >



--
With Best Regards,
Andy Shevchenko


Re: [PATCH] media: v4l: xilinx: Use SPDX-License-Identifier

2017-12-14 Thread Dhaval Shah
Hi Laurent/Mauro/Greg,

On Fri, Dec 15, 2017 at 3:32 AM, Laurent Pinchart
 wrote:
> Hi Mauro,
>
> On Thursday, 14 December 2017 23:50:03 EET Mauro Carvalho Chehab wrote:
>> Em Thu, 14 Dec 2017 21:57:06 +0100 Greg KH escreveu:
>> > On Thu, Dec 14, 2017 at 10:44:16PM +0200, Laurent Pinchart wrote:
>> >> On Thursday, 14 December 2017 22:08:51 EET Greg KH wrote:
>> >>> On Thu, Dec 14, 2017 at 09:05:27PM +0200, Laurent Pinchart wrote:
>> >>>> On Thursday, 14 December 2017 20:54:39 EET Joe Perches wrote:
>> >>>>> On Thu, 2017-12-14 at 20:37 +0200, Laurent Pinchart wrote:
>> >>>>>> On Thursday, 14 December 2017 20:32:20 EET Joe Perches wrote:
>> >>>>>>> On Thu, 2017-12-14 at 20:28 +0200, Laurent Pinchart wrote:
>> >>>>>>>> On Thursday, 14 December 2017 19:05:27 EET Mauro Carvalho Chehab
>> >>>>>>>> wrote:
>> >>>>>>>>> Em Fri,  8 Dec 2017 18:05:37 +0530 Dhaval Shah escreveu:
>> >>>>>>>>>> SPDX-License-Identifier is used for the Xilinx Video IP and
>> >>>>>>>>>> related drivers.
>> >>>>>>>>>>
>> >>>>>>>>>> Signed-off-by: Dhaval Shah 
>> >>>>>>>>>
>> >>>>>>>>> Hi Dhaval,
>> >>>>>>>>>
>> >>>>>>>>> You're not listed as one of the Xilinx driver maintainers. I'm
>> >>>>>>>>> afraid that, without their explicit acks, sent to the ML, I
>> >>>>>>>>> can't accept a patch touching at the driver's license tags.
>> >>>>>>>>
>> >>>>>>>> The patch doesn't change the license, I don't see why it would
>> >>>>>>>> cause any issue. Greg isn't listed as the maintainer or copyright
>> >>>>>>>> holder of any of the 10k+ files to which he added an SPDX license
>> >>>>>>>> header in the last kernel release.
>> >>>>>>>
>> >>>>>>> Adding a comment line that describes an implicit or
>> >>>>>>> explicit license is different than removing the license
>> >>>>>>> text itself.
>> >>>>>>
>> >>>>>> The SPDX license header is meant to be equivalent to the license
>> >>>>>> text.
>> >>>>>
>> >>>>> I understand that.
>> >>>>> At a minimum, removing BSD license text is undesirable
>> >>>>>
>> >>>>> as that license states:
>> >>>>>  ** Redistributions of source code must retain the above copyright
>> >>>>>  *  notice, this list of conditions and the following disclaimer.
>> >>>>>
>> >>>>> etc...
>> >>>>
>> >>>> But this patch only removes the following text:
>> >>>>
>> >>>> - * 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.
>> >>>>
>> >>>> and replaces it by the corresponding SPDX header.
>> >>>>
>> >>>>>> The only reason why the large SPDX patch didn't touch the whole
>> >>>>>> kernel in one go was that it was easier to split in in multiple
>> >>>>>> chunks.
>> >>>>>
>> >>>>> Not really, it was scripted.
>> >>>>
>> >>>> But still manually reviewed as far as I know.
>> >>>>
>> >>>>>> This is no different than not including the full GPL license in
>> >>>>>> every header file but only pointing to it through its name and
>> >>>>>> reference, as every kernel source file does.
>> >>>>>
>> >>>>> Not every kernel source file had a license text
>> >>>>> or a reference to another license file.
>> >>>>
>> >>>> Correct, but the files touched by this patch do.
>> >>>>
>> >>>> This issue is in no way specific to linux-media and should be

[PATCH v4 1/2] dt-bindings: misc: Add DT bindings to xlnx_vcu driver

2017-12-14 Thread Dhaval Shah
From: Dhaval Shah 

Add Device Tree binding document for logicoreIP. This logicoreIP
provides the isolation between the processing system and
programmable logic. Also provides the clock related information.

Signed-off-by: Dhaval Shah 
---
Chnages since v3:
 No Changes.
Chnages since v3:
 * Use "dt-bindings: misc: ..." for the subject.
Changes since v2:
 * Describe the h/w
 * compatible string is updated to make it more specific
   based on the logicoreIP version.
 * Removed that encoder and decoder child nodes and relatd properties as that
   will be a separate driver and dts nodes. other team is working on that.
 * Updated to use as a single driver.

 .../devicetree/bindings/misc/xlnx,vcu.txt  | 31 ++
 1 file changed, 31 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/xlnx,vcu.txt

diff --git a/Documentation/devicetree/bindings/misc/xlnx,vcu.txt 
b/Documentation/devicetree/bindings/misc/xlnx,vcu.txt
new file mode 100644
index 000..6786d67
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/xlnx,vcu.txt
@@ -0,0 +1,31 @@
+LogicoreIP designed compatible with Xilinx ZYNQ family.
+---
+
+General concept
+---
+
+LogicoreIP design to provide the isolation between processing system
+and programmable logic. Also provides the list of register set to configure
+the frequency.
+
+Required properties:
+- compatible: shall be one of:
+   "xlnx,vcu"
+   "xlnx,vcu-logicoreip-1.0"
+- reg, reg-names: There are two sets of registers need to provide.
+   1. vcu slcr
+   2. Logicore
+   reg-names should contain name for the each register sequence.
+- clocks: phandle for aclk and pll_ref clocksource
+- clock-names: The identification string, "aclk", is always required for
+   the axi clock. "pll_ref" is required for pll.
+Example:
+
+   xlnx_vcu: vcu@a004 {
+   compatible = "xlnx,vcu-logicoreip-1.0";
+   reg = <0x0 0xa004 0x0 0x1000>,
+<0x0 0xa0041000 0x0 0x1000>;
+   reg-names = "vcu_slcr", "logicore";
+   clocks = <&si570_1>, <&clkc 71>;
+   clock-names = "pll_ref", "aclk";
+   };
-- 
2.7.4



[PATCH v4 0/2] Documentation and driver of logicoreIP

2017-12-14 Thread Dhaval Shah
1st patch provide Device Tree binding document for logicoreIP
2nd patch provide the xlnx_vcu logicoreIP driver, Kconfig changes
and Makefile changes for the driver.

Dhaval Shah (2):
  Documentation: devicetree: Add DT bindings to xlnx_vcu driver
  misc: xlnx_vcu: Add Xilinx ZYNQMP VCU logicoreIP init driver

 .../devicetree/bindings/misc/xlnx,vcu.txt  |  31 +
 drivers/misc/Kconfig   |  15 +
 drivers/misc/Makefile  |   1 +
 drivers/misc/xlnx_vcu.c| 631 +
 4 files changed, 678 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/xlnx,vcu.txt
 create mode 100644 drivers/misc/xlnx_vcu.c

-- 
2.7.4



[PATCH v4 2/2] misc: xlnx_vcu: Add Xilinx ZYNQMP VCU logicoreIP init driver

2017-12-14 Thread Dhaval Shah
Xilinx ZYNQMP logicoreIP Init driver is based on the new
LogiCoreIP design created. This driver provides the processing system
and programmable logic isolation. Set the frequency based on the clock
information get from the logicoreIP register set.

It is put in drivers/misc as there is no subsystem for this logicoreIP.

Signed-off-by: Dhaval Shah 
---
Changes since v4:
 * Indent the help text (below) by 2 additional spaces, as documented in 
coding-style.rst
 * Spell check are resolved as per the review comment.
 * inline the read() and write() functions..
 * multi-line comment style
 * Updated subject line prefix
Changes since v3:
 No Changes.
Changes since v2:
 * Removed the "default n" from the Kconfig
 * More help text added to explain more about the logicoreIP driver
 * SPDX id is relocated at top of the file with // style comment
 * Removed the export API and header file and make it a single driver
   which provides logocoreIP init.
 * Provide the information in commit message as well for the why driver
   in drivers/misc.

 drivers/misc/Kconfig|  15 ++
 drivers/misc/Makefile   |   1 +
 drivers/misc/xlnx_vcu.c | 631 
 3 files changed, 647 insertions(+)
 create mode 100644 drivers/misc/xlnx_vcu.c

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index f1a5c23..e679936 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -496,6 +496,21 @@ config PCI_ENDPOINT_TEST
Enable this configuration option to enable the host side test driver
for PCI Endpoint.
 
+config XILINX_VCU
+   tristate "Xilinx VCU logicoreIP Init"
+   help
+ Provides the driver to enable and disable the isolation between the
+ processing system and programmable logic part by using the logicoreIP
+ register set. This driver also configures the frequency based on the
+ clock information from the logicoreIP register set.
+
+ If you say yes here you get support for the logicoreIP.
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called xlnx_vcu.
+
 source "drivers/misc/c2port/Kconfig"
 source "drivers/misc/eeprom/Kconfig"
 source "drivers/misc/cb710/Kconfig"
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 5ca5f64..a6bd0b1 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -55,6 +55,7 @@ obj-$(CONFIG_CXL_BASE)+= cxl/
 obj-$(CONFIG_ASPEED_LPC_CTRL)  += aspeed-lpc-ctrl.o
 obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o
 obj-$(CONFIG_PCI_ENDPOINT_TEST)+= pci_endpoint_test.o
+obj-$(CONFIG_XILINX_VCU)   += xlnx_vcu.o
 
 lkdtm-$(CONFIG_LKDTM)  += lkdtm_core.o
 lkdtm-$(CONFIG_LKDTM)  += lkdtm_bugs.o
diff --git a/drivers/misc/xlnx_vcu.c b/drivers/misc/xlnx_vcu.c
new file mode 100644
index 000..f489d34
--- /dev/null
+++ b/drivers/misc/xlnx_vcu.c
@@ -0,0 +1,631 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Xilinx VCU Init
+ *
+ * Copyright (C) 2016 - 2017 Xilinx, Inc.
+ *
+ * Contacts   Dhaval Shah 
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Address map for different registers implemented in the VCU LogiCORE IP. */
+#define VCU_ECODER_ENABLE  0x00
+#define VCU_DECODER_ENABLE 0x04
+#define VCU_MEMORY_DEPTH   0x08
+#define VCU_ENC_COLOR_DEPTH0x0c
+#define VCU_ENC_VERTICAL_RANGE 0x10
+#define VCU_ENC_FRAME_SIZE_X   0x14
+#define VCU_ENC_FRAME_SIZE_Y   0x18
+#define VCU_ENC_COLOR_FORMAT   0x1c
+#define VCU_ENC_FPS0x20
+#define VCU_MCU_CLK0x24
+#define VCU_CORE_CLK   0x28
+#define VCU_PLL_BYPASS 0x2c
+#define VCU_ENC_CLK0x30
+#define VCU_PLL_CLK0x34
+#define VCU_ENC_VIDEO_STANDARD 0x38
+#define VCU_STATUS 0x3c
+#define VCU_AXI_ENC_CLK0x40
+#define VCU_AXI_DEC_CLK0x44
+#define VCU_AXI_MCU_CLK0x48
+#define VCU_DEC_VIDEO_STANDARD 0x4c
+#define VCU_DEC_FRAME_SIZE_X   0x50
+#define VCU_DEC_FRAME_SIZE_Y   0x54
+#define VCU_DEC_FPS0x58
+#define VCU_BUFFER_B_FRAME 0x5c
+#define VCU_WPP_EN 0x60
+#define VCU_PLL_CLK_DEC0x64
+#define VCU_GASKET_INIT0x74
+#define VCU_GASKET_VALUE   0x03
+
+/* vcu slcr registers, bitmask and shift */
+#define VCU_PLL_CTRL   0x24
+#define VCU_PLL_CTRL_RESET_MASK0x01
+#define VCU_PLL_CTRL_RESET_SHIFT   0
+#define VCU_PLL_CTRL_BYPASS_MASK   0x01
+#define VCU_PLL_CTRL_BYPASS_SHIFT  3
+#define VCU_PLL_CTRL_FBDIV_MASK0x7f
+#define VCU_PLL_CTRL_FBDIV_SHIFT   8
+#d

[PATCH v5 0/2] Documentation and driver of logicoreIP

2017-12-17 Thread Dhaval Shah
1st patch provide Device Tree binding document for logicoreIP
2nd patch provide the xlnx_vcu logicoreIP driver, Kconfig changes
and Makefile changes for the driver.

Dhaval Shah (2):
  Documentation: devicetree: Add DT bindings to xlnx_vcu driver
  misc: xlnx_vcu: Add Xilinx ZYNQMP VCU logicoreIP init driver

 .../devicetree/bindings/misc/xlnx,vcu.txt  |  31 +
 drivers/misc/Kconfig   |  15 +
 drivers/misc/Makefile  |   1 +
 drivers/misc/xlnx_vcu.c| 630 +
 4 files changed, 677 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/xlnx,vcu.txt
 create mode 100644 drivers/misc/xlnx_vcu.c

-- 
2.7.4



[PATCH v5 1/2] dt-bindings: misc: Add DT bindings to xlnx_vcu driver

2017-12-17 Thread Dhaval Shah
Add Device Tree binding document for logicoreIP. This logicoreIP
provides the isolation between the processing system and
programmable logic. Also provides the clock related information.

Signed-off-by: Dhaval Shah 
---
Chnages since v5:
 No Changes.
Chnages since v4:
 No Changes.
Chnages since v3:
 * Use "dt-bindings: misc: ..." for the subject.
Changes since v2:
 * Describe the h/w
 * compatible string is updated to make it more specific
   based on the logicoreIP version.
 * Removed that encoder and decoder child nodes and relatd properties as that
   will be a separate driver and dts nodes. other team is working on that.
 * Updated to use as a single driver.

 .../devicetree/bindings/misc/xlnx,vcu.txt  | 31 ++
 1 file changed, 31 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/xlnx,vcu.txt

diff --git a/Documentation/devicetree/bindings/misc/xlnx,vcu.txt 
b/Documentation/devicetree/bindings/misc/xlnx,vcu.txt
new file mode 100644
index 000..6786d67
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/xlnx,vcu.txt
@@ -0,0 +1,31 @@
+LogicoreIP designed compatible with Xilinx ZYNQ family.
+---
+
+General concept
+---
+
+LogicoreIP design to provide the isolation between processing system
+and programmable logic. Also provides the list of register set to configure
+the frequency.
+
+Required properties:
+- compatible: shall be one of:
+   "xlnx,vcu"
+   "xlnx,vcu-logicoreip-1.0"
+- reg, reg-names: There are two sets of registers need to provide.
+   1. vcu slcr
+   2. Logicore
+   reg-names should contain name for the each register sequence.
+- clocks: phandle for aclk and pll_ref clocksource
+- clock-names: The identification string, "aclk", is always required for
+   the axi clock. "pll_ref" is required for pll.
+Example:
+
+   xlnx_vcu: vcu@a004 {
+   compatible = "xlnx,vcu-logicoreip-1.0";
+   reg = <0x0 0xa004 0x0 0x1000>,
+<0x0 0xa0041000 0x0 0x1000>;
+   reg-names = "vcu_slcr", "logicore";
+   clocks = <&si570_1>, <&clkc 71>;
+   clock-names = "pll_ref", "aclk";
+   };
-- 
2.7.4



[PATCH v5 2/2] misc: xlnx_vcu: Add Xilinx ZYNQMP VCU logicoreIP init driver

2017-12-17 Thread Dhaval Shah
Xilinx ZYNQMP logicoreIP Init driver is based on the new
LogiCoreIP design created. This driver provides the processing system
and programmable logic isolation. Set the frequency based on the clock
information get from the logicoreIP register set.

It is put in drivers/misc as there is no subsystem for this logicoreIP.

Signed-off-by: Dhaval Shah 
---
Changes since v5:
 * Changes made to include index 0 of the array.
Changes since v4:
 * Indent the help text (below) by 2 additional spaces, as documented in 
coding-style.rst
 * Spell check are resolved as per the review comment.
 * inline the read() and write() functions..
 * multi-line comment style
 * Updated subject line prefix
Changes since v3:
 No Changes.
Changes since v2:
 * Removed the "default n" from the Kconfig
 * More help text added to explain more about the logicoreIP driver
 * SPDX id is relocated at top of the file with // style comment
 * Removed the export API and header file and make it a single driver
   which provides logocoreIP init.
 * Provide the information in commit message as well for the why driver
   in drivers/misc.

 drivers/misc/Kconfig|  15 ++
 drivers/misc/Makefile   |   1 +
 drivers/misc/xlnx_vcu.c | 630 
 3 files changed, 646 insertions(+)
 create mode 100644 drivers/misc/xlnx_vcu.c

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index f1a5c23..e679936 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -496,6 +496,21 @@ config PCI_ENDPOINT_TEST
Enable this configuration option to enable the host side test driver
for PCI Endpoint.
 
+config XILINX_VCU
+   tristate "Xilinx VCU logicoreIP Init"
+   help
+ Provides the driver to enable and disable the isolation between the
+ processing system and programmable logic part by using the logicoreIP
+ register set. This driver also configures the frequency based on the
+ clock information from the logicoreIP register set.
+
+ If you say yes here you get support for the logicoreIP.
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called xlnx_vcu.
+
 source "drivers/misc/c2port/Kconfig"
 source "drivers/misc/eeprom/Kconfig"
 source "drivers/misc/cb710/Kconfig"
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 5ca5f64..a6bd0b1 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -55,6 +55,7 @@ obj-$(CONFIG_CXL_BASE)+= cxl/
 obj-$(CONFIG_ASPEED_LPC_CTRL)  += aspeed-lpc-ctrl.o
 obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o
 obj-$(CONFIG_PCI_ENDPOINT_TEST)+= pci_endpoint_test.o
+obj-$(CONFIG_XILINX_VCU)   += xlnx_vcu.o
 
 lkdtm-$(CONFIG_LKDTM)  += lkdtm_core.o
 lkdtm-$(CONFIG_LKDTM)  += lkdtm_bugs.o
diff --git a/drivers/misc/xlnx_vcu.c b/drivers/misc/xlnx_vcu.c
new file mode 100644
index 000..46ec3fd
--- /dev/null
+++ b/drivers/misc/xlnx_vcu.c
@@ -0,0 +1,630 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Xilinx VCU Init
+ *
+ * Copyright (C) 2016 - 2017 Xilinx, Inc.
+ *
+ * Contacts   Dhaval Shah 
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Address map for different registers implemented in the VCU LogiCORE IP. */
+#define VCU_ECODER_ENABLE  0x00
+#define VCU_DECODER_ENABLE 0x04
+#define VCU_MEMORY_DEPTH   0x08
+#define VCU_ENC_COLOR_DEPTH0x0c
+#define VCU_ENC_VERTICAL_RANGE 0x10
+#define VCU_ENC_FRAME_SIZE_X   0x14
+#define VCU_ENC_FRAME_SIZE_Y   0x18
+#define VCU_ENC_COLOR_FORMAT   0x1c
+#define VCU_ENC_FPS0x20
+#define VCU_MCU_CLK0x24
+#define VCU_CORE_CLK   0x28
+#define VCU_PLL_BYPASS 0x2c
+#define VCU_ENC_CLK0x30
+#define VCU_PLL_CLK0x34
+#define VCU_ENC_VIDEO_STANDARD 0x38
+#define VCU_STATUS 0x3c
+#define VCU_AXI_ENC_CLK0x40
+#define VCU_AXI_DEC_CLK0x44
+#define VCU_AXI_MCU_CLK0x48
+#define VCU_DEC_VIDEO_STANDARD 0x4c
+#define VCU_DEC_FRAME_SIZE_X   0x50
+#define VCU_DEC_FRAME_SIZE_Y   0x54
+#define VCU_DEC_FPS0x58
+#define VCU_BUFFER_B_FRAME 0x5c
+#define VCU_WPP_EN 0x60
+#define VCU_PLL_CLK_DEC0x64
+#define VCU_GASKET_INIT0x74
+#define VCU_GASKET_VALUE   0x03
+
+/* vcu slcr registers, bitmask and shift */
+#define VCU_PLL_CTRL   0x24
+#define VCU_PLL_CTRL_RESET_MASK0x01
+#define VCU_PLL_CTRL_RESET_SHIFT   0
+#define VCU_PLL_CTRL_BYPASS_MASK   0x01
+#define VCU_PLL_CTRL_BYPASS_SHIFT  3
+#define VCU_PLL_CTRL_FBDIV_MASK

Re: [PATCH] media: v4l: xilinx: Use SPDX-License-Identifier

2017-12-11 Thread Dhaval Shah
Hi Laurent Pinchart,

Thanks a lot for the review.

On Mon, Dec 11, 2017 at 7:17 PM, Laurent Pinchart
 wrote:
>
> Hi Dhaval,
>
> Thank you for the patch.
>
> On Friday, 8 December 2017 14:35:37 EET Dhaval Shah wrote:
> > SPDX-License-Identifier is used for the Xilinx Video IP and
> > related drivers.
> >
> > Signed-off-by: Dhaval Shah 
> > ---
> >  drivers/media/platform/xilinx/xilinx-dma.c  | 5 +
> >  drivers/media/platform/xilinx/xilinx-dma.h  | 5 +
> >  drivers/media/platform/xilinx/xilinx-tpg.c  | 5 +
> >  drivers/media/platform/xilinx/xilinx-vip.c  | 5 +
> >  drivers/media/platform/xilinx/xilinx-vip.h  | 5 +
> >  drivers/media/platform/xilinx/xilinx-vipp.c | 5 +
> >  drivers/media/platform/xilinx/xilinx-vipp.h | 5 +
> >  drivers/media/platform/xilinx/xilinx-vtc.c  | 5 +
> >  drivers/media/platform/xilinx/xilinx-vtc.h  | 5 +
>
> How about addressing drivers/media/platform/xilinx/Makefile, drivers/media/
> platform/xilinx/Kconfig and include/dt-bindings/media/xilinx-vip.h as well ?
> If you're fine with that I can make the change when applying, there's no need
> to resubmit the patch.

Sorry, I forgot to update in those files. Thanks for that. I am fine
with what you said. Please do that change as you said.
>
> --
> Regards,
>
> Laurent Pinchart
>


[PATCH 0/3] platform/x86: dell-laptop: All the warnings are resolved.

2017-12-13 Thread Dhaval Shah
There are total three types of warnings are resolved.
First patch  : Block comments use * on subsequent lines
Second patch : Missing a blank line after declarations
third patch  : braces {} are not necessary for single statement blocks.

Dhaval Shah (3):
  platform/x86: dell-laptop: Block comments use * on subsequent lines
  platform/x86: dell-laptop: Missing a blank line after declarations
  platform/x86: dell-laptop: braces {} are not necessary for single
statement blocks

 drivers/platform/x86/dell-laptop.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

-- 
2.11.0



[PATCH 3/3] platform/x86: dell-laptop: braces {} are not necessary for single statement blocks

2017-12-13 Thread Dhaval Shah
Resolved braces {} are not necessary for single statement blocks
checkpatch warnings. Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/platform/x86/dell-laptop.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/platform/x86/dell-laptop.c 
b/drivers/platform/x86/dell-laptop.c
index bf4e73a02b39..21361bfa2b5c 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -493,9 +493,8 @@ static void dell_rfkill_query(struct rfkill *rfkill, void 
*data)
ret = dell_send_request(CLASS_INFO, SELECT_RFKILL);
status = buffer->output[1];
 
-   if (ret != 0 || !(status & BIT(0))) {
+   if (ret != 0 || !(status & BIT(0)))
return;
-   }
 
dell_set_arguments(0, 0x2, 0, 0);
ret = dell_send_request(CLASS_INFO, SELECT_RFKILL);
-- 
2.11.0



[PATCH 2/3] platform/x86: dell-laptop: Missing a blank line after declarations

2017-12-13 Thread Dhaval Shah
Resolved Missing a blank line after declarations checkpatch warnings.
Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/platform/x86/dell-laptop.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/platform/x86/dell-laptop.c 
b/drivers/platform/x86/dell-laptop.c
index 9b0855236e3d..bf4e73a02b39 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -466,6 +466,7 @@ static void dell_rfkill_update_sw_state(struct rfkill 
*rfkill, int radio,
if (status & BIT(0)) {
/* Has hw-switch, sync sw_state to BIOS */
int block = rfkill_blocked(rfkill);
+
dell_set_arguments(1 | (radio << 8) | (block << 16), 0, 0, 0);
dell_send_request(CLASS_INFO, SELECT_RFKILL);
} else {
@@ -899,6 +900,7 @@ static void touchpad_led_on(void)
 {
int command = 0x97;
char data = 1;
+
i8042_command(&data, command | 1 << 12);
 }
 
@@ -906,6 +908,7 @@ static void touchpad_led_off(void)
 {
int command = 0x97;
char data = 2;
+
i8042_command(&data, command | 1 << 12);
 }
 
@@ -2130,6 +2133,7 @@ static int __init dell_init(void)
 
if (max_intensity) {
struct backlight_properties props;
+
memset(&props, 0, sizeof(struct backlight_properties));
props.type = BACKLIGHT_PLATFORM;
props.max_brightness = max_intensity;
-- 
2.11.0



[PATCH 1/3] platform/x86: dell-laptop: Block comments use * on subsequent lines

2017-12-13 Thread Dhaval Shah
Resolved Block comments use * on subsequent lines checkpatch warnings.
Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/platform/x86/dell-laptop.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/dell-laptop.c 
b/drivers/platform/x86/dell-laptop.c
index cd4725e7e0b5..9b0855236e3d 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -449,7 +449,8 @@ static int dell_rfkill_set(void *data, bool blocked)
hwswitch = buffer->output[1];
 
/* If the hardware switch controls this radio, and the hardware
-  switch is disabled, always disable the radio */
+* switch is disabled, always disable the radio
+*/
if (ret == 0 && (hwswitch & BIT(hwswitch_bit)) &&
(status & BIT(0)) && !(status & BIT(16)))
disable = 1;
-- 
2.11.0



[PATCH] platform/x86: dell-wmi-aio: Block comments use * on subsequent lines

2017-12-13 Thread Dhaval Shah
Resolved Block comments use * on subsequent lines checkpatch warnings.
Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/platform/x86/dell-wmi-aio.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/dell-wmi-aio.c 
b/drivers/platform/x86/dell-wmi-aio.c
index 50c2078715d6..3842b32a729c 100644
--- a/drivers/platform/x86/dell-wmi-aio.c
+++ b/drivers/platform/x86/dell-wmi-aio.c
@@ -36,7 +36,8 @@ MODULE_LICENSE("GPL");
 struct dell_wmi_event {
u16 length;
/* 0x000: A hot key pressed or an event occurred
-* 0x00F: A sequence of hot keys are pressed */
+* 0x00F: A sequence of hot keys are pressed
+*/
u16 type;
u16 event[];
 };
@@ -115,7 +116,8 @@ static void dell_wmi_aio_notify(u32 value, void *context)
scancode = event->event[0];
} else {
/* Broken machines return the scancode in a
-  buffer */
+* buffer
+*/
if (obj->buffer.pointer &&
obj->buffer.length > 0)
scancode = obj->buffer.pointer[0];
-- 
2.11.0



[PATCH] platform/x86: dell-smbios: Block comments use * on subsequent lines

2017-12-13 Thread Dhaval Shah
Resolved Block comments use * on subsequent lines checkpatch warnings.
Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/platform/x86/dell-smbios.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/dell-smbios.c 
b/drivers/platform/x86/dell-smbios.c
index 6a60db515bda..25a296c90e08 100644
--- a/drivers/platform/x86/dell-smbios.c
+++ b/drivers/platform/x86/dell-smbios.c
@@ -353,7 +353,8 @@ static void __init parse_da_table(const struct dmi_header 
*dm)
container_of(dm, struct calling_interface_structure, header);
 
/* 4 bytes of table header, plus 7 bytes of Dell header, plus at least
-  6 bytes of entry */
+* 6 bytes of entry
+*/
 
if (dm->length < 17)
return;
-- 
2.11.0



[PATCH] platform/x86: dell-rbtn: Block comments use * on subsequent lines

2017-12-13 Thread Dhaval Shah
Resolved Block comments use * on subsequent lines checkpatch warnings.
Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/platform/x86/dell-rbtn.c | 26 +-
 drivers/platform/x86/dell-rbtn.h | 26 +-
 2 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/platform/x86/dell-rbtn.c b/drivers/platform/x86/dell-rbtn.c
index f3afe778001e..cab93c6dcd34 100644
--- a/drivers/platform/x86/dell-rbtn.c
+++ b/drivers/platform/x86/dell-rbtn.c
@@ -1,17 +1,17 @@
 /*
-Dell Airplane Mode Switch driver
-Copyright (C) 2014-2015  Pali Roh??r 
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
+ *   Dell Airplane Mode Switch driver
+ *   Copyright (C) 2014-2015  Pali Roh??r 
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ */
 
 #include 
 #include 
diff --git a/drivers/platform/x86/dell-rbtn.h b/drivers/platform/x86/dell-rbtn.h
index c59cc6b8ec2b..46337b22f00d 100644
--- a/drivers/platform/x86/dell-rbtn.h
+++ b/drivers/platform/x86/dell-rbtn.h
@@ -1,17 +1,17 @@
 /*
-Dell Airplane Mode Switch driver
-Copyright (C) 2014-2015  Pali Roh??r 
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-*/
+ *   Dell Airplane Mode Switch driver
+ *   Copyright (C) 2014-2015  Pali Roh??r 
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ */
 
 #ifndef _DELL_RBTN_H_
 #define _DELL_RBTN_H_
-- 
2.11.0



[PATCH] platform/x86: dell-smo8800: Possible unnecessary 'out of memory' message

2017-12-13 Thread Dhaval Shah
Removed Possible unnecessary 'out of memory' message checkpatch warnings.
Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/platform/x86/dell-smo8800.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/platform/x86/dell-smo8800.c 
b/drivers/platform/x86/dell-smo8800.c
index 1d87237bc731..9590d5e7c5ca 100644
--- a/drivers/platform/x86/dell-smo8800.c
+++ b/drivers/platform/x86/dell-smo8800.c
@@ -150,10 +150,8 @@ static int smo8800_add(struct acpi_device *device)
struct smo8800_device *smo8800;
 
smo8800 = devm_kzalloc(&device->dev, sizeof(*smo8800), GFP_KERNEL);
-   if (!smo8800) {
-   dev_err(&device->dev, "failed to allocate device data\n");
+   if (!smo8800)
return -ENOMEM;
-   }
 
smo8800->dev = &device->dev;
smo8800->miscdev.minor = MISC_DYNAMIC_MINOR;
-- 
2.11.0



Re: [PATCH] platform/x86: dell-smo8800: Possible unnecessary 'out of memory' message

2017-12-13 Thread Dhaval Shah
Hi Pali Rohar,

Thanks for the review.


> From: Pali Rohár 
> Sent: Wednesday, December 13, 2017 2:00 PM
> To: Dhaval Shah
> Cc: dvh...@infradead.org; a...@infradead.org; 
> platform-driver-...@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] platform/x86: dell-smo8800: Possible unnecessary 'out of 
> memory' message
> 
> On Wednesday 13 December 2017 13:53:54 Dhaval Shah wrote:
> > Removed Possible unnecessary 'out of memory' message checkpatch warnings.
> > Issue found by checkpatch.
> >
> > Signed-off-by: Dhaval Shah 
> > ---
> >  drivers/platform/x86/dell-smo8800.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/platform/x86/dell-smo8800.c 
> > b/drivers/platform/x86/dell-smo8800.c
> > index 1d87237bc731..9590d5e7c5ca 100644
> > --- a/drivers/platform/x86/dell-smo8800.c
> > +++ b/drivers/platform/x86/dell-smo8800.c
> > @@ -150,10 +150,8 @@ static int smo8800_add(struct acpi_device *device)
> >   struct smo8800_device *smo8800;
> >
> >   smo8800 = devm_kzalloc(&device->dev, sizeof(*smo8800), GFP_KERNEL);
> > - if (!smo8800) {
> > - dev_err(&device->dev, "failed to allocate device data\n");
> 
> Hi! Any particular reason for removing error message?
> 
When you give the -ENOMEM as error in return then this message info will be 
provided by the kernel subsystem. no need to give this printk and that's why 
checkpatch gives warning in this case.
> > + if (!smo8800)
> >   return -ENOMEM;
> > - }
> >
> >   smo8800->dev = &device->dev;
> >   smo8800->miscdev.minor = MISC_DYNAMIC_MINOR;

--
Pali Rohár
pali.ro...@gmail.com


Re: [PATCH] platform/x86: dell-rbtn: Block comments use * on subsequent lines

2017-12-13 Thread Dhaval Shah
HI

Thanks a lot for the review.

> From: Philippe Ombredanne 
> Sent: Wednesday, December 13, 2017 2:54 PM
> To: Dhaval Shah
> Cc: pali.ro...@gmail.com; Darren Hart; Andy Shevchenko; 
> platform-driver-...@vger.kernel.org; LKML
> Subject: Re: [PATCH] platform/x86: dell-rbtn: Block comments use * on 
> subsequent lines
> 
> Dhaval,
> 
> On Wed, Dec 13, 2017 at 9:23 AM, Dhaval Shah
>  wrote:
> > Resolved Block comments use * on subsequent lines checkpatch warnings.
> > Issue found by checkpatch.
> >
> > Signed-off-by: Dhaval Shah 
> > ---
> >  drivers/platform/x86/dell-rbtn.c | 26 +-
> >  drivers/platform/x86/dell-rbtn.h | 26 +-
> >  2 files changed, 26 insertions(+), 26 deletions(-)
> >
> > diff --git a/drivers/platform/x86/dell-rbtn.c 
> > b/drivers/platform/x86/dell-rbtn.c
> > index f3afe778001e..cab93c6dcd34 100644
> > --- a/drivers/platform/x86/dell-rbtn.c
> > +++ b/drivers/platform/x86/dell-rbtn.c
> > @@ -1,17 +1,17 @@
> >  /*
> > -Dell Airplane Mode Switch driver
> > -Copyright (C) 2014-2015  Pali Rohár 
> > -
> > -This program is free software; you can redistribute it and/or modify
> > -it under the terms of the GNU General Public License as published by
> > -the Free Software Foundation; either version 2 of the License, or
> > -(at your option) any later version.
> > -
> > -This program is distributed in the hope that it will be useful,
> > -but WITHOUT ANY WARRANTY; without even the implied warranty of
> > -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > -GNU General Public License for more details.
> > -*/
> > + *   Dell Airplane Mode Switch driver
> > + *   Copyright (C) 2014-2015  Pali Rohár 
> > + *
> > + *   This program is free software; you can redistribute it and/or modify
> > + *   it under the terms of the GNU General Public License as published by
> > + *   the Free Software Foundation; either version 2 of the License, or
> > + *   (at your option) any later version.
> > + *
> > + *   This program is distributed in the hope that it will be useful,
> > + *   but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + *   GNU General Public License for more details.
> > + */
> 
> Do you mind using the new SPDX ids instead of this long legalese?
> You can check the doc patches from Thomas for details [1]
> 
> 
> [1] https://lkml.org/lkml/2017/12/4/934
This is different issue. If we need to fix the issue of this if we update SPDX 
licensing as well.
I am agree with you on the use of the new SPDX IDs instead of the long legalese.
For this, we have to add the text "// SPDX-License-Identifier: GPL-2.0" at the 
top of the file and remove the 
whole license part and keep on copyright and Author name related info. After 
change, it looks like
// SPDX-License-Identifier: GPL-2.0
/*
 *  Dell Airplane Mode Switch driver
 *  Copyright (C) 2014-2015  Pali Rohár 
 */
 
> --
> Cordially
> Philippe Ombredanne


Re: [PATCH] platform/x86: dell-rbtn: Block comments use * on subsequent lines

2017-12-13 Thread Dhaval Shah

Hi Philippe,



> From: Philippe Ombredanne 
> Sent: Wednesday, December 13, 2017 3:31 PM
> To: Dhaval Shah
> Cc: pali.ro...@gmail.com; Darren Hart; Andy Shevchenko; 
> platform-driver-...@vger.kernel.org; LKML
> Subject: Re: [PATCH] platform/x86: dell-rbtn: Block comments use * on 
> subsequent lines
>   

> Dhaval,
> 
> On Wed, Dec 13, 2017 at 10:52 AM, Dhaval Shah
>  wrote:
> > HI
> >
> > Thanks a lot for the review.
> > 
> > > From: Philippe Ombredanne 
> > > Sent: Wednesday, December 13, 2017 2:54 PM
> > > To: Dhaval Shah
> > > Cc: pali.ro...@gmail.com; Darren Hart; Andy Shevchenko; 
> > > platform-driver-...@vger.kernel.org; LKML
> > > Subject: Re: [PATCH] platform/x86: dell-rbtn: Block comments use * on 
> > > subsequent lines
> > >
> > > Dhaval,
> > >
> > > On Wed, Dec 13, 2017 at 9:23 AM, Dhaval Shah
> > >  wrote:
> > > > Resolved Block comments use * on subsequent lines checkpatch warnings.
> > > > Issue found by checkpatch.
> > > >
> > > > Signed-off-by: Dhaval Shah 
> > > > ---
> > > >  drivers/platform/x86/dell-rbtn.c | 26 +-
> > > >  drivers/platform/x86/dell-rbtn.h | 26 +-
> > > >  2 files changed, 26 insertions(+), 26 deletions(-)
> > > >
> > > > diff --git a/drivers/platform/x86/dell-rbtn.c 
> > > > b/drivers/platform/x86/dell-rbtn.c
> > > > index f3afe778001e..cab93c6dcd34 100644
> > > > --- a/drivers/platform/x86/dell-rbtn.c
> > > > +++ b/drivers/platform/x86/dell-rbtn.c
> > > > @@ -1,17 +1,17 @@
> > > >  /*
> > > > -    Dell Airplane Mode Switch driver
> > > > -    Copyright (C) 2014-2015  Pali Rohár 
> > > > -
> > > > -    This program is free software; you can redistribute it and/or 
> > > > modify
> > > > -    it under the terms of the GNU General Public License as published 
> > > > by
> > > > -    the Free Software Foundation; either version 2 of the License, or
> > > > -    (at your option) any later version.
> > > > -
> > > > -    This program is distributed in the hope that it will be useful,
> > > > -    but WITHOUT ANY WARRANTY; without even the implied warranty of
> > > > -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > > > -    GNU General Public License for more details.
> > > > -*/
> > > > + *   Dell Airplane Mode Switch driver
> > > > + *   Copyright (C) 2014-2015  Pali Rohár 
> > > > + *
> > > > + *   This program is free software; you can redistribute it and/or 
> > > > modify
> > > > + *   it under the terms of the GNU General Public License as published 
> > > > by
> > > > + *   the Free Software Foundation; either version 2 of the License, or
> > > > + *   (at your option) any later version.
> > > > + *
> > > > + *   This program is distributed in the hope that it will be useful,
> > > > + *   but WITHOUT ANY WARRANTY; without even the implied warranty of
> > > > + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > > > + *   GNU General Public License for more details.
> > > > + */
> > >
> > > Do you mind using the new SPDX ids instead of this long legalese?
> > > You can check the doc patches from Thomas for details [1]
> > >
> > >
> > > [1]  https://lkml.org/lkml/2017/12/4/934
> > This is different issue. If we need to fix the issue of this if we update 
> > SPDX licensing as well.
> > I am agree with you on the use of the new SPDX IDs instead of the long 
> > legalese.
> > For this, we have to add the text "// SPDX-License-Identifier: GPL-2.0" at 
> > the top of the file and remove the
> > whole license part and keep on copyright and Author name related info. 
> > After change, it looks like
> > // SPDX-License-Identifier: GPL-2.0
> > /*
> >  *  Dell Airplane Mode Switch driver
> >  *  Copyright (C) 2014-2015  Pali Rohár 
> >  */
> 
> And for a short comment block like this, Linus preference is to avoid
> mixing comment style and go all the way C++ style as in:
> 
> > // SPDX-License-Identifier: GPL-2.0
> > // Dell Airplane Mode Switch driver
> > // Copyright (C) 2014-2015  Pali Rohár 
> > 
> > ... for even less boilerplate ;)

Thanks a lot for the link.
Do you want to me to update along with SPDX in this patchset with V2 or we will 
update in the next patchset once this patch merge?

> > 
> > See Linus comments for a rationale [1] [2] [3] [4] [5]
> > 
> > [1]  https://lkml.org/lkml/2017/11/25/133
> > [2]  https://lkml.org/lkml/2017/11/25/125
> > [3] https://lkml.org/lkml/2017/11/2/715
 > > [4] https://lkml.org/lkml/2017/11/2/805
> 
 >  -- 
 >  Cordially
 >  Philippe Ombredanne
  

Re: [PATCH] platform/x86: dell-rbtn: Block comments use * on subsequent lines

2017-12-13 Thread Dhaval Shah
Hi Joe,


> From: Joe Perches 
> Sent: Wednesday, December 13, 2017 5:55 PM
> To: Dhaval Shah; Philippe Ombredanne
> Cc: pali.ro...@gmail.com; Darren Hart; Andy Shevchenko; 
> platform-driver-...@vger.kernel.org; LKML
> Subject: Re: [PATCH] platform/x86: dell-rbtn: Block comments use * on 
> subsequent lines
> 
> On Wed, 2017-12-13 at 10:53 +, Dhaval Shah wrote:
> > > > This is different issue. If we need to fix the issue of this if we 
> > > > update SPDX licensing as well.
> > > > I am agree with you on the use of the new SPDX IDs instead of the long 
> > > > legalese.
> > > > For this, we have to add the text "// SPDX-License-Identifier: GPL-2.0" 
> > > > at the top of the file and remove the
> > > > whole license part and keep on copyright and Author name related info. 
> > > > After change, it looks like
> > > > // SPDX-License-Identifier: GPL-2.0
> > > > /*
> > > >   *  Dell Airplane Mode Switch driver
> > > >   *  Copyright (C) 2014-2015  Pali Rohár 
> > > >   */
> > >
> > > And for a short comment block like this, Linus preference is to avoid
> > > mixing comment style and go all the way C++ style as in:
> > >
> > > > // SPDX-License-Identifier: GPL-2.0
> > > > // Dell Airplane Mode Switch driver
> > > // Copyright (C) 2014-2015  Pali Rohár 
> > >
> > > ... for even less boilerplate ;)
> >
> > Thanks a lot for the link.
> > Do you want to me to update along with SPDX in this patchset with V2 or we 
> > will update in the next patchset once this > > >patch merge?
> 
> If anyone does conversions of these license texts
> you have to be _extremely_ careful about what
> specific license identifier you use.

> This license includes the text
> "or (at your option) any later version"
> which is not the same as using
> SPDX-License-Identifier: GPL-2.0
I have given this SPDX ID based on the current license info in the driver. 
Yeah. I give the authority to author pali.ro...@gmail.com to decide the SPDX 
text.


Re: [PATCH] platform/x86: dell-rbtn: Block comments use * on subsequent lines

2017-12-13 Thread Dhaval Shah

Hi Philippe,




> From: Philippe Ombredanne 
> Sent: Wednesday, December 13, 2017 6:27 PM
> To: Dhaval Shah
> Cc: pali.ro...@gmail.com; Darren Hart; Andy Shevchenko; 
> platform-driver-...@vger.kernel.org; LKML
> Subject: Re: [PATCH] platform/x86: dell-rbtn: Block comments use * on 
> subsequent lines
> 
> Dhaval,
> 
> On Wed, Dec 13, 2017 at 11:47 AM, Dhaval Shah
>  wrote:
> 
> 
> > > And for a short comment block like this, Linus preference is to avoid
> > > mixing comment style and go all the way C++ style as in:
> > >
> > > > // SPDX-License-Identifier: GPL-2.0
> > > > // Dell Airplane Mode Switch driver
> > > > // Copyright (C) 2014-2015  Pali Rohár 
> > > >
> > > > ... for even less boilerplate ;)
> >
> > Thanks a lot for the link.
> > Do you want to me to update along with SPDX in this patchset with V2 or we 
> > will update in the next patchset once this patch merge?
> 
> That's not for me to decide, I am just a lowly licensing elf helper scruffy!
I can assume that current patch is accepted or I have to provide you any changes

> PS: you might want to avoid sending HTML email on lkml, FWIW.
That is done by mistake. sorry for that. I will take care of that.

--
Cordially
Philippe Ombredanne


[PATCH] misc: isl29003: Missing a blank line after declarations

2017-12-07 Thread Dhaval Shah
Resolved all the missing a blank line after declarations checkpatch
warnings. Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/misc/isl29003.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/misc/isl29003.c b/drivers/misc/isl29003.c
index 976df0013633..b8032882c865 100644
--- a/drivers/misc/isl29003.c
+++ b/drivers/misc/isl29003.c
@@ -78,6 +78,7 @@ static int __isl29003_read_reg(struct i2c_client *client,
   u32 reg, u8 mask, u8 shift)
 {
struct isl29003_data *data = i2c_get_clientdata(client);
+
return (data->reg_cache[reg] & mask) >> shift;
 }
 
@@ -160,6 +161,7 @@ static int isl29003_get_power_state(struct i2c_client 
*client)
 {
struct isl29003_data *data = i2c_get_clientdata(client);
u8 cmdreg = data->reg_cache[ISL29003_REG_COMMAND];
+
return ~cmdreg & ISL29003_ADC_PD;
 }
 
@@ -196,6 +198,7 @@ static ssize_t isl29003_show_range(struct device *dev,
   struct device_attribute *attr, char *buf)
 {
struct i2c_client *client = to_i2c_client(dev);
+
return sprintf(buf, "%i\n", isl29003_get_range(client));
 }
 
@@ -231,6 +234,7 @@ static ssize_t isl29003_show_resolution(struct device *dev,
char *buf)
 {
struct i2c_client *client = to_i2c_client(dev);
+
return sprintf(buf, "%d\n", isl29003_get_resolution(client));
 }
 
@@ -264,6 +268,7 @@ static ssize_t isl29003_show_mode(struct device *dev,
  struct device_attribute *attr, char *buf)
 {
struct i2c_client *client = to_i2c_client(dev);
+
return sprintf(buf, "%d\n", isl29003_get_mode(client));
 }
 
@@ -298,6 +303,7 @@ static ssize_t isl29003_show_power_state(struct device *dev,
 char *buf)
 {
struct i2c_client *client = to_i2c_client(dev);
+
return sprintf(buf, "%d\n", isl29003_get_power_state(client));
 }
 
@@ -361,6 +367,7 @@ static int isl29003_init_client(struct i2c_client *client)
 * if one of the reads fails, we consider the init failed */
for (i = 0; i < ARRAY_SIZE(data->reg_cache); i++) {
int v = i2c_smbus_read_byte_data(client, i);
+
if (v < 0)
return -ENODEV;
 
-- 
2.11.0



[PATCH v2 0/2] Documentation and driver of logicoreIP

2017-12-07 Thread Dhaval Shah
1st patch provide Device Tree binding document for logicoreIP
2nd patch provide the xlnx_vcu logicoreIP driver, Kconfig changes
and Makefile changes for the driver.

Dhaval Shah (2):
  Documentation: devicetree: Add DT bindings to xlnx_vcu driver
  misc: Add Xilinx ZYNQMP VCU logicoreIP init driver

 .../devicetree/bindings/misc/xlnx,vcu.txt  |  31 +
 drivers/misc/Kconfig   |  15 +
 drivers/misc/Makefile  |   1 +
 drivers/misc/xlnx_vcu.c| 629 +
 4 files changed, 676 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/xlnx,vcu.txt
 create mode 100644 drivers/misc/xlnx_vcu.c

-- 
2.7.4




[PATCH v2 1/2] Documentation: devicetree: Add DT bindings to xlnx_vcu driver

2017-12-07 Thread Dhaval Shah
Add Device Tree binding document for logicoreIP. This logicoreIP
provides the isolation between the processing system and
programmable logic. Also provides the clock related information.

Signed-off-by: Dhaval Shah 
---
Changes since v2:
 * Describe the h/w
 * compatible string is updated to make it more specific
   based on the logicoreIP version.
 * Removed that encoder and decoder child nodes and relatd properties as that
   will be a separate driver and dts nodes. other team is working on that.
 * Updated to use as a single driver.

 .../devicetree/bindings/misc/xlnx,vcu.txt  | 31 ++
 1 file changed, 31 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/xlnx,vcu.txt

diff --git a/Documentation/devicetree/bindings/misc/xlnx,vcu.txt 
b/Documentation/devicetree/bindings/misc/xlnx,vcu.txt
new file mode 100644
index 000..6786d67
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/xlnx,vcu.txt
@@ -0,0 +1,31 @@
+LogicoreIP designed compatible with Xilinx ZYNQ family.
+---
+
+General concept
+---
+
+LogicoreIP design to provide the isolation between processing system
+and programmable logic. Also provides the list of register set to configure
+the frequency.
+
+Required properties:
+- compatible: shall be one of:
+   "xlnx,vcu"
+   "xlnx,vcu-logicoreip-1.0"
+- reg, reg-names: There are two sets of registers need to provide.
+   1. vcu slcr
+   2. Logicore
+   reg-names should contain name for the each register sequence.
+- clocks: phandle for aclk and pll_ref clocksource
+- clock-names: The identification string, "aclk", is always required for
+   the axi clock. "pll_ref" is required for pll.
+Example:
+
+   xlnx_vcu: vcu@a004 {
+   compatible = "xlnx,vcu-logicoreip-1.0";
+   reg = <0x0 0xa004 0x0 0x1000>,
+<0x0 0xa0041000 0x0 0x1000>;
+   reg-names = "vcu_slcr", "logicore";
+   clocks = <&si570_1>, <&clkc 71>;
+   clock-names = "pll_ref", "aclk";
+   };
-- 
2.7.4



[PATCH v2 2/2] misc: Add Xilinx ZYNQMP VCU logicoreIP init driver

2017-12-07 Thread Dhaval Shah
Xilinx ZYNQMP logicoreIP Init driver is based on the new
LogiCoreIP design created. This driver provides the processing system
and programmable logic isolation. Set the frequency based on the clock
information get from the logicoreIP register set.

It is put in drivers/misc as there is no subsystem for this logicoreIP.

Signed-off-by: Dhaval Shah 
---
Changes since v2:
 * Removed the "default n" from the Kconfig
 * More help text added to explain more about the logicoreIP driver
 * SPDX id is relocated at top of the file with // style comment
 * Removed the export API and header file and make it a single driver
   which provides logocoreIP init.
 * Provide the information in commit message as well for the why driver
   in drivers/misc.

 drivers/misc/Kconfig|  15 ++
 drivers/misc/Makefile   |   1 +
 drivers/misc/xlnx_vcu.c | 629 
 3 files changed, 645 insertions(+)
 create mode 100644 drivers/misc/xlnx_vcu.c

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index f1a5c23..24ea516 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -496,6 +496,21 @@ config PCI_ENDPOINT_TEST
Enable this configuration option to enable the host side test driver
for PCI Endpoint.
 
+config XILINX_VCU
+   tristate "Xilinx VCU logicoreIP Init"
+   help
+ Provides the driver to enable and disable the isolation between the
+ processing system and programmable logic part by using the logicoreIP
+ register set. This driver also configure the frequency based on the
+ clock information get from the logicoreIP register set.
+
+ If you say yes here you get support for the logcoreIP.
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called xlnx_vcu.
+
 source "drivers/misc/c2port/Kconfig"
 source "drivers/misc/eeprom/Kconfig"
 source "drivers/misc/cb710/Kconfig"
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 5ca5f64..a6bd0b1 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -55,6 +55,7 @@ obj-$(CONFIG_CXL_BASE)+= cxl/
 obj-$(CONFIG_ASPEED_LPC_CTRL)  += aspeed-lpc-ctrl.o
 obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o
 obj-$(CONFIG_PCI_ENDPOINT_TEST)+= pci_endpoint_test.o
+obj-$(CONFIG_XILINX_VCU)   += xlnx_vcu.o
 
 lkdtm-$(CONFIG_LKDTM)  += lkdtm_core.o
 lkdtm-$(CONFIG_LKDTM)  += lkdtm_bugs.o
diff --git a/drivers/misc/xlnx_vcu.c b/drivers/misc/xlnx_vcu.c
new file mode 100644
index 000..41819f0
--- /dev/null
+++ b/drivers/misc/xlnx_vcu.c
@@ -0,0 +1,629 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Xilinx VCU Init
+ *
+ * Copyright (C) 2016 - 2017 Xilinx, Inc.
+ *
+ * Contacts   Dhaval Shah 
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Address map for different registers implemented in the VCU LogiCORE IP. */
+#define VCU_ECODER_ENABLE  0x00
+#define VCU_DECODER_ENABLE 0x04
+#define VCU_MEMORY_DEPTH   0x08
+#define VCU_ENC_COLOR_DEPTH0x0c
+#define VCU_ENC_VERTICAL_RANGE 0x10
+#define VCU_ENC_FRAME_SIZE_X   0x14
+#define VCU_ENC_FRAME_SIZE_Y   0x18
+#define VCU_ENC_COLOR_FORMAT   0x1c
+#define VCU_ENC_FPS0x20
+#define VCU_MCU_CLK0x24
+#define VCU_CORE_CLK   0x28
+#define VCU_PLL_BYPASS 0x2c
+#define VCU_ENC_CLK0x30
+#define VCU_PLL_CLK0x34
+#define VCU_ENC_VIDEO_STANDARD 0x38
+#define VCU_STATUS 0x3c
+#define VCU_AXI_ENC_CLK0x40
+#define VCU_AXI_DEC_CLK0x44
+#define VCU_AXI_MCU_CLK0x48
+#define VCU_DEC_VIDEO_STANDARD 0x4c
+#define VCU_DEC_FRAME_SIZE_X   0x50
+#define VCU_DEC_FRAME_SIZE_Y   0x54
+#define VCU_DEC_FPS0x58
+#define VCU_BUFFER_B_FRAME 0x5c
+#define VCU_WPP_EN 0x60
+#define VCU_PLL_CLK_DEC0x64
+#define VCU_GASKET_INIT0x74
+#define VCU_GASKET_VALUE   0x03
+
+/* vcu slcr registers, bitmask and shift */
+#define VCU_PLL_CTRL   0x24
+#define VCU_PLL_CTRL_RESET_MASK0x01
+#define VCU_PLL_CTRL_RESET_SHIFT   0
+#define VCU_PLL_CTRL_BYPASS_MASK   0x01
+#define VCU_PLL_CTRL_BYPASS_SHIFT  3
+#define VCU_PLL_CTRL_FBDIV_MASK0x7f
+#define VCU_PLL_CTRL_FBDIV_SHIFT   8
+#define VCU_PLL_CTRL_POR_IN_MASK   0x01
+#define VCU_PLL_CTRL_POR_IN_SHIFT  1
+#define VCU_PLL_CTRL_PWR_POR_MASK  0x01
+#define VCU_PLL_CTRL_PWR_POR_SHIFT 2
+#define VCU_PLL_CTRL_CLKOUTDIV_MASK0x03
+#define VCU_PLL_CTRL_CLKOUTDIV_SHIFT   16
+#define VCU_PLL_CTRL_DEFAULT   0
+#

[PATCH] misc: apds990x: Missing a blank line after declarations.

2017-12-07 Thread Dhaval Shah
Resolved all the missing a blank line after declarations checkpatch
warnings. Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/misc/apds990x.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/misc/apds990x.c b/drivers/misc/apds990x.c
index c9f07032c2fc..ed9412d750b7 100644
--- a/drivers/misc/apds990x.c
+++ b/drivers/misc/apds990x.c
@@ -715,6 +715,7 @@ static ssize_t apds990x_rate_avail(struct device *dev,
 {
int i;
int pos = 0;
+
for (i = 0; i < ARRAY_SIZE(arates_hz); i++)
pos += sprintf(buf + pos, "%d ", arates_hz[i]);
sprintf(buf + pos - 1, "\n");
@@ -725,6 +726,7 @@ static ssize_t apds990x_rate_show(struct device *dev,
   struct device_attribute *attr, char *buf)
 {
struct apds990x_chip *chip =  dev_get_drvdata(dev);
+
return sprintf(buf, "%d\n", chip->arate);
 }
 
@@ -784,6 +786,7 @@ static ssize_t apds990x_prox_show(struct device *dev,
 {
ssize_t ret;
struct apds990x_chip *chip =  dev_get_drvdata(dev);
+
if (pm_runtime_suspended(dev) || !chip->prox_en)
return -EIO;
 
@@ -807,6 +810,7 @@ static ssize_t apds990x_prox_enable_show(struct device *dev,
   struct device_attribute *attr, char *buf)
 {
struct apds990x_chip *chip =  dev_get_drvdata(dev);
+
return sprintf(buf, "%d\n", chip->prox_en);
 }
 
@@ -847,6 +851,7 @@ static ssize_t apds990x_prox_reporting_mode_show(struct 
device *dev,
   struct device_attribute *attr, char *buf)
 {
struct apds990x_chip *chip =  dev_get_drvdata(dev);
+
return sprintf(buf, "%s\n",
reporting_modes[!!chip->prox_continuous_mode]);
 }
@@ -884,6 +889,7 @@ static ssize_t apds990x_lux_thresh_above_show(struct device 
*dev,
   struct device_attribute *attr, char *buf)
 {
struct apds990x_chip *chip =  dev_get_drvdata(dev);
+
return sprintf(buf, "%d\n", chip->lux_thres_hi);
 }
 
@@ -891,6 +897,7 @@ static ssize_t apds990x_lux_thresh_below_show(struct device 
*dev,
   struct device_attribute *attr, char *buf)
 {
struct apds990x_chip *chip =  dev_get_drvdata(dev);
+
return sprintf(buf, "%d\n", chip->lux_thres_lo);
 }
 
@@ -926,6 +933,7 @@ static ssize_t apds990x_lux_thresh_above_store(struct 
device *dev,
 {
struct apds990x_chip *chip =  dev_get_drvdata(dev);
int ret = apds990x_set_lux_thresh(chip, &chip->lux_thres_hi, buf);
+
if (ret < 0)
return ret;
return len;
@@ -937,6 +945,7 @@ static ssize_t apds990x_lux_thresh_below_store(struct 
device *dev,
 {
struct apds990x_chip *chip =  dev_get_drvdata(dev);
int ret = apds990x_set_lux_thresh(chip, &chip->lux_thres_lo, buf);
+
if (ret < 0)
return ret;
return len;
@@ -954,6 +963,7 @@ static ssize_t apds990x_prox_threshold_show(struct device 
*dev,
   struct device_attribute *attr, char *buf)
 {
struct apds990x_chip *chip =  dev_get_drvdata(dev);
+
return sprintf(buf, "%d\n", chip->prox_thres);
 }
 
@@ -1026,6 +1036,7 @@ static ssize_t apds990x_chip_id_show(struct device *dev,
   struct device_attribute *attr, char *buf)
 {
struct apds990x_chip *chip =  dev_get_drvdata(dev);
+
return sprintf(buf, "%s %d\n", chip->chipname, chip->revision);
 }
 
-- 
2.11.0



[PATCH 3/3] misc: ics932s401: open brace should be on the previous line

2017-12-07 Thread Dhaval Shah
Resolved open brace { should be on the previous line checkpatch
error. Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/misc/ics932s401.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/misc/ics932s401.c b/drivers/misc/ics932s401.c
index 12177db99ce1..81a0541ef3ac 100644
--- a/drivers/misc/ics932s401.c
+++ b/drivers/misc/ics932s401.c
@@ -353,8 +353,7 @@ static DEVICE_ATTR(ref_clock, S_IRUGO, show_value, NULL);
 static DEVICE_ATTR(cpu_spread, S_IRUGO, show_spread, NULL);
 static DEVICE_ATTR(src_spread, S_IRUGO, show_spread, NULL);
 
-static struct attribute *ics932s401_attr[] =
-{
+static struct attribute *ics932s401_attr[] = {
&dev_attr_spread_enabled.attr,
&dev_attr_cpu_clock_selection.attr,
&dev_attr_cpu_clock.attr,
-- 
2.11.0



[PATCH 0/3] misc: ics932s401: warnings and errors are resolved.

2017-12-07 Thread Dhaval Shah
Two types of checkpatch warnings and one type of error are resolved.
 * First patch  : Missing a blank line after declarations
 * Second patch : please, no space before tabs
 * third patch  : open brace { should be on the previous line

Issue found by checkpatch.
./scripts/checkpatch.pl -f --strict drivers/misc/hpilo.c


Dhaval Shah (3):
  misc: ics932s401: Missing a blank line after declarations
  misc: ics932s401: please, no space before tabs
  misc: ics932s401: open brace should be on the previous line

 drivers/misc/ics932s401.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.11.0



[PATCH 1/3] misc: ics932s401: Missing a blank line after declarations

2017-12-07 Thread Dhaval Shah
Resolved all the missing a blank line after declarations checkpatch
warnings. Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/misc/ics932s401.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/misc/ics932s401.c b/drivers/misc/ics932s401.c
index 28f51e01fd2b..d22e2dc62907 100644
--- a/drivers/misc/ics932s401.c
+++ b/drivers/misc/ics932s401.c
@@ -225,6 +225,7 @@ static ssize_t show_cpu_clock_sel(struct device *dev,
else {
/* Freq is neatly wrapped up for us */
int fid = data->regs[ICS932S401_REG_CFG7] & ICS932S401_FS_MASK;
+
freq = fs_speeds[fid];
if (data->regs[ICS932S401_REG_CTRL] & ICS932S401_CPU_ALT) {
switch (freq) {
-- 
2.11.0



[PATCH 2/3] misc: ics932s401: please, no space before tabs

2017-12-07 Thread Dhaval Shah
Resolved all the please, no space beofore tabs checkpatch
warnings. Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/misc/ics932s401.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/ics932s401.c b/drivers/misc/ics932s401.c
index d22e2dc62907..12177db99ce1 100644
--- a/drivers/misc/ics932s401.c
+++ b/drivers/misc/ics932s401.c
@@ -33,7 +33,7 @@ static const unsigned short normal_i2c[] = { 0x69, 
I2C_CLIENT_END };
 
 /* ICS932S401 registers */
 #define ICS932S401_REG_CFG20x01
-#defineICS932S401_CFG1_SPREAD  0x01
+#defineICS932S401_CFG1_SPREAD  0x01
 #define ICS932S401_REG_CFG70x06
 #defineICS932S401_FS_MASK  0x07
 #defineICS932S401_REG_VENDOR_REV   0x07
@@ -58,7 +58,7 @@ static const unsigned short normal_i2c[] = { 0x69, 
I2C_CLIENT_END };
 #defineICS932S401_REG_SRC_SPREAD1  0x11
 #define ICS932S401_REG_SRC_SPREAD2 0x12
 #define ICS932S401_REG_CPU_DIVISOR 0x13
-#defineICS932S401_CPU_DIVISOR_SHIFT4
+#defineICS932S401_CPU_DIVISOR_SHIFT4
 #define ICS932S401_REG_PCISRC_DIVISOR  0x14
 #defineICS932S401_SRC_DIVISOR_MASK 0x0F
 #defineICS932S401_PCI_DIVISOR_SHIFT4
-- 
2.11.0



[PATCH] misc: ad525x_dpot: Unnecessary space before function pointer arguments

2017-12-08 Thread Dhaval Shah
Resolved all the Unnecessary space before function pointer arguments
checkpatch warnings. Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/misc/ad525x_dpot.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/misc/ad525x_dpot.h b/drivers/misc/ad525x_dpot.h
index 6bd1eba23bc0..443a51fd5680 100644
--- a/drivers/misc/ad525x_dpot.h
+++ b/drivers/misc/ad525x_dpot.h
@@ -195,12 +195,12 @@ enum dpot_devid {
 struct dpot_data;
 
 struct ad_dpot_bus_ops {
-   int (*read_d8) (void *client);
-   int (*read_r8d8) (void *client, u8 reg);
-   int (*read_r8d16) (void *client, u8 reg);
-   int (*write_d8) (void *client, u8 val);
-   int (*write_r8d8) (void *client, u8 reg, u8 val);
-   int (*write_r8d16) (void *client, u8 reg, u16 val);
+   int (*read_d8)(void *client);
+   int (*read_r8d8)(void *client, u8 reg);
+   int (*read_r8d16)(void *client, u8 reg);
+   int (*write_d8)(void *client, u8 val);
+   int (*write_r8d8)(void *client, u8 reg, u8 val);
+   int (*write_r8d16)(void *client, u8 reg, u16 val);
 };
 
 struct ad_dpot_bus_data {
-- 
2.11.0



[PATCH 3/3] misc: ad525x_dpot: macros should not use a trailing semicolon

2017-12-08 Thread Dhaval Shah
Resolved all the macros should not use a trailing semicolon
checkpatch warnings. Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/misc/ad525x_dpot.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index 577f5e76c8a8..bc591b7168db 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -515,11 +515,11 @@ set_##_name(struct device *dev, \
 #define DPOT_DEVICE_SHOW_SET(name, reg) \
 DPOT_DEVICE_SHOW(name, reg) \
 DPOT_DEVICE_SET(name, reg) \
-static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, set_##name);
+static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, set_##name)
 
 #define DPOT_DEVICE_SHOW_ONLY(name, reg) \
 DPOT_DEVICE_SHOW(name, reg) \
-static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, NULL);
+static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, NULL)
 
 DPOT_DEVICE_SHOW_SET(rdac0, DPOT_ADDR_RDAC | DPOT_RDAC0);
 DPOT_DEVICE_SHOW_SET(eeprom0, DPOT_ADDR_EEPROM | DPOT_RDAC0);
@@ -616,7 +616,7 @@ set_##_name(struct device *dev, \
 { \
return sysfs_do_cmd(dev, attr, buf, count, _cmd); \
 } \
-static DEVICE_ATTR(_name, S_IWUSR | S_IRUGO, NULL, set_##_name);
+static DEVICE_ATTR(_name, S_IWUSR | S_IRUGO, NULL, set_##_name)
 
 DPOT_DEVICE_DO_CMD(inc_all, DPOT_INC_ALL);
 DPOT_DEVICE_DO_CMD(dec_all, DPOT_DEC_ALL);
-- 
2.11.0



[PATCH 1/3] misc: ad525x_dpot: Prefer 'unsigned int' to bare use of 'unsigned'

2017-12-08 Thread Dhaval Shah
Resolved all the Prefer 'unsigned int' to bare use of 'unsigned'
checkpatch warnings. Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/misc/ad525x_dpot.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index fe1672747bc1..1c6b55655f52 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -84,12 +84,12 @@
 struct dpot_data {
struct ad_dpot_bus_data bdata;
struct mutex update_lock;
-   unsigned rdac_mask;
-   unsigned max_pos;
+   unsigned int rdac_mask;
+   unsigned int max_pos;
unsigned long devid;
-   unsigned uid;
-   unsigned feat;
-   unsigned wipers;
+   unsigned int uid;
+   unsigned int feat;
+   unsigned int wipers;
u16 rdac_cache[MAX_RDACS];
DECLARE_BITMAP(otp_en_mask, MAX_RDACS);
 };
@@ -126,7 +126,7 @@ static inline int dpot_write_r8d16(struct dpot_data *dpot, 
u8 reg, u16 val)
 
 static s32 dpot_read_spi(struct dpot_data *dpot, u8 reg)
 {
-   unsigned ctrl = 0;
+   unsigned int ctrl = 0;
int value;
 
if (!(reg & (DPOT_ADDR_EEPROM | DPOT_ADDR_CMD))) {
@@ -175,7 +175,7 @@ static s32 dpot_read_spi(struct dpot_data *dpot, u8 reg)
 static s32 dpot_read_i2c(struct dpot_data *dpot, u8 reg)
 {
int value;
-   unsigned ctrl = 0;
+   unsigned int ctrl = 0;
 
switch (dpot->uid) {
case DPOT_UID(AD5246_ID):
@@ -238,7 +238,7 @@ static s32 dpot_read(struct dpot_data *dpot, u8 reg)
 
 static s32 dpot_write_spi(struct dpot_data *dpot, u8 reg, u16 value)
 {
-   unsigned val = 0;
+   unsigned int val = 0;
 
if (!(reg & (DPOT_ADDR_EEPROM | DPOT_ADDR_CMD | DPOT_ADDR_OTP))) {
if (dpot->feat & F_RDACS_WONLY)
@@ -328,7 +328,7 @@ static s32 dpot_write_spi(struct dpot_data *dpot, u8 reg, 
u16 value)
 static s32 dpot_write_i2c(struct dpot_data *dpot, u8 reg, u16 value)
 {
/* Only write the instruction byte for certain commands */
-   unsigned tmp = 0, ctrl = 0;
+   unsigned int tmp = 0, ctrl = 0;
 
switch (dpot->uid) {
case DPOT_UID(AD5246_ID):
@@ -636,7 +636,7 @@ static const struct attribute_group ad525x_group_commands = 
{
 };
 
 static int ad_dpot_add_files(struct device *dev,
-   unsigned features, unsigned rdac)
+   unsigned int features, unsigned int rdac)
 {
int err = sysfs_create_file(&dev->kobj,
dpot_attrib_wipers[rdac]);
@@ -661,7 +661,7 @@ static int ad_dpot_add_files(struct device *dev,
 }
 
 static inline void ad_dpot_remove_files(struct device *dev,
-   unsigned features, unsigned rdac)
+   unsigned int features, unsigned int rdac)
 {
sysfs_remove_file(&dev->kobj,
dpot_attrib_wipers[rdac]);
-- 
2.11.0



[PATCH 0/3] misc: ad525x_dpot: Different type of warnings are resolved.

2017-12-08 Thread Dhaval Shah
Three types of checkpatch warning are resolved.
 * First patch  : Prefer 'unsigned int' to bare use of 'unsigned'
 * Second patch : please, no space before tabs
 * third patch  : macros should not use a trailing semicolon

Issue found by checkpatch.
./scripts/checkpatch.pl -f --strict drivers/misc/ad525x_dpot.c 

Dhaval Shah (3):
  misc: ad525x_dpot: Prefer 'unsigned int' to bare use of 'unsigned'
  misc: ad525x_dpot: please, no space before tabs
  misc: ad525x_dpot: macros should not use a trailing semicolon

 drivers/misc/ad525x_dpot.c | 30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

-- 
2.11.0



[PATCH 2/3] misc: ad525x_dpot: please, no space before tabs

2017-12-08 Thread Dhaval Shah
Resolved the please, no space beofore tabs checkpatch
warning. Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/misc/ad525x_dpot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index 1c6b55655f52..577f5e76c8a8 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -3,7 +3,7 @@
  * Copyright (c) 2009-2010 Analog Devices, Inc.
  * Author: Michael Hennerich 
  *
- * DEVID   #Wipers #Positions  Resistor Options (kOhm)
+ * DEVID   #Wipers #Positions  Resistor Options (kOhm)
  * AD5258  1   64  1, 10, 50, 100
  * AD5259  1   256 5, 10, 50, 100
  * AD5251  2   64  1, 10, 50, 100
-- 
2.11.0



[PATCH] clkc: zynq: Missing a blank line after declarations.

2017-12-08 Thread Dhaval Shah
Resolved missing a blank line after declarations checkpatch
warnings. Issue found by checkpatch.

Signed-off-by: Dhaval Shah 
---
 drivers/clk/zynq/clkc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/zynq/clkc.c b/drivers/clk/zynq/clkc.c
index 88a2cab37f62..1cd4705e405e 100644
--- a/drivers/clk/zynq/clkc.c
+++ b/drivers/clk/zynq/clkc.c
@@ -363,6 +363,7 @@ static void __init zynq_clk_setup(struct device_node *np)
/* Peripheral clocks */
for (i = fclk0; i <= fclk3; i++) {
int enable = !!(fclk_enable & BIT(i - fclk0));
+
zynq_clk_register_fclk(i, clk_output_name[i],
SLCR_FPGA0_CLK_CTRL + 0x10 * (i - fclk0),
periph_parents, enable);
-- 
2.11.0



[PATCH] media: v4l: xilinx: Use SPDX-License-Identifier

2017-12-08 Thread Dhaval Shah
SPDX-License-Identifier is used for the Xilinx Video IP and
related drivers.

Signed-off-by: Dhaval Shah 
---
 drivers/media/platform/xilinx/xilinx-dma.c  | 5 +
 drivers/media/platform/xilinx/xilinx-dma.h  | 5 +
 drivers/media/platform/xilinx/xilinx-tpg.c  | 5 +
 drivers/media/platform/xilinx/xilinx-vip.c  | 5 +
 drivers/media/platform/xilinx/xilinx-vip.h  | 5 +
 drivers/media/platform/xilinx/xilinx-vipp.c | 5 +
 drivers/media/platform/xilinx/xilinx-vipp.h | 5 +
 drivers/media/platform/xilinx/xilinx-vtc.c  | 5 +
 drivers/media/platform/xilinx/xilinx-vtc.h  | 5 +
 9 files changed, 9 insertions(+), 36 deletions(-)

diff --git a/drivers/media/platform/xilinx/xilinx-dma.c 
b/drivers/media/platform/xilinx/xilinx-dma.c
index 522cdfdd3345..2e5daf7dba1a 100644
--- a/drivers/media/platform/xilinx/xilinx-dma.c
+++ b/drivers/media/platform/xilinx/xilinx-dma.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Xilinx Video DMA
  *
@@ -6,10 +7,6 @@
  *
  * Contacts: Hyun Kwon 
  *   Laurent Pinchart 
- *
- * 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.
  */
 
 #include 
diff --git a/drivers/media/platform/xilinx/xilinx-dma.h 
b/drivers/media/platform/xilinx/xilinx-dma.h
index e95d136c153a..5aec4d17eb21 100644
--- a/drivers/media/platform/xilinx/xilinx-dma.h
+++ b/drivers/media/platform/xilinx/xilinx-dma.h
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Xilinx Video DMA
  *
@@ -6,10 +7,6 @@
  *
  * Contacts: Hyun Kwon 
  *   Laurent Pinchart 
- *
- * 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.
  */
 
 #ifndef __XILINX_VIP_DMA_H__
diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c 
b/drivers/media/platform/xilinx/xilinx-tpg.c
index 9c49d1d10bee..20a68a65602b 100644
--- a/drivers/media/platform/xilinx/xilinx-tpg.c
+++ b/drivers/media/platform/xilinx/xilinx-tpg.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Xilinx Test Pattern Generator
  *
@@ -6,10 +7,6 @@
  *
  * Contacts: Hyun Kwon 
  *   Laurent Pinchart 
- *
- * 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.
  */
 
 #include 
diff --git a/drivers/media/platform/xilinx/xilinx-vip.c 
b/drivers/media/platform/xilinx/xilinx-vip.c
index 311259129504..5f7efa9f093e 100644
--- a/drivers/media/platform/xilinx/xilinx-vip.c
+++ b/drivers/media/platform/xilinx/xilinx-vip.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Xilinx Video IP Core
  *
@@ -6,10 +7,6 @@
  *
  * Contacts: Hyun Kwon 
  *   Laurent Pinchart 
- *
- * 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.
  */
 
 #include 
diff --git a/drivers/media/platform/xilinx/xilinx-vip.h 
b/drivers/media/platform/xilinx/xilinx-vip.h
index 42fee2026815..ba939dd52818 100644
--- a/drivers/media/platform/xilinx/xilinx-vip.h
+++ b/drivers/media/platform/xilinx/xilinx-vip.h
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Xilinx Video IP Core
  *
@@ -6,10 +7,6 @@
  *
  * Contacts: Hyun Kwon 
  *   Laurent Pinchart 
- *
- * 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.
  */
 
 #ifndef __XILINX_VIP_H__
diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c 
b/drivers/media/platform/xilinx/xilinx-vipp.c
index d881cf09876d..cb9ab2c15952 100644
--- a/drivers/media/platform/xilinx/xilinx-vipp.c
+++ b/drivers/media/platform/xilinx/xilinx-vipp.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Xilinx Video IP Composite Device
  *
@@ -6,10 +7,6 @@
  *
  * Contacts: Hyun Kwon 
  *   Laurent Pinchart 
- *
- * 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.
  */
 
 #include 
diff --git a/drivers/media/platform/xilinx/xilinx-vipp.h 
b/drivers/media/platform/xilinx/xilinx-vipp.h
index faf6b6e80b3b..39daa030679e 100644
--- a/drivers/media/platform/xilinx/xilinx-vipp.h
+++ b/drivers/media/platform/xilinx/xilinx-vipp.h
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Xilinx Video IP Composite Device
  *
@@ -6,10 +7,6 @@
  *
  * Contacts: Hyun Kwon 
  *   Laurent Pinchart 
- *
- * 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