[PATCH] staging: ft1000: Fix code style issue

2015-01-06 Thread Arjun AK
Remove unnecessary braces from single statement blocks.

Signed-off-by: Arjun AK 
---
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 101 ---
 1 file changed, 35 insertions(+), 66 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c 
b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
index e9a37ee..809e32c 100644
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
@@ -172,11 +172,10 @@ u16 ft1000_read_dpram_mag_16(struct net_device *dev, int 
offset, int Index)
spin_lock_irqsave(&info->dpram_lock, flags);
ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, offset);
/* check if we want to read upper or lower 32-bit word */
-   if (Index) {
+   if (Index)
data = ft1000_read_reg(dev, FT1000_REG_MAG_DPDATAL);
-   } else {
+   else
data = ft1000_read_reg(dev, FT1000_REG_MAG_DPDATAH);
-   }
spin_unlock_irqrestore(&info->dpram_lock, flags);
 
return data;
@@ -204,11 +203,10 @@ static inline void ft1000_write_dpram_mag_16(struct 
net_device *dev,
/* Provide mutual exclusive access while reading ASIC registers. */
spin_lock_irqsave(&info->dpram_lock, flags);
ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, offset);
-   if (Index) {
+   if (Index)
ft1000_write_reg(dev, FT1000_REG_MAG_DPDATAL, value);
-   } else {
+   else
ft1000_write_reg(dev, FT1000_REG_MAG_DPDATAH, value);
-   }
spin_unlock_irqrestore(&info->dpram_lock, flags);
 }
 
@@ -440,9 +438,8 @@ static int ft1000_reset_card(struct net_device *dev)
tempword =
ft1000_read_dpram_mag_16(dev, 
FT1000_MAG_DPRAM_FEFE,
 
FT1000_MAG_DPRAM_FEFE_INDX);
-   if (tempword == 0xfefe) {
+   if (tempword == 0xfefe)
break;
-   }
mdelay(20);
}
 
@@ -570,12 +567,10 @@ static void ft1000_hbchk(u_long data)
pr_debug("hi_ho value = 0x%x\n", tempword);
/* Let's perform another check if ho is not detected */
if (tempword != ho) {
-   if (info->AsicID == ELECTRABUZZ_ID) {
+   if (info->AsicID == ELECTRABUZZ_ID)
tempword = ft1000_read_dpram(dev, FT1000_HI_HO);
-   }
-   else {
+   else
tempword = ntohs(ft1000_read_dpram_mag_16(dev, 
FT1000_MAG_HI_HO, FT1000_MAG_HI_HO_INDX));
-   }
}
if (tempword != ho) {
pr_info("heartbeat failed - no ho detected\n");
@@ -621,9 +616,8 @@ static void ft1000_hbchk(u_long data)
 
tempword = ft1000_read_reg(dev, FT1000_REG_DOORBELL);
/* Let's check doorbell again if fail */
-   if (tempword & FT1000_DB_HB) {
+   if (tempword & FT1000_DB_HB)
tempword = ft1000_read_reg(dev, FT1000_REG_DOORBELL);
-   }
if (tempword & FT1000_DB_HB) {
pr_info("heartbeat doorbell not clear by firmware\n");
if (info->AsicID == ELECTRABUZZ_ID) {
@@ -686,19 +680,15 @@ static void ft1000_hbchk(u_long data)
}
/* Let's write hi again if fail */
if (tempword != hi) {
-   if (info->AsicID == ELECTRABUZZ_ID) {
+   if (info->AsicID == ELECTRABUZZ_ID)
ft1000_write_dpram(dev, FT1000_HI_HO, hi);
-   }
-   else {
+   else
ft1000_write_dpram_mag_16(dev, 
FT1000_MAG_HI_HO, hi_mag, FT1000_MAG_HI_HO_INDX);
-   }
 
-   if (info->AsicID == ELECTRABUZZ_ID) {
+   if (info->AsicID == ELECTRABUZZ_ID)
tempword = ft1000_read_dpram(dev, FT1000_HI_HO);
-   }
-   else {
+   else
tempword = ntohs(ft1000_read_dpram_mag_16(dev, 
FT1000_MAG_HI_HO, FT1000_MAG_HI_HO_INDX));
-   }
 
}
 
@@ -770,9 +760,8 @@ static void ft1000_send_cmd(struct net_device *dev, u16 
*ptempbuffer, int size,
 
size += sizeof(struct pseudo_hdr);
/* check for odd byte and increment to 16-bit word align value */
-   if ((size & 0x0001)) {
+   if ((size & 0x0001))
size++;
-   }
pr_debug("total length = %d\n", size);
pr_debug("length = %d\n", ntohs(*ptempbuffer));
/*
@@ -915,9 +904,8 @@ static bool ft1000_rece

Re: [PATCH v18 0/12] dw-hdmi: convert imx hdmi to bridge/dw_hdmi

2015-01-06 Thread Andy Yan

Hi Liu Ying , Philipp:

On 2015年01月07日 10:39, Liu Ying wrote:


On 12/05/2014 02:22 PM, Andy Yan wrote:


We found Freescale imx6 and Rockchip rk3288 and Ingenic JZ4780 
(Xburst/MIPS)

use the interface compatible Designware HDMI IP, but they also have some
lightly differences, such as phy pll configuration, register 
width(imx hdmi
register is one byte, but rk3288 is 4 bytes width and can only be 
accessed
by word), 4K support(imx6 doesn't support 4k, but rk3288 does), and 
HDMI2.0

support.

To reuse the imx-hdmi driver, we make this patch set:
(1): fix some CodingStyle warning to make checkpatch happy
(2): convert imx-hdmi to drm_bridge
(3): split platform specific code
(4): move imx-hdmi to bridge/dw_hdmi
(5): extend dw_hdmi.c to support rk3288 hdmi
(6): add rockchip rk3288 platform specific code dw_hdmi-rockchip.c

Changes in v18:
- remove a multiple blank lines in imx-hdmi.c
- fix a checkpatch warning in imx-hdmi_pltfm.c
- add port bindings
- correct some spelling mistakes in dw_hdmi bindings doc
- correct some spelling mistakes in dw_hdmi-rockchip bindings doc

Changes in v17:
- remove platform device stuff, adviced by Russell King
- remove prompt message of dw_hdmi, adviced by Russel King
- parse resource and irq in platform driver

Changes in v16:
- use the common binding for the clocks
- describe ddc-i2c-bus as optional
- add common clocks bindings
- modify clocks bindings
- descrbie ddc-i2c-bus as optional

Changes in v15:
- add prefix dw_hdmi/DW_HDMI for public used dw_hdmi structs
   adviced by Philipp Zabel
- remove THIS_MODULE in platform driver
- remove unio of the multi-byte register access, adviced by Philipp 
Zabel

- remove THIS_MODULE in platform driver

Changes in v14:
- add defer probing, adviced by Philipp Zabel
- remove drm_connector_register, because imx-drm core has registered
connector

Changes in v13:
- patch against drm-next
- split platform specific phy configuration
- split phy configuration from patch#4

Changes in v12:
- refactor of_node_put(ddc_node)
- squash patch 
- add comment for the depend on patch

Changes in v11:
- squash patch  

Changes in v10:
- split generic dw_hdmi.c improvements from patch#11 (add rk3288 
support)

- add more display mode support mpll configuration for rk3288

Changes in v9:
- move some phy configuration to platform driver

Changes in v8:
- correct some spelling mistake
- modify ddc-i2c-bus and interrupt description
- Add documentation for rockchip dw hdmi

Changes in v7:
- remove unused variables from structure dw_hdmi
- remove a wrong modification
- add copyrights for dw_hdmi-imx.c

Changes in v6:
- rearrange the patch order
- refactor register access without reg_shift

Changes in v5:
- refactor reg-io-width

Changes in v4:
- fix checkpatch CHECK
- defer probe ddc i2c adapter

Changes in v3:
- split multi-register access to one indepent patch

Andy Yan (12):
   drm: imx: imx-hdmi: make checkpatch happy
   drm: imx: imx-hdmi: return defer if can't get ddc i2c adapter
   drm: imx: imx-hdmi: convert imx-hdmi to drm_bridge mode
   drm: imx: imx-hdmi: split phy configuration to platform driver
   drm: imx: imx-hdmi: move imx-hdmi to bridge/dw_hdmi
   dt-bindings: add document for dw_hdmi
   drm: bridge/dw_hdmi: add support for multi-byte register width access
   drm: bridge/dw_hdmi: add mode_valid support
   drm: bridge/dw_hdmi: clear i2cmphy_stat0 reg in 
hdmi_phy_wait_i2c_done

   drm: bridge/dw_hdmi: add function dw_hdmi_phy_enable_spare
   dt-bindings: Add documentation for rockchip dw hdmi
   drm: bridge/dw_hdmi: add rockchip rk3288 support

  .../devicetree/bindings/drm/bridge/dw_hdmi.txt |  50 ++
  .../devicetree/bindings/video/dw_hdmi-rockchip.txt |  46 ++
  drivers/gpu/drm/bridge/Kconfig |   5 +
  drivers/gpu/drm/bridge/Makefile|   1 +
  .../gpu/drm/{imx/imx-hdmi.c => bridge/dw_hdmi.c}   | 717 
++---

  .../gpu/drm/{imx/imx-hdmi.h => bridge/dw_hdmi.h}   |   4 +-
  drivers/gpu/drm/imx/Kconfig|   1 +
  drivers/gpu/drm/imx/Makefile   |   2 +-
  drivers/gpu/drm/imx/dw_hdmi-imx.c  | 258 
  drivers/gpu/drm/rockchip/Kconfig   |  10 +
  drivers/gpu/drm/rockchip/Makefile  |   2 +
  drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c| 341 ++
  include/drm/bridge/dw_hdmi.h   |  61 ++
  13 files changed,  insertions(+), 387 deletions(-)
  create mode 100644 
Documentation/devicetree/bindings/drm/bridge/dw_hdmi.txt
  create mode 100644 
Documentation/devicetree/bindings/video/dw_hdmi-rockchip.txt

  rename drivers/gpu/drm/{imx/imx-hdmi.c => bridge/dw_hdmi.c} (72%)
  rename drivers/gpu/drm/{imx/imx-hdmi.h => bridge/dw_hdmi.h} (99%)
  create mode 100644 drivers/gpu/drm/imx/dw_hdmi-imx.c
  create mode 100644 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
  create mode 100644 include/drm/bridge/dw_hdmi.h



After applying this series, I find there is a build break is

Re: [PATCH v18 0/12] dw-hdmi: convert imx hdmi to bridge/dw_hdmi

2015-01-06 Thread Liu Ying


On 12/05/2014 02:22 PM, Andy Yan wrote:


We found Freescale imx6 and Rockchip rk3288 and Ingenic JZ4780 (Xburst/MIPS)
use the interface compatible Designware HDMI IP, but they also have some
lightly differences, such as phy pll configuration, register width(imx hdmi
register is one byte, but rk3288 is 4 bytes width and can only be accessed
by word), 4K support(imx6 doesn't support 4k, but rk3288 does), and HDMI2.0
support.

To reuse the imx-hdmi driver, we make this patch set:
(1): fix some CodingStyle warning to make checkpatch happy
(2): convert imx-hdmi to drm_bridge
(3): split platform specific code
(4): move imx-hdmi to bridge/dw_hdmi
(5): extend dw_hdmi.c to support rk3288 hdmi
(6): add rockchip rk3288 platform specific code dw_hdmi-rockchip.c

Changes in v18:
- remove a multiple blank lines in imx-hdmi.c
- fix a checkpatch warning in imx-hdmi_pltfm.c
- add port bindings
- correct some spelling mistakes in dw_hdmi bindings doc
- correct some spelling mistakes in dw_hdmi-rockchip bindings doc

Changes in v17:
- remove platform device stuff, adviced by Russell King
- remove prompt message of dw_hdmi, adviced by Russel King
- parse resource and irq in platform driver

Changes in v16:
- use the common binding for the clocks
- describe ddc-i2c-bus as optional
- add common clocks bindings
- modify clocks bindings
- descrbie ddc-i2c-bus as optional

Changes in v15:
- add prefix dw_hdmi/DW_HDMI for public used dw_hdmi structs
   adviced by Philipp Zabel
- remove THIS_MODULE in platform driver
- remove unio of the multi-byte register access, adviced by Philipp Zabel
- remove THIS_MODULE in platform driver

Changes in v14:
- add defer probing, adviced by Philipp Zabel
- remove drm_connector_register, because imx-drm core has registered
connector

Changes in v13:
- patch against drm-next
- split platform specific phy configuration
- split phy configuration from patch#4

Changes in v12:
- refactor of_node_put(ddc_node)
- squash patch 
- add comment for the depend on patch

Changes in v11:
- squash patch  

Changes in v10:
- split generic dw_hdmi.c improvements from patch#11 (add rk3288 support)
- add more display mode support mpll configuration for rk3288

Changes in v9:
- move some phy configuration to platform driver

Changes in v8:
- correct some spelling mistake
- modify ddc-i2c-bus and interrupt description
- Add documentation for rockchip dw hdmi

Changes in v7:
- remove unused variables from structure dw_hdmi
- remove a wrong modification
- add copyrights for dw_hdmi-imx.c

Changes in v6:
- rearrange the patch order
- refactor register access without reg_shift

Changes in v5:
- refactor reg-io-width

Changes in v4:
- fix checkpatch CHECK
- defer probe ddc i2c adapter

Changes in v3:
- split multi-register access to one indepent patch

Andy Yan (12):
   drm: imx: imx-hdmi: make checkpatch happy
   drm: imx: imx-hdmi: return defer if can't get ddc i2c adapter
   drm: imx: imx-hdmi: convert imx-hdmi to drm_bridge mode
   drm: imx: imx-hdmi: split phy configuration to platform driver
   drm: imx: imx-hdmi: move imx-hdmi to bridge/dw_hdmi
   dt-bindings: add document for dw_hdmi
   drm: bridge/dw_hdmi: add support for multi-byte register width access
   drm: bridge/dw_hdmi: add mode_valid support
   drm: bridge/dw_hdmi: clear i2cmphy_stat0 reg in hdmi_phy_wait_i2c_done
   drm: bridge/dw_hdmi: add function dw_hdmi_phy_enable_spare
   dt-bindings: Add documentation for rockchip dw hdmi
   drm: bridge/dw_hdmi: add rockchip rk3288 support

  .../devicetree/bindings/drm/bridge/dw_hdmi.txt |  50 ++
  .../devicetree/bindings/video/dw_hdmi-rockchip.txt |  46 ++
  drivers/gpu/drm/bridge/Kconfig |   5 +
  drivers/gpu/drm/bridge/Makefile|   1 +
  .../gpu/drm/{imx/imx-hdmi.c => bridge/dw_hdmi.c}   | 717 ++---
  .../gpu/drm/{imx/imx-hdmi.h => bridge/dw_hdmi.h}   |   4 +-
  drivers/gpu/drm/imx/Kconfig|   1 +
  drivers/gpu/drm/imx/Makefile   |   2 +-
  drivers/gpu/drm/imx/dw_hdmi-imx.c  | 258 
  drivers/gpu/drm/rockchip/Kconfig   |  10 +
  drivers/gpu/drm/rockchip/Makefile  |   2 +
  drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c| 341 ++
  include/drm/bridge/dw_hdmi.h   |  61 ++
  13 files changed,  insertions(+), 387 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/drm/bridge/dw_hdmi.txt
  create mode 100644 
Documentation/devicetree/bindings/video/dw_hdmi-rockchip.txt
  rename drivers/gpu/drm/{imx/imx-hdmi.c => bridge/dw_hdmi.c} (72%)
  rename drivers/gpu/drm/{imx/imx-hdmi.h => bridge/dw_hdmi.h} (99%)
  create mode 100644 drivers/gpu/drm/imx/dw_hdmi-imx.c
  create mode 100644 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
  create mode 100644 include/drm/bridge/dw_hdmi.h



After applying this series, I find there is a build break issue with the
allmodconfig configuration for the ARM architecture.
Please fix th

lustre/lnet/lnet/lib-move.c: memcpy with (struct iovec*)->iov_base, which is __user

2015-01-06 Thread Andrey Utkin
Dear maintainers of LustreFS and other experienced kernel developers!

I am working on fixing some sparse warnings as a task of Eudyptula Challenge.
There's a thing that look suspiciously to me (or I just don't
understand it). This looks same both in upstream kernel code in
drivers/staging/ and in https://github.com/Xyratex/lustre-stable.git
(it doesn't fetch from http://git.whamcloud.com/fs/lustre-release.git,
but I guess it is similar with Xyratex repo).

In lnet/lnet/lib-move.c, in lnet_copy_iov2iov(), at line 209, there is

memcpy((char *)diov->iov_base + doffset,
(char *)siov->iov_base + soffset, this_nob);

diov and siov are struct iovec *, and iov_base in it is void __user *.
Are diov and siov really used semantically correctly here, holding
userspace addresses in iov_base?
Is it semantically correct to use memcpy to copy bytes from one
userspace address to another?

How to treat the comment "/* NB diov, siov are READ-ONLY */" at line
177 in the same procedure? Is it adequate?

This above-mentioned memcpy operation causes sparse warnings "warning:
cast removes address space of expression" for both first and second
line. When i change it to

memcpy((void __user *)((char __user *)diov->iov_base + doffset),
(void __user *)((char __user *)siov->iov_base
+ soffset), this_nob);

It gives other sparse warnings:
drivers/staging/lustre/lnet/lnet/lib-move.c:208:25: warning: incorrect
type in argument 1 (different address spaces)
drivers/staging/lustre/lnet/lnet/lib-move.c:208:25:expected void *to
drivers/staging/lustre/lnet/lnet/lib-move.c:208:25:got void
[noderef] *
drivers/staging/lustre/lnet/lnet/lib-move.c:209:26: warning: incorrect
type in argument 2 (different address spaces)
drivers/staging/lustre/lnet/lnet/lib-move.c:209:26:expected void const *from
drivers/staging/lustre/lnet/lnet/lib-move.c:209:26:got void
[noderef] *

What is supposed way to avoid warnings in this case?

Thanks.

-- 
Andrey Utkin
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v8 1/4] doc: add bindings document for altera fpga manager

2015-01-06 Thread atull
On Tue, 6 Jan 2015, Rob Herring wrote:

> On Tue, Jan 6, 2015 at 2:13 PM,   wrote:
> > From: Alan Tull 
> >
> > New bindings document for Altera fpga manager.
> >
> > Signed-off-by: Alan Tull 
> 
> Acked-by: Rob Herring 
> 
> Like I said, this binding doesn't look like it will change other than
> perhaps additional optional properties, so it can go into
> Documentation. Perhaps .../bindings/fpga/. I'm happy to merge this
> thru DT tree if you want.
> 
> Rob

Thanks, that would be great.  Yes ../bindings/fpga sounds good.

Do you want me to send you a patch with the updated path?

Alan

> 
> > ---
> > v5 : Move bindings to drivers/staging/fpga/Documentation/bindings
> >
> > v6 : No change in this patch for v6 of the patch set
> >
> > v7 : No change in this patch for v7 of the patch set
> >
> > v8 : Make compatible string and name of bindings doc more chip
> >  specific
> > ---
> >  .../bindings/altera-socfpga-fpga-mgr.txt   |   17 +
> >  1 file changed, 17 insertions(+)
> >  create mode 100644 
> > drivers/staging/fpga/Documentation/bindings/altera-socfpga-fpga-mgr.txt
> >
> > diff --git 
> > a/drivers/staging/fpga/Documentation/bindings/altera-socfpga-fpga-mgr.txt 
> > b/drivers/staging/fpga/Documentation/bindings/altera-socfpga-fpga-mgr.txt
> > new file mode 100644
> > index 000..9b027a6
> > --- /dev/null
> > +++ 
> > b/drivers/staging/fpga/Documentation/bindings/altera-socfpga-fpga-mgr.txt
> > @@ -0,0 +1,17 @@
> > +Altera SOCFPGA FPGA Manager
> > +
> > +Required properties:
> > +- compatible : should contain "altr,socfpga-fpga-mgr"
> > +- reg: base address and size for memory mapped io.
> > +   - The first index is for FPGA manager register access.
> > +   - The second index is for writing FPGA configuration data.
> > +- interrupts : interrupt for the FPGA Manager device.
> > +
> > +Example:
> > +
> > +   hps_0_fpgamgr: fpgamgr@0xff706000 {
> > +   compatible = "altr,socfpga-fpga-mgr";
> > +   reg = <0xFF706000 0x1000
> > +  0xFFB9 0x1000>;
> > +   interrupts = <0 175 4>;
> > +   };
> > --
> > 1.7.9.5
> >
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v8 1/4] doc: add bindings document for altera fpga manager

2015-01-06 Thread Rob Herring
On Tue, Jan 6, 2015 at 2:13 PM,   wrote:
> From: Alan Tull 
>
> New bindings document for Altera fpga manager.
>
> Signed-off-by: Alan Tull 

Acked-by: Rob Herring 

Like I said, this binding doesn't look like it will change other than
perhaps additional optional properties, so it can go into
Documentation. Perhaps .../bindings/fpga/. I'm happy to merge this
thru DT tree if you want.

Rob

> ---
> v5 : Move bindings to drivers/staging/fpga/Documentation/bindings
>
> v6 : No change in this patch for v6 of the patch set
>
> v7 : No change in this patch for v7 of the patch set
>
> v8 : Make compatible string and name of bindings doc more chip
>  specific
> ---
>  .../bindings/altera-socfpga-fpga-mgr.txt   |   17 +
>  1 file changed, 17 insertions(+)
>  create mode 100644 
> drivers/staging/fpga/Documentation/bindings/altera-socfpga-fpga-mgr.txt
>
> diff --git 
> a/drivers/staging/fpga/Documentation/bindings/altera-socfpga-fpga-mgr.txt 
> b/drivers/staging/fpga/Documentation/bindings/altera-socfpga-fpga-mgr.txt
> new file mode 100644
> index 000..9b027a6
> --- /dev/null
> +++ b/drivers/staging/fpga/Documentation/bindings/altera-socfpga-fpga-mgr.txt
> @@ -0,0 +1,17 @@
> +Altera SOCFPGA FPGA Manager
> +
> +Required properties:
> +- compatible : should contain "altr,socfpga-fpga-mgr"
> +- reg: base address and size for memory mapped io.
> +   - The first index is for FPGA manager register access.
> +   - The second index is for writing FPGA configuration data.
> +- interrupts : interrupt for the FPGA Manager device.
> +
> +Example:
> +
> +   hps_0_fpgamgr: fpgamgr@0xff706000 {
> +   compatible = "altr,socfpga-fpga-mgr";
> +   reg = <0xFF706000 0x1000
> +  0xFFB9 0x1000>;
> +   interrupts = <0 175 4>;
> +   };
> --
> 1.7.9.5
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v8 3/4] staging: fpga manager: framework core

2015-01-06 Thread atull
From: Alan Tull 

Supports standard ops for low level FPGA drivers.
Various manufacturors' FPGAs can be supported by adding low
level drivers.  Each driver needs to register its ops
using fpga_mgr_register().

Exports methods of doing operations to program  FPGAs. These
should be sufficient for individual drivers to request FPGA
programming directly if desired.

Adds a sysfs interface.  The sysfs interface can be compiled out
where desired in production builds.

Resume is supported by calling low level driver's resume
function, then reloading the firmware image.

The following are exported as GPL:
* fpga_mgr_reset
   Reset the FGPA.

* fpga_mgr_write
   Write a image (in buffer) to the FPGA.

* fpga_mgr_firmware_write
   Request firmware by file name and write it to the FPGA.

* fpga_mgr_name
   Get name of FPGA manager.

* fpga_mgr_state
   Get a state of framework as a string.

* fpga_mgr_register and fpga_mgr_remove
   Register/unregister low level fpga manager driver.

The following sysfs files are created:
* /sys/class/fpga_manager//name
  Name of low level driver.

* /sys/class/fpga_manager//firmware
  Name of FPGA image file to load using firmware class.
  $ echo image.rbf > /sys/class/fpga_manager//firmware

  read: read back name of image file previous loaded
  $ cat /sys/class/fpga_manager//firmware

* /sys/class/fpga_manager//reset
  reset the FPGA
  $ echo 1 > /sys/class/fpga_manager//reset

* /sys/class/fpga_manager//state
  State of fpga framework state machine

Signed-off-by: Alan Tull 
Signed-off-by: Michal Simek 
---
v2: s/mangager/manager/
check for invalid request_nr
add fpga reset interface
rework the state code
remove FPGA_MGR_FAIL flag
add _ERR states to fpga manager states enum
low level state op now returns a state enum value
initialize framework state from driver state op
remove unused fpga read stuff
merge sysfs.c into fpga-mgr.c
move suspend/resume from bus.c to fpga-mgr.c

v3: Add struct device to fpga_manager (not as a pointer)
Add to_fpga_manager
Don't get irq in fpga-mgr.c (let low level driver do it)
remove from struct fpga_manager: nr, np, parent
get rid of fpga_mgr_get_new_minor()
simplify fpga_manager_register:
  reorder parameters
  use dev instead of pdev
get rid of code that used to make more sense when this
  was a char driver, don't alloc_chrdev_region
use a mutex instead of flags

v4: Move to drivers/staging

v5: Make some things be static
Kconfig: add 'if FPGA'
Makefile: s/fpga-mgr-core.o/fpga-mgr.o/
clean up includes
use enum fpga_mgr_states instead of int
static const char *state_str
use DEVICE_ATTR_RO/RW/WO and ATTRIBUTE_GROUPS
return -EINVAL instead of BUG_ON
move ida_simple_get after kzalloc
clean up fpga_mgr_remove
fpga-mgr.h: remove '#if IS_ENABLED(CONFIG_FPGA)'
add kernel-doc documentation
Move header to new include/linux/fpga folder
static const struct fpga_mgr_ops
dev_info msg simplified

v6: no statically allocated string for image_name
kernel doc fixes
changes regarding enabling SYSFS for fpga mgr
Makefile cleanup

v7: no change in this patch for v7 of the patchset

v8: no change in this patch for v8 of the patchset
---
 drivers/staging/Kconfig |2 +
 drivers/staging/Makefile|1 +
 drivers/staging/fpga/Kconfig|   24 ++
 drivers/staging/fpga/Makefile   |8 +
 drivers/staging/fpga/fpga-mgr.c |  551 +++
 include/linux/fpga/fpga-mgr.h   |  124 +
 6 files changed, 710 insertions(+)
 create mode 100644 drivers/staging/fpga/Kconfig
 create mode 100644 drivers/staging/fpga/Makefile
 create mode 100644 drivers/staging/fpga/fpga-mgr.c
 create mode 100644 include/linux/fpga/fpga-mgr.h

diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 815de37..6380ae2 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -106,4 +106,6 @@ source "drivers/staging/unisys/Kconfig"
 
 source "drivers/staging/clocking-wizard/Kconfig"
 
+source "drivers/staging/fpga/Kconfig"
+
 endif # STAGING
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 33c640b..7ea49c0 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -45,3 +45,4 @@ obj-$(CONFIG_GS_FPGABOOT) += gs_fpgaboot/
 obj-$(CONFIG_CRYPTO_SKEIN) += skein/
 obj-$(CONFIG_UNISYSSPAR)   += unisys/
 obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD)  += clocking-wizard/
+obj-$(CONFIG_FPGA) += fpga/
diff --git a/drivers/staging/fpga/Kconfig b/drivers/staging/fpga/Kconfig
new file mode 100644
index 000..89ebafc
--- /dev/null
+++ b/drivers/staging/fpga/Kconfig
@@ -0,0 +1,24 @@
+#
+# FPGA framework configuration
+#
+
+menu "FPGA devices"
+
+config FPGA
+   tristate "FPGA Framework"
+   help
+ Say Y here if you want support for configuring FPGAs from the
+ kernel.  The FPGA framework adds a FPGA manager class and FPGA
+

[PATCH v8 2/4] fpga manager: add sysfs interface document

2015-01-06 Thread atull
From: Alan Tull 

Add documentation under drivers/staging for new fpga manager's
sysfs interface.

Signed-off-by: Alan Tull 
---
v5  : (actually second version, but keeping version numbers
  aligned with rest of patch series)
  Move document to drivers/staging/fpga/Documentation/ABI

v6  : No change in this patch for v6 of the patch set

v7  : No change in this patch for v7 of the patch set

v8  : No change in this patch for v8 of the patch set
---
 .../Documentation/ABI/sysfs-class-fpga-manager |   38 
 1 file changed, 38 insertions(+)
 create mode 100644 
drivers/staging/fpga/Documentation/ABI/sysfs-class-fpga-manager

diff --git a/drivers/staging/fpga/Documentation/ABI/sysfs-class-fpga-manager 
b/drivers/staging/fpga/Documentation/ABI/sysfs-class-fpga-manager
new file mode 100644
index 000..eb600f2
--- /dev/null
+++ b/drivers/staging/fpga/Documentation/ABI/sysfs-class-fpga-manager
@@ -0,0 +1,38 @@
+What:  /sys/class/fpga_manager//name
+Date:  October 2014
+KernelVersion: 3.18
+Contact:   Alan Tull 
+Description:   Name of low level driver.
+
+What:  /sys/class/fpga_manager//firmware
+Date:  October 2014
+KernelVersion: 3.18
+Contact:   Alan Tull 
+Description:   Name of the FPGA image file to load using firmware class.
+
+What:  /sys/class/fpga_manager//reset
+Date:  October 2014
+KernelVersion: 3.18
+Contact:   Alan Tull 
+Description:   Write 1 to reset the FPGA
+
+What:  /sys/class/fpga_manager//state
+Date:  October 2014
+KernelVersion: 3.18
+Contact:   Alan Tull 
+Description:   Read state of fpga framework state machine as a string.
+   Valid states may vary by manufacturer; superset is:
+   * unknown   = can't determine state
+   * power_off = FPGA power is off
+   * power_up  = FPGA reports power is up
+   * reset = FPGA held in reset state
+   * firmware_request  = firmware class request in progress
+   * firmware_request_err  = firmware request failed
+   * write_init= FPGA being prepared for programming
+   * write_init_err= Error while preparing FPGA for
+ programming
+   * write = FPGA ready to receive image data
+   * write_err = Error while programming
+   * write_complete= Doing post programming steps
+   * write_complete_err= Error while doing post programming
+   * operating = FPGA is programmed and operating
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v8 4/4] staging: fpga manager: add driver for socfpga fpga manager

2015-01-06 Thread atull
From: Alan Tull 

Add driver to fpga manager framework to allow configuration
of FPGA in Altera SoCFPGA parts.

Signed-off-by: Alan Tull 
Acked-by: Michal Simek 
---
v2: fpga_manager struct now contains struct device
fpga_manager_register parameters now take device

v3: skip a version to align versions

v4: move to drivers/staging

v5: fix array_size.cocci warnings
fix platform_no_drv_owner.cocci warnings
Remove .owner = THIS_MODULE
include asm/irq.h
clean up list of includes
use altera_fpga_reset for ops
use enum fpga_mgr_states or u32 as needed
use devm_request_irq
check irq <= 0 instead of == NO_IRQ
Use ARRAY_SIZE
rename altera -> socfpga
static const socfpga_fpga_ops
header moved to linux/fpga/ folder
remove ifdef'ed code
use platform_get_resource and platform_get_irq
move .probe and .remove lines adjacent
use module_platform_driver
use __maybe_unused
only need to 'if (IS_ENABLED(CONFIG_REGULATOR))' in one fn
fix "unsigned 'mode' is never < 0"

v6: return error for (unused) default of case statement

v7: PTR_ERR should access the value just tested by IS_ERR

v8: change compatible string to be more chip specific
---
 drivers/staging/fpga/Kconfig   |5 +
 drivers/staging/fpga/Makefile  |1 +
 drivers/staging/fpga/socfpga.c |  694 
 3 files changed, 700 insertions(+)
 create mode 100644 drivers/staging/fpga/socfpga.c

diff --git a/drivers/staging/fpga/Kconfig b/drivers/staging/fpga/Kconfig
index 89ebafc..ce17342 100644
--- a/drivers/staging/fpga/Kconfig
+++ b/drivers/staging/fpga/Kconfig
@@ -19,6 +19,11 @@ config FPGA_MGR_SYSFS
help
  FPGA Manager SysFS interface.
 
+config FPGA_MGR_SOCFPGA
+   tristate "Altera SOCFPGA"
+   help
+ FPGA manager driver support for Altera SOCFPGA.
+
 endif # FPGA
 
 endmenu
diff --git a/drivers/staging/fpga/Makefile b/drivers/staging/fpga/Makefile
index 3313c52..ba6c5c5 100644
--- a/drivers/staging/fpga/Makefile
+++ b/drivers/staging/fpga/Makefile
@@ -6,3 +6,4 @@
 obj-$(CONFIG_FPGA) += fpga-mgr.o
 
 # FPGA Manager Drivers
+obj-$(CONFIG_FPGA_MGR_SOCFPGA) += socfpga.o
diff --git a/drivers/staging/fpga/socfpga.c b/drivers/staging/fpga/socfpga.c
new file mode 100644
index 000..56f75e0
--- /dev/null
+++ b/drivers/staging/fpga/socfpga.c
@@ -0,0 +1,694 @@
+/*
+ * FPGA Manager Driver for Altera SOCFPGA
+ *
+ *  Copyright (C) 2013-2014 Altera Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see .
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Register offsets */
+#define SOCFPGA_FPGMGR_STAT_OFST   0x0
+#define SOCFPGA_FPGMGR_CTL_OFST0x4
+#define SOCFPGA_FPGMGR_DCLKCNT_OFST0x8
+#define SOCFPGA_FPGMGR_DCLKSTAT_OFST   0xc
+#define SOCFPGA_FPGMGR_GPIO_INTEN_OFST 0x830
+#define SOCFPGA_FPGMGR_GPIO_INTMSK_OFST0x834
+#define SOCFPGA_FPGMGR_GPIO_INTTYPE_LEVEL_OFST 0x838
+#define SOCFPGA_FPGMGR_GPIO_INT_POL_OFST   0x83c
+#define SOCFPGA_FPGMGR_GPIO_INTSTAT_OFST   0x840
+#define SOCFPGA_FPGMGR_GPIO_RAW_INTSTAT_OFST   0x844
+#define SOCFPGA_FPGMGR_GPIO_PORTA_EOI_OFST 0x84c
+#define SOCFPGA_FPGMGR_GPIO_EXT_PORTA_OFST 0x850
+
+/* Register bit defines */
+/* SOCFPGA_FPGMGR_STAT register mode field values */
+#define SOCFPGA_FPGMGR_STAT_POWER_UP   0x0 /*ramping*/
+#define SOCFPGA_FPGMGR_STAT_RESET  0x1
+#define SOCFPGA_FPGMGR_STAT_CFG0x2
+#define SOCFPGA_FPGMGR_STAT_INIT   0x3
+#define SOCFPGA_FPGMGR_STAT_USER_MODE  0x4
+#define SOCFPGA_FPGMGR_STAT_UNKNOWN0x5
+#define SOCFPGA_FPGMGR_STAT_STATE_MASK 0x7
+/* This is a flag value that doesn't really happen in this register field */
+#define SOCFPGA_FPGMGR_STAT_POWER_OFF  0x0
+
+#define MSEL_PP16_FAST_NOAES_NODC  0x0
+#define MSEL_PP16_FAST_AES_NODC0x1
+#define MSEL_PP16_FAS

[PATCH v8 1/4] doc: add bindings document for altera fpga manager

2015-01-06 Thread atull
From: Alan Tull 

New bindings document for Altera fpga manager.

Signed-off-by: Alan Tull 
---
v5 : Move bindings to drivers/staging/fpga/Documentation/bindings

v6 : No change in this patch for v6 of the patch set

v7 : No change in this patch for v7 of the patch set

v8 : Make compatible string and name of bindings doc more chip
 specific
---
 .../bindings/altera-socfpga-fpga-mgr.txt   |   17 +
 1 file changed, 17 insertions(+)
 create mode 100644 
drivers/staging/fpga/Documentation/bindings/altera-socfpga-fpga-mgr.txt

diff --git 
a/drivers/staging/fpga/Documentation/bindings/altera-socfpga-fpga-mgr.txt 
b/drivers/staging/fpga/Documentation/bindings/altera-socfpga-fpga-mgr.txt
new file mode 100644
index 000..9b027a6
--- /dev/null
+++ b/drivers/staging/fpga/Documentation/bindings/altera-socfpga-fpga-mgr.txt
@@ -0,0 +1,17 @@
+Altera SOCFPGA FPGA Manager
+
+Required properties:
+- compatible : should contain "altr,socfpga-fpga-mgr"
+- reg: base address and size for memory mapped io.
+   - The first index is for FPGA manager register access.
+   - The second index is for writing FPGA configuration data.
+- interrupts : interrupt for the FPGA Manager device.
+
+Example:
+
+   hps_0_fpgamgr: fpgamgr@0xff706000 {
+   compatible = "altr,socfpga-fpga-mgr";
+   reg = <0xFF706000 0x1000
+  0xFFB9 0x1000>;
+   interrupts = <0 175 4>;
+   };
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v8 0/4] FPGA Manager Framework

2015-01-06 Thread atull
From: Alan Tull 

v8 changes the compatible string for SOCFPGA FPGA managers
to be more chip specific.

"altr,fpga-mgr" becomes "altr,socfpga-fpga-mgr"

Thanks,
Alan

Alan Tull (4):
  doc: add bindings document for altera fpga manager
  fpga manager: add sysfs interface document
  staging: fpga manager: framework core
  staging: fpga manager: add driver for socfpga fpga manager

 drivers/staging/Kconfig|2 +
 drivers/staging/Makefile   |1 +
 .../Documentation/ABI/sysfs-class-fpga-manager |   38 ++
 .../bindings/altera-socfpga-fpga-mgr.txt   |   17 +
 drivers/staging/fpga/Kconfig   |   29 +
 drivers/staging/fpga/Makefile  |9 +
 drivers/staging/fpga/fpga-mgr.c|  551 
 drivers/staging/fpga/socfpga.c |  694 
 include/linux/fpga/fpga-mgr.h  |  124 
 9 files changed, 1465 insertions(+)
 create mode 100644 
drivers/staging/fpga/Documentation/ABI/sysfs-class-fpga-manager
 create mode 100644 
drivers/staging/fpga/Documentation/bindings/altera-socfpga-fpga-mgr.txt
 create mode 100644 drivers/staging/fpga/Kconfig
 create mode 100644 drivers/staging/fpga/Makefile
 create mode 100644 drivers/staging/fpga/fpga-mgr.c
 create mode 100644 drivers/staging/fpga/socfpga.c
 create mode 100644 include/linux/fpga/fpga-mgr.h

-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Christmas Gift From TNB

2015-01-06 Thread TNB, Kuala Lumpur
Tenaga Nasional Berhad
(TNB HQ) 129 Jalan Bangsar,
59200 Kuala Lumpur,
Kuala Lumpur,
Malaysia



Ini adalah satu pemberitahuan rasmi daripada ibu pejabat daripada Tenaga 
Nasional Berhad sempena Persatuan Air Malaysia (PAM) untuk memaklumkan anda 
mengenai Hadiah Khas Eksklusif Tenaga Nasional Berhad Akhir Tahun  dan kami 
Kami dengan gembira mengumumkan alamat e-mel anda sebagai salah satu  daripada 
7 alamat e-mel yang dipilih semalam yang diadakan di ibu pejabat di Kuala 
Lumpur.

Dilampirkan disini Nombor Rujukan TNB-1187-48901 dengan Nombor kelulusan, TNB / 
2012-087 /KL, dan nombor bertuah, TNB / 7071KL-733 yang memenangi MYR 
150,000.00 (Seratus Lima Puluh Ribu Ringgit Malaysia Sahaja), alamat e-mel anda 
dipilih dari pangkalan data ibu pejabat lembaga program Tenaga Nasioanl Berhad 
dan TNB memberi MYR150,000 kepada 7 keluarga yang bertuah menerima mesej rasmi 
ini melalui e-mel sebagai pampasan 1 Malaysia.

Hadiah ekslusif Akhir Tahun TNB berjumlah  MYR150,000.00 akan dikeluarkan 
kepada anda melalui bank antarabangsa. Oleh kerana rombakkan beberapa nombor 
dan nama, kami meminta anda menyimpan mesej ini untuk diri sendiri dan tidak 
akan sama sekali mendedahkan kepada pihak TNB sehingga tuntutan anda telah 
diproses, dan hadiah anda dimasukkan ke dalam akaun anda, kerana ini adalah 
sebahagian daripada protokol untuk mengelakkan penyalahgunaan nombor bertuah 
anda.

Untuk memulakan tuntutan TNB anda, anda dikehendaki mengisi borang pengesahan 
di bawah dan mengemukakannya kepada ejen tuntutan anda,Puan Zailina Bt Zainal 
Abidin bagi membolehkan beliau menjelaskan fail anda dan membayar dengan segera.


Jabatan Ganjaran TNB
Zailina Bt Zainal Abidin
TEL: +60163774909
E-Mel: tn-bhd...@outlook.my

Nama Penuh:
Alamat Bil:
Umur:
Warganegara:
Nombor Telefon Rumah:
No. Pengesahan dan Rujukan Hadiah:
 
NOTA: Untuk mengelakkan kelewatan atau pembatalan, sila lampirkan bersama  
Nombor Rujukan dan Nombor Pengesahan TNB dalam semua urusan surat menyurat 
dengan ejen anda di dalam e-mel ini.

Semua wang hadiah mesti dituntut tidak lewat dari  tarikh 20 Januari, 2015. 
Apa-apa tuntutan yang tidak dibuat mengikut tarikh ini akan dikembalikan kepada 
Tenaga Nasional Berhad, Malaysia.

Tahniah !! Sekali lagi
Saya yang menurut perintah,
(Nor Fadilah Binti Samsudin)
Setiausaha Publisiti TNB
© Copyright 2014 Tenaga Nasional Berhad
Semua hak cipta terpelihara.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v7 1/4] doc: add bindings document for altera fpga manager

2015-01-06 Thread atull
On Mon, 22 Dec 2014, Rob Herring wrote:

> On Fri, Dec 19, 2014 at 10:45 AM,   wrote:
> > From: Alan Tull 
> >
> > New bindings document for Altera fpga manager.
> >
> > Signed-off-by: Alan Tull 
> > ---
> > v5 : Move bindings to drivers/staging/fpga/Documentation/bindings
> >
> > v6 : No change in this patch for v6 of the patch set
> >
> > v7 : No change in this patch for v7 of the patch set
> > ---
> >  .../Documentation/bindings/altera-fpga-mgr.txt |   17 +
> >  1 file changed, 17 insertions(+)
> >  create mode 100644 
> > drivers/staging/fpga/Documentation/bindings/altera-fpga-mgr.txt
> >
> > diff --git 
> > a/drivers/staging/fpga/Documentation/bindings/altera-fpga-mgr.txt 
> > b/drivers/staging/fpga/Documentation/bindings/altera-fpga-mgr.txt
> > new file mode 100644
> > index 000..373af7b
> > --- /dev/null
> > +++ b/drivers/staging/fpga/Documentation/bindings/altera-fpga-mgr.txt
> > @@ -0,0 +1,17 @@
> > +Altera FPGA Manager
> > +
> > +Required properties:
> > +- compatible : should contain "altr,fpga-mgr"
> > +- reg: base address and size for memory mapped io.
> > +   - The first index is for FPGA manager register access.
> > +   - The second index is for writing FPGA configuration data.
> > +- interrupts : interrupt for the FPGA Manager device.
> > +
> > +Example:
> > +
> > +   hps_0_fpgamgr: fpgamgr@0xff706000 {
> > +   compatible = "altr,fpga-mgr";
> 
> Is "FPGA Manager" what the block is called or the name for the Linux
> subsystem?" The name should reflect the h/w block name. Also, is the
> block the same in every chip?

I see what you are saying.  The subsystem is 'fpga manager'.

I should change this to "altr,socfpga-fpga-mgr" so that it is the
fpga manager block that is specific to SOCFPGA chips.  Also I should
change the filename of the binding document accordingly.

> 
> This binding doesn't look complex or likely to change, so it can be
> out of staging unless you expect it to change.
> 
> Rob
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v18 0/12] dw-hdmi: convert imx hdmi to bridge/dw_hdmi

2015-01-06 Thread Philipp Zabel
Hi Heiko,

Am Dienstag, den 06.01.2015, 12:49 +0100 schrieb Heiko Stübner:
> Hi Philipp,
> 
> Am Samstag, 6. Dezember 2014, 00:31:46 schrieb Andy Yan:
> > > I am happy with the series so far. Pending Acks from the device tree
> > > maintainers for the new binding documents, I'd like to apply either the
> > > whole of it on top of
> > > 
> > >  git://git.pengutronix.de/git/pza/linux.git imx-drm/next
> > > 
> > > or take at least the i.MX specific patches (1-5) because of the
> > > dependency on the imx-drm OF helper conversion.
> 
> do you still want to take this series?
>
> As for the devicetree ACK, there is this (unwritten) rule that if the
> dt-maintainers do not respond after 3 weeks (and a ping mail to them)
> it should be considered acked. As this version of the series is sitting
> on the lists for a month now and nobody complained during the other
> 17 versions as well, I think we should be on the safe side :-)

Alright, let's assume silent approval.

> There is one slight catch. Patch 3 needs a little modification, as the
> THIS_MODULE ower of the imx_hdmi got meanwhile cleaned up.
> 
> So the patch would need to be modified as shown by the diff at the
> bottom. I'm not sure if you want Andy to repost the whole series again
> but I'll just post my fixed variant as reply to the origin v18 of patch 3
> for convenience.

No need to post this again, I can apply the patches and fix up the
remaining issues you and Russell pointed out in the process.

regards
Philipp

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v18 12/12] drm: bridge/dw_hdmi: add rockchip rk3288 support

2015-01-06 Thread Russell King - ARM Linux
On Thu, Dec 11, 2014 at 12:24:15PM +0100, Heiko Stübner wrote:
> Past practices suggest that having the dw in the name is a sane solution too, 
> like in dw_mmc-foo (mmc/host), dwmac-foo (net/ethernet/stmicro/stmmac).
> 
> And personally I'd keep to this already established naming scheme ... i.e. 
> not 
> hiding the dw heritage.
> 
> And also it looks like other involved parties like Philipp and Russell seemed 
> to be ok with the naming through the revisions till now.

I don't have much of a preference when it comes to this.  I was disappointed
that the original imx-hdmi driver did not use "dw" in its filename, as the
documentation clearly stated in several places that it was a designware
part, and as we all know, they're a company which sells IP, so their
designs are going to crop up in different places.

So I welcome this patch set - and I've also tested it on a SolidRun
Hummingboard i2ex along with all my CEC and audio patches, where it
seems to be fine.  So for the set:

Tested-by: Russell King 

Apart from the two minor items I've pointed out in separate replies:

Acked-by: Russell King 

Thanks.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: comedi: dmm32at: Fixed a code indent issue

2015-01-06 Thread Sudip Mukherjee
On Tue, Jan 06, 2015 at 02:33:27PM +0100, Konrad Zapalowicz wrote:
> On 01/06, Sudip Mukherjee wrote:
> > yes, i read the SubmittingPatches again. summary is the subject line. But 
> > then as Piotr Kubus has written that he could not find this rule in the 
> > documentaion, I also tried to find that in SubmittingPatches file and also 
> > in the Posting file of the development-process folder, but could not find 
> > it. Is it mentioned in some other file we missed ?
> 
> Then it is an 'unwritten rule' :) You can observe it just be browsing
> the git log commit messages - pick a few random and you will see.
i don't need to veify it, I don't doubt the rule. if you see all the patches i 
have sent, i have always maintained a rule of 70.
just curious why this 72 ..
this one gives a reason why -

http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html 

sudip

> 
> Moreover in the http://git-scm.com/book/ch5-2.html the 72-character
> columns are the example of the good commit message plus Linus says so:
> 
>   "we use 72-character columns for word-wrapping, except for quoted
>   material that has a specific line format."
> 
> in one of his comments
> https://github.com/torvalds/linux/pull/17#issuecomment-5661185
> 
> cheers,
> konrad
> 
> > sudip
> > > 
> > > -- 
> > > -=( Ian Abbott @ MEV Ltd.E-mail:  )=-
> > > -=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v18 04/12] drm: imx: imx-hdmi: split phy configuration to platform driver

2015-01-06 Thread Russell King - ARM Linux
On Fri, Dec 05, 2014 at 02:25:50PM +0800, Andy Yan wrote:
> hdmi phy configuration is platform specific, which can be adusted

Minor typo: adjusted

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v18.1 03/12] drm: imx: imx-hdmi: convert imx-hdmi to drm_bridge mode

2015-01-06 Thread Russell King - ARM Linux
On Tue, Jan 06, 2015 at 12:52:24PM +0100, Heiko Stübner wrote:
> +static void imx_hdmi_bridge_nope(struct drm_bridge *bridge)

"_nope" ?  As in "No"?  Or should this be "_nop" for no-operation ?

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: comedi: dmm32at: Fixed a code indent issue

2015-01-06 Thread Konrad Zapalowicz
On 01/06, Sudip Mukherjee wrote:
> On Tue, Jan 06, 2015 at 10:08:37AM +, Ian Abbott wrote:
> > On 06/01/15 06:02, Sudip Mukherjee wrote:
> > >On Mon, Jan 05, 2015 at 08:24:06PM +0100, Piotr Kubus wrote:
> > >>On Sun, Jan 04, 2015 at 11:31:29PM +0100, Konrad Zapalowicz wrote:
> > >>>On 01/04, Piotr Kubus wrote:
> > This is a patch to the dmm32at.c file that fixes up a code indent error 
> > found by the checkpatch.pl tool.
> > >>>
> > >>>Nice however improve your commit message. The rule is that the lines
> > >>>should wrap at 72nd column except for quoted material such as compiler
> > >>>output, etc...
> > >>>
> > >>>The 72-character columns are important for allowing quoting and they
> > >>>play nicely with standard indentation from git log.
> > >>
> > >>Hey,
> > >>
> > >>I couldn't find that rule in Kernel documentation. Besides there were no
> > >>complaints from checkpatch.pl tool.
> > >
> > >Please check SubmittingPatches in Documentation. It says:
> > >'the "summary" must be no more than 70-75 characters'
> > 
> > In this case, it's not the "summary" that's at issue, it's the body
> > of the commit message, as Konrad mentioned above.
> 
> yes, i read the SubmittingPatches again. summary is the subject line. But 
> then as Piotr Kubus has written that he could not find this rule in the 
> documentaion, I also tried to find that in SubmittingPatches file and also in 
> the Posting file of the development-process folder, but could not find it. Is 
> it mentioned in some other file we missed ?

Then it is an 'unwritten rule' :) You can observe it just be browsing
the git log commit messages - pick a few random and you will see.

Moreover in the http://git-scm.com/book/ch5-2.html the 72-character
columns are the example of the good commit message plus Linus says so:

"we use 72-character columns for word-wrapping, except for quoted
material that has a specific line format."

in one of his comments
https://github.com/torvalds/linux/pull/17#issuecomment-5661185

cheers,
konrad

> sudip
> > 
> > -- 
> > -=( Ian Abbott @ MEV Ltd.E-mail:  )=-
> > -=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v18.1 03/12] drm: imx: imx-hdmi: convert imx-hdmi to drm_bridge mode

2015-01-06 Thread Heiko Stübner
From: Andy Yan 

IMX6 and Rockchip RK3288 and JZ4780 (Ingenic Xburst/MIPS)
use the interface compatible Designware HDMI IP, but they
also have some lightly differences, such as phy pll configuration,
register width, 4K support, clk useage, and the crtc mux configuration
is also platform specific.

To reuse the imx hdmi driver, convert it to drm_bridge

handle encoder in imx-hdmi_pltfm.c, as most of the encoder
operation are platform specific such as crtc select and
panel format set

This patch depends on Russell King's patch:
 drm: imx: convert imx-drm to use the generic DRM OF helper
 
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2014-July/053484.html

Signed-off-by: Andy Yan 
Signed-off-by: Yakir Yang 

---
Changes in v18.1:
- adapt to THIS_MODULE cleanup

Changes in v18:
- remove a multiple blank lines in imx-hdmi.c
- fix a checkpatch warning in imx-hdmi_pltfm.c

Changes in v17:
- remove platform device stuff, adviced by Russell King

Changes in v16:
- use the common binding for the clocks

Changes in v15: None
Changes in v14:
- add defer probing, adviced by Philipp Zabel

Changes in v13:
- split platform specific phy configuration

Changes in v12:
- squash patch 

Changes in v11:
- squash patch  

Changes in v10:
- split generic dw_hdmi.c improvements from patch#11 (add rk3288 support)

Changes in v9: None
Changes in v8: None
Changes in v7:
- remove unused variables from structure dw_hdmi
- remove a wrong modification
- add copyrights for dw_hdmi-imx.c

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None

 drivers/gpu/drm/imx/Makefile |   2 +-
 drivers/gpu/drm/imx/imx-hdmi.c   | 258 +--
 drivers/gpu/drm/imx/imx-hdmi.h   |  15 ++
 drivers/gpu/drm/imx/imx-hdmi_pltfm.c | 203 +++
 4 files changed, 315 insertions(+), 163 deletions(-)
 create mode 100644 drivers/gpu/drm/imx/imx-hdmi_pltfm.c

diff --git a/drivers/gpu/drm/imx/Makefile b/drivers/gpu/drm/imx/Makefile
index 582c438..63cf56a 100644
--- a/drivers/gpu/drm/imx/Makefile
+++ b/drivers/gpu/drm/imx/Makefile
@@ -9,4 +9,4 @@ obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o
 
 imx-ipuv3-crtc-objs  := ipuv3-crtc.o ipuv3-plane.o
 obj-$(CONFIG_DRM_IMX_IPUV3)+= imx-ipuv3-crtc.o
-obj-$(CONFIG_DRM_IMX_HDMI) += imx-hdmi.o
+obj-$(CONFIG_DRM_IMX_HDMI) += imx-hdmi.o imx-hdmi_pltfm.o
diff --git a/drivers/gpu/drm/imx/imx-hdmi.c b/drivers/gpu/drm/imx/imx-hdmi.c
index 7a54d20..d72f82c 100644
--- a/drivers/gpu/drm/imx/imx-hdmi.c
+++ b/drivers/gpu/drm/imx/imx-hdmi.c
@@ -12,25 +12,20 @@
  * Copyright (C) 2010, Guennadi Liakhovetski 
  */
 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
 #include 
-#include 
 
 #include "imx-hdmi.h"
-#include "imx-drm.h"
 
 #define HDMI_EDID_LEN  512
 
@@ -54,11 +49,6 @@ enum hdmi_datamap {
YCbCr422_12B = 0x12,
 };
 
-enum imx_hdmi_devtype {
-   IMX6Q_HDMI,
-   IMX6DL_HDMI,
-};
-
 static const u16 csc_coeff_default[3][4] = {
{ 0x2000, 0x, 0x, 0x },
{ 0x, 0x2000, 0x, 0x },
@@ -113,7 +103,8 @@ struct hdmi_data_info {
 
 struct imx_hdmi {
struct drm_connector connector;
-   struct drm_encoder encoder;
+   struct drm_encoder *encoder;
+   struct drm_bridge *bridge;
 
enum imx_hdmi_devtype dev_type;
struct device *dev;
@@ -121,6 +112,7 @@ struct imx_hdmi {
struct clk *iahb_clk;
 
struct hdmi_data_info hdmi_data;
+   const struct imx_hdmi_plat_data *plat_data;
int vic;
 
u8 edid[HDMI_EDID_LEN];
@@ -137,13 +129,6 @@ struct imx_hdmi {
int ratio;
 };
 
-static void imx_hdmi_set_ipu_di_mux(struct imx_hdmi *hdmi, int ipu_di)
-{
-   regmap_update_bits(hdmi->regmap, IOMUXC_GPR3,
-  IMX6Q_GPR3_HDMI_MUX_CTL_MASK,
-  ipu_di << IMX6Q_GPR3_HDMI_MUX_CTL_SHIFT);
-}
-
 static inline void hdmi_writeb(struct imx_hdmi *hdmi, u8 val, int offset)
 {
writeb(val, hdmi->regs + offset);
@@ -1371,6 +1356,50 @@ static void imx_hdmi_poweroff(struct imx_hdmi *hdmi)
imx_hdmi_phy_disable(hdmi);
 }
 
+static void imx_hdmi_bridge_mode_set(struct drm_bridge *bridge,
+struct drm_display_mode *mode,
+struct drm_display_mode *adjusted_mode)
+{
+   struct imx_hdmi *hdmi = bridge->driver_private;
+
+   imx_hdmi_setup(hdmi, mode);
+
+   /* Store the display mode for plugin/DKMS poweron events */
+   memcpy(&hdmi->previous_mode, mode, sizeof(hdmi->previous_mode));
+}
+
+static bool imx_hdmi_bridge_mode_fixup(struct drm_bridge *bridge,
+  const struct drm_display_mode *mode,
+  struct drm_display_mode *adjusted_mode)
+{
+   return true;
+}
+
+static void imx_hdmi_bridge_disable(struct drm_bridge *br

Re: [PATCH v18 0/12] dw-hdmi: convert imx hdmi to bridge/dw_hdmi

2015-01-06 Thread Heiko Stübner
Hi Philipp,

Am Samstag, 6. Dezember 2014, 00:31:46 schrieb Andy Yan:
> > I am happy with the series so far. Pending Acks from the device tree
> > maintainers for the new binding documents, I'd like to apply either the
> > whole of it on top of
> > 
> >  git://git.pengutronix.de/git/pza/linux.git imx-drm/next
> > 
> > or take at least the i.MX specific patches (1-5) because of the
> > dependency on the imx-drm OF helper conversion.

do you still want to take this series?

As for the devicetree ACK, there is this (unwritten) rule that if the
dt-maintainers do not respond after 3 weeks (and a ping mail to them)
it should be considered acked. As this version of the series is sitting
on the lists for a month now and nobody complained during the other
17 versions as well, I think we should be on the safe side :-)

There is one slight catch. Patch 3 needs a little modification, as the
THIS_MODULE ower of the imx_hdmi got meanwhile cleaned up.

So the patch would need to be modified as shown by the diff at the
bottom. I'm not sure if you want Andy to repost the whole series again
but I'll just post my fixed variant as reply to the origin v18 of patch 3
for convenience.


Heiko

-- 8< 
--- "[PATCH v18 03_12] drm_imx_imx-hdmi_convert imx-hdmi to drm_bridge 
mode.mbox.old"   2015-01-06 12:33:52.0 +0100
+++ "[PATCH v18 03_12] drm_imx_imx-hdmi_convert imx-hdmi to drm_bridge 
mode.mbox"   2015-01-04 22:17:20.0 +0100
@@ -511,7 +511,7 @@
  {
struct imx_hdmi *hdmi = dev_get_drvdata(dev);
  
-@@ -1723,42 +1682,17 @@ static void imx_hdmi_unbind(struct device *dev, struct 
device *master,
+@@ -1723,41 +1682,17 @@ static void imx_hdmi_unbind(struct device *dev, struct 
device *master,
hdmi_writeb(hdmi, ~0, HDMI_IH_MUTE_PHY_STAT0);
  
hdmi->connector.funcs->destroy(&hdmi->connector);
@@ -544,7 +544,6 @@
 -  .remove = imx_hdmi_platform_remove,
 -  .driver = {
 -  .name = "imx-hdmi",
--  .owner = THIS_MODULE,
 -  .of_match_table = imx_hdmi_dt_ids,
 -  },
 -};

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: comedi: dmm32at: Fixed a code indent issue

2015-01-06 Thread Sudip Mukherjee
On Tue, Jan 06, 2015 at 10:08:37AM +, Ian Abbott wrote:
> On 06/01/15 06:02, Sudip Mukherjee wrote:
> >On Mon, Jan 05, 2015 at 08:24:06PM +0100, Piotr Kubus wrote:
> >>On Sun, Jan 04, 2015 at 11:31:29PM +0100, Konrad Zapalowicz wrote:
> >>>On 01/04, Piotr Kubus wrote:
> This is a patch to the dmm32at.c file that fixes up a code indent error 
> found by the checkpatch.pl tool.
> >>>
> >>>Nice however improve your commit message. The rule is that the lines
> >>>should wrap at 72nd column except for quoted material such as compiler
> >>>output, etc...
> >>>
> >>>The 72-character columns are important for allowing quoting and they
> >>>play nicely with standard indentation from git log.
> >>
> >>Hey,
> >>
> >>I couldn't find that rule in Kernel documentation. Besides there were no
> >>complaints from checkpatch.pl tool.
> >
> >Please check SubmittingPatches in Documentation. It says:
> >'the "summary" must be no more than 70-75 characters'
> 
> In this case, it's not the "summary" that's at issue, it's the body
> of the commit message, as Konrad mentioned above.

yes, i read the SubmittingPatches again. summary is the subject line. But then 
as Piotr Kubus has written that he could not find this rule in the 
documentaion, I also tried to find that in SubmittingPatches file and also in 
the Posting file of the development-process folder, but could not find it. Is 
it mentioned in some other file we missed ?

sudip
> 
> -- 
> -=( Ian Abbott @ MEV Ltd.E-mail:  )=-
> -=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] Staging: comedi: dmm32at: Fix a code indent issue

2015-01-06 Thread Ian Abbott

On 06/01/15 10:16, Piotr Kubus wrote:

Fixed a code indent error found by checkpatch.pl in dmm32at.c.

Signed-off-by: Piotr Kubus 
---
v2: make the commit message clearer and shorter

  drivers/staging/comedi/drivers/dmm32at.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/dmm32at.c 
b/drivers/staging/comedi/drivers/dmm32at.c
index 6df298a..31919b8 100644
--- a/drivers/staging/comedi/drivers/dmm32at.c
+++ b/drivers/staging/comedi/drivers/dmm32at.c
@@ -365,7 +365,7 @@ static void dmm32at_setaitimer(struct comedi_device *dev, 
unsigned int nansec)
/* enable the ai conversion interrupt and the clock to start scans */
outb(DMM32AT_INTCLK_ADINT |
 DMM32AT_INTCLK_CLKEN | DMM32AT_INTCLK_CLKSEL,
- dev->iobase + DMM32AT_INTCLK_REG);
+dev->iobase + DMM32AT_INTCLK_REG);
  }

  static int dmm32at_ai_cmd(struct comedi_device *dev, struct comedi_subdevice 
*s)



Reviewed-by: Ian Abbott 

--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] Staging: comedi: dmm32at: Fix a code indent issue

2015-01-06 Thread Piotr Kubus
Fixed a code indent error found by checkpatch.pl in dmm32at.c.

Signed-off-by: Piotr Kubus 
---
v2: make the commit message clearer and shorter

 drivers/staging/comedi/drivers/dmm32at.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/dmm32at.c 
b/drivers/staging/comedi/drivers/dmm32at.c
index 6df298a..31919b8 100644
--- a/drivers/staging/comedi/drivers/dmm32at.c
+++ b/drivers/staging/comedi/drivers/dmm32at.c
@@ -365,7 +365,7 @@ static void dmm32at_setaitimer(struct comedi_device *dev, 
unsigned int nansec)
/* enable the ai conversion interrupt and the clock to start scans */
outb(DMM32AT_INTCLK_ADINT |
 DMM32AT_INTCLK_CLKEN | DMM32AT_INTCLK_CLKSEL,
- dev->iobase + DMM32AT_INTCLK_REG);
+dev->iobase + DMM32AT_INTCLK_REG);
 }
 
 static int dmm32at_ai_cmd(struct comedi_device *dev, struct comedi_subdevice 
*s)
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: comedi: dmm32at: Fixed a code indent issue

2015-01-06 Thread Ian Abbott

On 06/01/15 06:02, Sudip Mukherjee wrote:

On Mon, Jan 05, 2015 at 08:24:06PM +0100, Piotr Kubus wrote:

On Sun, Jan 04, 2015 at 11:31:29PM +0100, Konrad Zapalowicz wrote:

On 01/04, Piotr Kubus wrote:

This is a patch to the dmm32at.c file that fixes up a code indent error found 
by the checkpatch.pl tool.


Nice however improve your commit message. The rule is that the lines
should wrap at 72nd column except for quoted material such as compiler
output, etc...

The 72-character columns are important for allowing quoting and they
play nicely with standard indentation from git log.


Hey,

I couldn't find that rule in Kernel documentation. Besides there were no
complaints from checkpatch.pl tool.


Please check SubmittingPatches in Documentation. It says:
'the "summary" must be no more than 70-75 characters'


In this case, it's not the "summary" that's at issue, it's the body of 
the commit message, as Konrad mentioned above.


--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: comedi: dmm32at: Fixed a code indent issue

2015-01-06 Thread Dan Carpenter
On Mon, Jan 05, 2015 at 08:24:06PM +0100, Piotr Kubus wrote:
> Do you mean I should resend it or wait for reply from maintainer first?
> 

Resend, please.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[patch] staging: lustre: potential underflow in mdc_iocontrol()

2015-01-06 Thread Dan Carpenter
Smatch complains that "data->ioc_plen2" is a user controlled value and,
since we cast to signed int, the limit check can underflow.  It's not
very serious because probably the copy_to_user() would return -EFAULT
on every arch that matters instead of creating an info leak.  Also I
haven't followed it through to see if the value is really user
controlled.

But definitely it would be safer to cast to unsigned so let's do that.

Signed-off-by: Dan Carpenter 

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c 
b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 3b0f245..05d05ce 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -1908,8 +1908,8 @@ static int mdc_iocontrol(unsigned int cmd, struct 
obd_export *exp, int len,
 
/* copy UUID */
if (copy_to_user(data->ioc_pbuf2, obd2cli_tgt(obd),
-min((int) data->ioc_plen2,
-(int) sizeof(struct obd_uuid {
+min_t(size_t, data->ioc_plen2,
+  sizeof(struct obd_uuid {
rc = -EFAULT;
goto out;
}
@@ -1921,8 +1921,8 @@ static int mdc_iocontrol(unsigned int cmd, struct 
obd_export *exp, int len,
goto out;
 
if (copy_to_user(data->ioc_pbuf1, &stat_buf,
-min((int) data->ioc_plen1,
-(int) sizeof(stat_buf {
+min_t(size_t, data->ioc_plen1,
+  sizeof(stat_buf {
rc = -EFAULT;
goto out;
}
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel