Re: [STLinux Kernel] [PATCH v6 02/10] ARM: dts: STiH410: add DELTA dt node
On Wed, 01 Feb 2017, Hugues Fruchet wrote: > This patch adds DT node for STMicroelectronics > DELTA V4L2 video decoder > > Signed-off-by: Hugues Fruchet > --- > arch/arm/boot/dts/stih410.dtsi | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/arch/arm/boot/dts/stih410.dtsi b/arch/arm/boot/dts/stih410.dtsi > index 281a124..42e070c 100644 > --- a/arch/arm/boot/dts/stih410.dtsi > +++ b/arch/arm/boot/dts/stih410.dtsi > @@ -259,5 +259,15 @@ > clocks = <&clk_sysin>; > interrupts = ; > }; > + delta0 { > + compatible = "st,st-delta"; > + clock-names = "delta", > + "delta-st231", > + "delta-flash-promip"; > + clocks = <&clk_s_c0_flexgen CLK_VID_DMU>, > + <&clk_s_c0_flexgen CLK_ST231_DMU>, > + <&clk_s_c0_flexgen CLK_FLASH_PROMIP>; > + }; > + I think this node should be in stih407-family.dtsi file? regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [STLinux Kernel] [PATCH v6 06/10] [media] st-delta: add memory allocator helper functions
On Wed, 01 Feb 2017, Hugues Fruchet wrote: > Helper functions used by decoder back-ends to allocate > physically contiguous memory required by hardware video > decoder. > > Signed-off-by: Hugues Fruchet Acked-by: Peter Griffin > --- > drivers/media/platform/sti/delta/Makefile| 2 +- > drivers/media/platform/sti/delta/delta-mem.c | 51 > > drivers/media/platform/sti/delta/delta-mem.h | 14 > drivers/media/platform/sti/delta/delta.h | 8 + > 4 files changed, 74 insertions(+), 1 deletion(-) > create mode 100644 drivers/media/platform/sti/delta/delta-mem.c > create mode 100644 drivers/media/platform/sti/delta/delta-mem.h > > diff --git a/drivers/media/platform/sti/delta/Makefile > b/drivers/media/platform/sti/delta/Makefile > index 467519e..93a3037 100644 > --- a/drivers/media/platform/sti/delta/Makefile > +++ b/drivers/media/platform/sti/delta/Makefile > @@ -1,2 +1,2 @@ > obj-$(CONFIG_VIDEO_STI_DELTA_DRIVER) := st-delta.o > -st-delta-y := delta-v4l2.o > +st-delta-y := delta-v4l2.o delta-mem.o > diff --git a/drivers/media/platform/sti/delta/delta-mem.c > b/drivers/media/platform/sti/delta/delta-mem.c > new file mode 100644 > index 000..d7b53d3 > --- /dev/null > +++ b/drivers/media/platform/sti/delta/delta-mem.c > @@ -0,0 +1,51 @@ > +/* > + * Copyright (C) STMicroelectronics SA 2015 > + * Author: Hugues Fruchet for STMicroelectronics. > + * License terms: GNU General Public License (GPL), version 2 > + */ > + > +#include "delta.h" > +#include "delta-mem.h" > + > +int hw_alloc(struct delta_ctx *ctx, u32 size, const char *name, > + struct delta_buf *buf) > +{ > + struct delta_dev *delta = ctx->dev; > + dma_addr_t dma_addr; > + void *addr; > + unsigned long attrs = DMA_ATTR_WRITE_COMBINE; > + > + addr = dma_alloc_attrs(delta->dev, size, &dma_addr, > +GFP_KERNEL | __GFP_NOWARN, attrs); > + if (!addr) { > + dev_err(delta->dev, > + "%s hw_alloc:dma_alloc_coherent failed for %s > (size=%d)\n", > + ctx->name, name, size); > + ctx->sys_errors++; > + return -ENOMEM; > + } > + > + buf->size = size; > + buf->paddr = dma_addr; > + buf->vaddr = addr; > + buf->name = name; > + buf->attrs = attrs; > + > + dev_dbg(delta->dev, > + "%s allocate %d bytes of HW memory @(virt=0x%p, phy=0x%pad): > %s\n", > + ctx->name, size, buf->vaddr, &buf->paddr, buf->name); > + > + return 0; > +} > + > +void hw_free(struct delta_ctx *ctx, struct delta_buf *buf) > +{ > + struct delta_dev *delta = ctx->dev; > + > + dev_dbg(delta->dev, > + "%s free %d bytes of HW memory @(virt=0x%p, phy=0x%pad): > %s\n", > + ctx->name, buf->size, buf->vaddr, &buf->paddr, buf->name); > + > + dma_free_attrs(delta->dev, buf->size, > +buf->vaddr, buf->paddr, buf->attrs); > +} > diff --git a/drivers/media/platform/sti/delta/delta-mem.h > b/drivers/media/platform/sti/delta/delta-mem.h > new file mode 100644 > index 000..f8ca109 > --- /dev/null > +++ b/drivers/media/platform/sti/delta/delta-mem.h > @@ -0,0 +1,14 @@ > +/* > + * Copyright (C) STMicroelectronics SA 2015 > + * Author: Hugues Fruchet for STMicroelectronics. > + * License terms: GNU General Public License (GPL), version 2 > + */ > + > +#ifndef DELTA_MEM_H > +#define DELTA_MEM_H > + > +int hw_alloc(struct delta_ctx *ctx, u32 size, const char *name, > + struct delta_buf *buf); > +void hw_free(struct delta_ctx *ctx, struct delta_buf *buf); > + > +#endif /* DELTA_MEM_H */ > diff --git a/drivers/media/platform/sti/delta/delta.h > b/drivers/media/platform/sti/delta/delta.h > index 74a4240..9e26525 100644 > --- a/drivers/media/platform/sti/delta/delta.h > +++ b/drivers/media/platform/sti/delta/delta.h > @@ -191,6 +191,14 @@ struct delta_dts { > u64 val; > }; > > +struct delta_buf { > + u32 size; > + void *vaddr; > + dma_addr_t paddr; > + const char *name; > + unsigned long attrs; > +}; > + > struct delta_ctx; > > /* -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [STLinux Kernel] [PATCH v6 08/10] [media] st-delta: EOS (End Of Stream) support
On Wed, 01 Feb 2017, Hugues Fruchet wrote: > EOS (End Of Stream) support allows user to get > all the potential decoded frames remaining in decoder > pipeline after having reached the end of video bitstream. > To do so, user calls VIDIOC_DECODER_CMD(V4L2_DEC_CMD_STOP) > which will drain the decoder and get the drained frames > that are then returned to user. > User is informed of EOS completion in two ways: > - dequeue of an empty frame flagged to V4L2_BUF_FLAG_LAST > - reception of a V4L2_EVENT_EOS event. > If, unfortunately, no buffer is available on CAPTURE queue > to return the empty frame, EOS is delayed till user queue > one CAPTURE buffer. > > Signed-off-by: Hugues Fruchet Acked-by: Peter Griffin > --- > drivers/media/platform/sti/delta/delta-v4l2.c | 146 > +- > drivers/media/platform/sti/delta/delta.h | 23 > 2 files changed, 168 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/platform/sti/delta/delta-v4l2.c > b/drivers/media/platform/sti/delta/delta-v4l2.c > index 237a938..c959614 100644 > --- a/drivers/media/platform/sti/delta/delta-v4l2.c > +++ b/drivers/media/platform/sti/delta/delta-v4l2.c > @@ -106,7 +106,8 @@ static void delta_frame_done(struct delta_ctx *ctx, > struct delta_frame *frame, > vbuf->sequence = ctx->frame_num++; > v4l2_m2m_buf_done(vbuf, err ? VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE); > > - ctx->output_frames++; > + if (frame->info.size) /* ignore EOS */ > + ctx->output_frames++; > } > > static void requeue_free_frames(struct delta_ctx *ctx) > @@ -762,6 +763,135 @@ static int delta_g_selection(struct file *file, void > *fh, > return 0; > } > > +static void delta_complete_eos(struct delta_ctx *ctx, > +struct delta_frame *frame) > +{ > + struct delta_dev *delta = ctx->dev; > + const struct v4l2_event ev = {.type = V4L2_EVENT_EOS}; > + > + /* > + * Send EOS to user: > + * - by returning an empty frame flagged to V4L2_BUF_FLAG_LAST > + * - and then send EOS event > + */ > + > + /* empty frame */ > + frame->info.size = 0; > + > + /* set the last buffer flag */ > + frame->flags |= V4L2_BUF_FLAG_LAST; > + > + /* release frame to user */ > + delta_frame_done(ctx, frame, 0); > + > + /* send EOS event */ > + v4l2_event_queue_fh(&ctx->fh, &ev); > + > + dev_dbg(delta->dev, "%s EOS completed\n", ctx->name); > +} > + > +static int delta_try_decoder_cmd(struct file *file, void *fh, > + struct v4l2_decoder_cmd *cmd) > +{ > + if (cmd->cmd != V4L2_DEC_CMD_STOP) > + return -EINVAL; > + > + if (cmd->flags & V4L2_DEC_CMD_STOP_TO_BLACK) > + return -EINVAL; > + > + if (!(cmd->flags & V4L2_DEC_CMD_STOP_IMMEDIATELY) && > + (cmd->stop.pts != 0)) > + return -EINVAL; > + > + return 0; > +} > + > +static int delta_decoder_stop_cmd(struct delta_ctx *ctx, void *fh) > +{ > + const struct delta_dec *dec = ctx->dec; > + struct delta_dev *delta = ctx->dev; > + struct delta_frame *frame = NULL; > + int ret = 0; > + > + dev_dbg(delta->dev, "%s EOS received\n", ctx->name); > + > + if (ctx->state != DELTA_STATE_READY) > + return 0; > + > + /* drain the decoder */ > + call_dec_op(dec, drain, ctx); > + > + /* release to user drained frames */ > + while (1) { > + frame = NULL; > + ret = call_dec_op(dec, get_frame, ctx, &frame); > + if (ret == -ENODATA) { > + /* no more decoded frames */ > + break; > + } > + if (frame) { > + dev_dbg(delta->dev, "%s drain frame[%d]\n", > + ctx->name, frame->index); > + > + /* pop timestamp and mark frame with it */ > + delta_pop_dts(ctx, &frame->dts); > + > + /* release decoded frame to user */ > + delta_frame_done(ctx, frame, 0); > + } > + } > + > + /* try to complete EOS */ > + ret = delta_get_free_frame(ctx, &frame); > + if (ret) > + goto delay_eos; > + > + /* new frame available, EOS can now be completed */ > + delta_complete_eos(ctx, frame); > + > + ctx->state = DELTA_STATE_EOS; > + > + return 0; > + > +delay_eos: > + /* > +
Re: [STLinux Kernel] [PATCH v6 05/10] [media] st-delta: STiH4xx multi-format video decoder v4l2 driver
On Wed, 01 Feb 2017, Hugues Fruchet wrote: > This V4L2 driver enables DELTA multi-format video decoder > of STMicroelectronics STiH4xx SoC series. > > Signed-off-by: Hugues Fruchet Acked-by: Peter Griffin > --- > drivers/media/platform/Kconfig| 28 + > drivers/media/platform/Makefile |2 + > drivers/media/platform/sti/delta/Makefile |2 + > drivers/media/platform/sti/delta/delta-cfg.h | 61 + > drivers/media/platform/sti/delta/delta-v4l2.c | 1813 > + > drivers/media/platform/sti/delta/delta.h | 514 +++ > 6 files changed, 2420 insertions(+) > create mode 100644 drivers/media/platform/sti/delta/Makefile > create mode 100644 drivers/media/platform/sti/delta/delta-cfg.h > create mode 100644 drivers/media/platform/sti/delta/delta-v4l2.c > create mode 100644 drivers/media/platform/sti/delta/delta.h > > diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig > index d944421..2247d9d 100644 > --- a/drivers/media/platform/Kconfig > +++ b/drivers/media/platform/Kconfig > @@ -298,6 +298,34 @@ config VIDEO_STI_HVA > To compile this driver as a module, choose M here: > the module will be called st-hva. > > +config VIDEO_STI_DELTA > + tristate "STMicroelectronics DELTA multi-format video decoder V4L2 > driver" > + depends on VIDEO_DEV && VIDEO_V4L2 > + depends on ARCH_STI || COMPILE_TEST > + depends on HAS_DMA > + help > + This V4L2 driver enables DELTA multi-format video decoder > + of STMicroelectronics STiH4xx SoC series allowing hardware > + decoding of various compressed video bitstream format in > + raw uncompressed format. > + > + Use this option to see the decoders available for such > + hardware. > + > + Please notice that the driver will only be built if > + at least one of the DELTA decoder below is selected. > + > +if VIDEO_STI_DELTA > + > +config VIDEO_STI_DELTA_DRIVER > + tristate > + depends on VIDEO_STI_DELTA > + default n > + select VIDEOBUF2_DMA_CONTIG > + select V4L2_MEM2MEM_DEV > + > +endif # VIDEO_STI_DELTA > + > config VIDEO_SH_VEU > tristate "SuperH VEU mem2mem video processing driver" > depends on VIDEO_DEV && VIDEO_V4L2 && HAS_DMA > diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile > index 5b3cb27..349ddf6 100644 > --- a/drivers/media/platform/Makefile > +++ b/drivers/media/platform/Makefile > @@ -39,6 +39,8 @@ obj-$(CONFIG_VIDEO_STI_BDISP) += sti/bdisp/ > obj-$(CONFIG_VIDEO_STI_HVA) += sti/hva/ > obj-$(CONFIG_DVB_C8SECTPFE) += sti/c8sectpfe/ > > +obj-$(CONFIG_VIDEO_STI_DELTA)+= sti/delta/ > + > obj-$(CONFIG_BLACKFIN) += blackfin/ > > obj-$(CONFIG_ARCH_DAVINCI) += davinci/ > diff --git a/drivers/media/platform/sti/delta/Makefile > b/drivers/media/platform/sti/delta/Makefile > new file mode 100644 > index 000..467519e > --- /dev/null > +++ b/drivers/media/platform/sti/delta/Makefile > @@ -0,0 +1,2 @@ > +obj-$(CONFIG_VIDEO_STI_DELTA_DRIVER) := st-delta.o > +st-delta-y := delta-v4l2.o > diff --git a/drivers/media/platform/sti/delta/delta-cfg.h > b/drivers/media/platform/sti/delta/delta-cfg.h > new file mode 100644 > index 000..f6674f6 > --- /dev/null > +++ b/drivers/media/platform/sti/delta/delta-cfg.h > @@ -0,0 +1,61 @@ > +/* > + * Copyright (C) STMicroelectronics SA 2015 > + * Author: Hugues Fruchet for STMicroelectronics. > + * License terms: GNU General Public License (GPL), version 2 > + */ > + > +#ifndef DELTA_CFG_H > +#define DELTA_CFG_H > + > +#define DELTA_FW_VERSION "21.1-3" > + > +#define DELTA_MIN_WIDTH 32 > +#define DELTA_MAX_WIDTH 4096 > +#define DELTA_MIN_HEIGHT 32 > +#define DELTA_MAX_HEIGHT 2400 > + > +/* DELTA requires a 32x32 pixels alignment for frames */ > +#define DELTA_WIDTH_ALIGNMENT32 > +#define DELTA_HEIGHT_ALIGNMENT 32 > + > +#define DELTA_DEFAULT_WIDTH DELTA_MIN_WIDTH > +#define DELTA_DEFAULT_HEIGHT DELTA_MIN_HEIGHT > +#define DELTA_DEFAULT_FRAMEFORMAT V4L2_PIX_FMT_NV12 > +#define DELTA_DEFAULT_STREAMFORMAT V4L2_PIX_FMT_MJPEG > + > +#define DELTA_MAX_RESO (DELTA_MAX_WIDTH * DELTA_MAX_HEIGHT) > + > +/* guard value for number of access units */ > +#define DELTA_MAX_AUS 10 > + > +/* IP perf dependent, can be tuned */ > +#define DELTA_PEAK_FRAME_SMOOTHING 2 > + > +/* > + * guard output frame count: > + * - at least 1 frame needed for
Re: [STLinux Kernel] [PATCH v6 04/10] [media] MAINTAINERS: add st-delta driver
Hi Hugues, On Wed, 01 Feb 2017, Hugues Fruchet wrote: > Add entry for the STMicroelectronics DELTA driver. > > Signed-off-by: Hugues Fruchet > --- > MAINTAINERS | 8 > 1 file changed, 8 insertions(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index cfff2c9..38cc652 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -2429,6 +2429,14 @@ W: https://linuxtv.org > S: Supported > F: drivers/media/platform/sti/bdisp > > +DELTA ST MEDIA DRIVER > +M: Hugues Fruchet > +L: linux-media@vger.kernel.org Would be useful to also include ker...@stlinux.com mailing list. Apart from that: Acked-by: Peter Griffin > +T: git git://linuxtv.org/media_tree.git > +W: https://linuxtv.org > +S: Supported > +F: drivers/media/platform/sti/delta > + > BEFS FILE SYSTEM > M: Luis de Bethencourt > M: Salah Triki -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [STLinux Kernel] [PATCH v6 03/10] ARM: multi_v7_defconfig: enable STMicroelectronics DELTA Support
On Wed, 01 Feb 2017, Hugues Fruchet wrote: > Enables support of STMicroelectronics STiH4xx SoC series > DELTA multi-format video decoder V4L2 driver. > > Signed-off-by: Hugues Fruchet Acked-by: Peter Griffin > --- > arch/arm/configs/multi_v7_defconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm/configs/multi_v7_defconfig > b/arch/arm/configs/multi_v7_defconfig > index b01a438..5dff8fe 100644 > --- a/arch/arm/configs/multi_v7_defconfig > +++ b/arch/arm/configs/multi_v7_defconfig > @@ -569,6 +569,7 @@ CONFIG_VIDEO_SAMSUNG_S5P_MFC=m > CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC=m > CONFIG_VIDEO_STI_BDISP=m > CONFIG_VIDEO_STI_HVA=m > +CONFIG_VIDEO_STI_DELTA=m > CONFIG_VIDEO_RENESAS_JPU=m > CONFIG_VIDEO_RENESAS_VSP1=m > CONFIG_V4L_TEST_DRIVERS=y -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [STLinux Kernel] [PATCH v6 07/10] [media] st-delta: rpmsg ipc support
On Wed, 01 Feb 2017, Hugues Fruchet wrote: > IPC (Inter Process Communication) support for communication with > DELTA coprocessor firmware using rpmsg kernel framework. > Based on 4 services open/set_stream/decode/close and their associated > rpmsg messages. > The messages structures are duplicated on both host and firmware > side and are packed (use only of 32 bits size fields in messages > structures to ensure packing). > Each service is synchronous; service returns only when firmware > acknowledges the associated command message. > Due to significant parameters size exchanged from host to copro, > parameters are not inserted in rpmsg messages. Instead, parameters are > stored in physical memory shared between host and coprocessor. > Memory is non-cacheable, so no special operation is required > to ensure memory coherency on host and on coprocessor side. > Multi-instance support and re-entrance are ensured using host_hdl and > copro_hdl in message header exchanged between both host and coprocessor. > This avoids to manage tables on both sides to get back the running context > of each instance. > > Signed-off-by: Hugues Fruchet Acked-by: Peter Griffin > --- > drivers/media/platform/Kconfig| 1 + > drivers/media/platform/sti/delta/Makefile | 2 +- > drivers/media/platform/sti/delta/delta-ipc.c | 594 > ++ > drivers/media/platform/sti/delta/delta-ipc.h | 76 > drivers/media/platform/sti/delta/delta-v4l2.c | 11 + > drivers/media/platform/sti/delta/delta.h | 21 + > 6 files changed, 704 insertions(+), 1 deletion(-) > create mode 100644 drivers/media/platform/sti/delta/delta-ipc.c > create mode 100644 drivers/media/platform/sti/delta/delta-ipc.h > > diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig > index 2247d9d..2e82ec6 100644 > --- a/drivers/media/platform/Kconfig > +++ b/drivers/media/platform/Kconfig > @@ -323,6 +323,7 @@ config VIDEO_STI_DELTA_DRIVER > default n > select VIDEOBUF2_DMA_CONTIG > select V4L2_MEM2MEM_DEV > + select RPMSG > > endif # VIDEO_STI_DELTA > > diff --git a/drivers/media/platform/sti/delta/Makefile > b/drivers/media/platform/sti/delta/Makefile > index 93a3037..b791ba0 100644 > --- a/drivers/media/platform/sti/delta/Makefile > +++ b/drivers/media/platform/sti/delta/Makefile > @@ -1,2 +1,2 @@ > obj-$(CONFIG_VIDEO_STI_DELTA_DRIVER) := st-delta.o > -st-delta-y := delta-v4l2.o delta-mem.o > +st-delta-y := delta-v4l2.o delta-mem.o delta-ipc.o > diff --git a/drivers/media/platform/sti/delta/delta-ipc.c > b/drivers/media/platform/sti/delta/delta-ipc.c > new file mode 100644 > index 000..41e4a4c > --- /dev/null > +++ b/drivers/media/platform/sti/delta/delta-ipc.c > @@ -0,0 +1,594 @@ > +/* > + * Copyright (C) STMicroelectronics SA 2015 > + * Author: Hugues Fruchet for STMicroelectronics. > + * License terms: GNU General Public License (GPL), version 2 > + */ > + > +#include > + > +#include "delta.h" > +#include "delta-ipc.h" > +#include "delta-mem.h" > + > +#define IPC_TIMEOUT 100 > +#define IPC_SANITY_TAG 0xDEADBEEF > + > +enum delta_ipc_fw_command { > + DELTA_IPC_OPEN, > + DELTA_IPC_SET_STREAM, > + DELTA_IPC_DECODE, > + DELTA_IPC_CLOSE > +}; > + > +#define to_rpmsg_driver(__drv) container_of(__drv, struct rpmsg_driver, drv) > +#define to_delta(__d) container_of(__d, struct delta_dev, rpmsg_driver) > + > +#define to_ctx(hdl) ((struct delta_ipc_ctx *)hdl) > +#define to_pctx(ctx) container_of(ctx, struct delta_ctx, ipc_ctx) > + > +struct delta_ipc_header_msg { > + u32 tag; > + void *host_hdl; > + u32 copro_hdl; > + u32 command; > +}; > + > +#define to_host_hdl(ctx) ((void *)ctx) > + > +#define msg_to_ctx(msg) ((struct delta_ipc_ctx *)(msg)->header.host_hdl) > +#define msg_to_copro_hdl(msg) ((msg)->header.copro_hdl) > + > +static inline dma_addr_t to_paddr(struct delta_ipc_ctx *ctx, void *vaddr) > +{ > + return (ctx->ipc_buf->paddr + (vaddr - ctx->ipc_buf->vaddr)); > +} > + > +static inline bool is_valid_data(struct delta_ipc_ctx *ctx, > + void *data, u32 size) > +{ > + return ((data >= ctx->ipc_buf->vaddr) && > + ((data + size) <= (ctx->ipc_buf->vaddr + ctx->ipc_buf->size))); > +} > + > +/* > + * IPC shared memory (@ipc_buf_size, @ipc_buf_paddr) is sent to copro > + * at each instance opening. This memory is allocated by IPC client > + * and given through delta_ipc_open(). All messages parameters > + * (open, set_stream, decode) will have their phy a
Re: [STLinux Kernel] [PATCH v6 09/10] [media] st-delta: add mjpeg support
On Wed, 01 Feb 2017, Hugues Fruchet wrote: > Adds support of DELTA MJPEG video decoder back-end, > implemented by calling JPEG_DECODER_HW0 firmware > using RPMSG IPC communication layer. > > Signed-off-by: Hugues Fruchet Acked-by: Peter Griffin > --- > drivers/media/platform/Kconfig | 12 +- > drivers/media/platform/sti/delta/Makefile | 4 + > drivers/media/platform/sti/delta/delta-cfg.h | 3 + > drivers/media/platform/sti/delta/delta-mjpeg-dec.c | 455 > + > drivers/media/platform/sti/delta/delta-mjpeg-fw.h | 225 ++ > drivers/media/platform/sti/delta/delta-mjpeg-hdr.c | 149 +++ > drivers/media/platform/sti/delta/delta-mjpeg.h | 35 ++ > drivers/media/platform/sti/delta/delta-v4l2.c | 3 + > 8 files changed, 885 insertions(+), 1 deletion(-) > create mode 100644 drivers/media/platform/sti/delta/delta-mjpeg-dec.c > create mode 100644 drivers/media/platform/sti/delta/delta-mjpeg-fw.h > create mode 100644 drivers/media/platform/sti/delta/delta-mjpeg-hdr.c > create mode 100644 drivers/media/platform/sti/delta/delta-mjpeg.h > > diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig > index 2e82ec6..20b26ea 100644 > --- a/drivers/media/platform/Kconfig > +++ b/drivers/media/platform/Kconfig > @@ -317,10 +317,20 @@ config VIDEO_STI_DELTA > > if VIDEO_STI_DELTA > > +config VIDEO_STI_DELTA_MJPEG > + bool "STMicroelectronics DELTA MJPEG support" > + default y > + help > + Enables DELTA MJPEG hardware support. > + > + To compile this driver as a module, choose M here: > + the module will be called st-delta. > + > config VIDEO_STI_DELTA_DRIVER > tristate > depends on VIDEO_STI_DELTA > - default n > + depends on VIDEO_STI_DELTA_MJPEG > + default VIDEO_STI_DELTA_MJPEG > select VIDEOBUF2_DMA_CONTIG > select V4L2_MEM2MEM_DEV > select RPMSG > diff --git a/drivers/media/platform/sti/delta/Makefile > b/drivers/media/platform/sti/delta/Makefile > index b791ba0..b268df6 100644 > --- a/drivers/media/platform/sti/delta/Makefile > +++ b/drivers/media/platform/sti/delta/Makefile > @@ -1,2 +1,6 @@ > obj-$(CONFIG_VIDEO_STI_DELTA_DRIVER) := st-delta.o > st-delta-y := delta-v4l2.o delta-mem.o delta-ipc.o > + > +# MJPEG support > +st-delta-$(CONFIG_VIDEO_STI_DELTA_MJPEG) += delta-mjpeg-hdr.o > +st-delta-$(CONFIG_VIDEO_STI_DELTA_MJPEG) += delta-mjpeg-dec.o > diff --git a/drivers/media/platform/sti/delta/delta-cfg.h > b/drivers/media/platform/sti/delta/delta-cfg.h > index f6674f6..c6388f5 100644 > --- a/drivers/media/platform/sti/delta/delta-cfg.h > +++ b/drivers/media/platform/sti/delta/delta-cfg.h > @@ -57,5 +57,8 @@ > #define DELTA_HW_AUTOSUSPEND_DELAY_MS 5 > > #define DELTA_MAX_DECODERS 10 > +#ifdef CONFIG_VIDEO_STI_DELTA_MJPEG > +extern const struct delta_dec mjpegdec; > +#endif > > #endif /* DELTA_CFG_H */ > diff --git a/drivers/media/platform/sti/delta/delta-mjpeg-dec.c > b/drivers/media/platform/sti/delta/delta-mjpeg-dec.c > new file mode 100644 > index 000..e79bdc6 > --- /dev/null > +++ b/drivers/media/platform/sti/delta/delta-mjpeg-dec.c > @@ -0,0 +1,455 @@ > +/* > + * Copyright (C) STMicroelectronics SA 2013 > + * Author: Hugues Fruchet for STMicroelectronics. > + * License terms: GNU General Public License (GPL), version 2 > + */ > + > +#include > + > +#include "delta.h" > +#include "delta-ipc.h" > +#include "delta-mjpeg.h" > +#include "delta-mjpeg-fw.h" > + > +#define DELTA_MJPEG_MAX_RESO DELTA_MAX_RESO > + > +struct delta_mjpeg_ctx { > + /* jpeg header */ > + struct mjpeg_header header_struct; > + struct mjpeg_header *header; > + > + /* ipc */ > + void *ipc_hdl; > + struct delta_buf *ipc_buf; > + > + /* decoded output frame */ > + struct delta_frame *out_frame; > + > + unsigned char str[3000]; > +}; > + > +#define to_ctx(ctx) ((struct delta_mjpeg_ctx *)(ctx)->priv) > + > +static char *ipc_open_param_str(struct jpeg_video_decode_init_params_t *p, > + char *str, unsigned int len) > +{ > + char *b = str; > + > + if (!p) > + return ""; > + > + b += snprintf(b, len, > + "jpeg_video_decode_init_params_t\n" > + "circular_buffer_begin_addr_p 0x%x\n" > + "circular_buffer_end_addr_p 0x%x\n", > + p->circular_buffer_begin_addr_p, > + p->circular_
Re: [STLinux Kernel] [PATCH v6 10/10] st-delta: debug: trace stream/frame information & summary
On Wed, 01 Feb 2017, Hugues Fruchet wrote: > Adds some trace points showing input compressed stream or > output decoded frame information. > Adds an unconditional trace point when streaming starts showing > the compressed stream and the decoded frame information. > Adds an unconditional trace point at instance closure summarizing > into a single line the decoding process (stream information, decoded > and output frames number, potential errors observed). > > Signed-off-by: Hugues Fruchet Acked-by: Peter Griffin > --- > drivers/media/platform/sti/delta/Makefile | 2 +- > drivers/media/platform/sti/delta/delta-debug.c | 72 > ++ > drivers/media/platform/sti/delta/delta-debug.h | 18 +++ > drivers/media/platform/sti/delta/delta-v4l2.c | 30 +-- > 4 files changed, 117 insertions(+), 5 deletions(-) > create mode 100644 drivers/media/platform/sti/delta/delta-debug.c > create mode 100644 drivers/media/platform/sti/delta/delta-debug.h > > diff --git a/drivers/media/platform/sti/delta/Makefile > b/drivers/media/platform/sti/delta/Makefile > index b268df6..8d032508 100644 > --- a/drivers/media/platform/sti/delta/Makefile > +++ b/drivers/media/platform/sti/delta/Makefile > @@ -1,5 +1,5 @@ > obj-$(CONFIG_VIDEO_STI_DELTA_DRIVER) := st-delta.o > -st-delta-y := delta-v4l2.o delta-mem.o delta-ipc.o > +st-delta-y := delta-v4l2.o delta-mem.o delta-ipc.o delta-debug.o > > # MJPEG support > st-delta-$(CONFIG_VIDEO_STI_DELTA_MJPEG) += delta-mjpeg-hdr.o > diff --git a/drivers/media/platform/sti/delta/delta-debug.c > b/drivers/media/platform/sti/delta/delta-debug.c > new file mode 100644 > index 000..a7ebf2c > --- /dev/null > +++ b/drivers/media/platform/sti/delta/delta-debug.c > @@ -0,0 +1,72 @@ > +/* > + * Copyright (C) STMicroelectronics SA 2015 > + * Authors: Hugues Fruchet > + * Fabrice Lecoultre > + * for STMicroelectronics. > + * License terms: GNU General Public License (GPL), version 2 > + */ > + > +#include "delta.h" > +#include "delta-debug.h" > + > +char *delta_streaminfo_str(struct delta_streaminfo *s, char *str, > +unsigned int len) > +{ > + if (!s) > + return NULL; > + > + snprintf(str, len, > + "%4.4s %dx%d %s %s dpb=%d %s %s %s%dx%d@(%d,%d) %s%d/%d", > + (char *)&s->streamformat, s->width, s->height, > + s->profile, s->level, s->dpb, > + (s->field == V4L2_FIELD_NONE) ? "progressive" : "interlaced", > + s->other, > + s->flags & DELTA_STREAMINFO_FLAG_CROP ? "crop=" : "", > + s->crop.width, s->crop.height, > + s->crop.left, s->crop.top, > + s->flags & DELTA_STREAMINFO_FLAG_PIXELASPECT ? "par=" : "", > + s->pixelaspect.numerator, > + s->pixelaspect.denominator); > + > + return str; > +} > + > +char *delta_frameinfo_str(struct delta_frameinfo *f, char *str, > + unsigned int len) > +{ > + if (!f) > + return NULL; > + > + snprintf(str, len, > + "%4.4s %dx%d aligned %dx%d %s %s%dx%d@(%d,%d) %s%d/%d", > + (char *)&f->pixelformat, f->width, f->height, > + f->aligned_width, f->aligned_height, > + (f->field == V4L2_FIELD_NONE) ? "progressive" : "interlaced", > + f->flags & DELTA_STREAMINFO_FLAG_CROP ? "crop=" : "", > + f->crop.width, f->crop.height, > + f->crop.left, f->crop.top, > + f->flags & DELTA_STREAMINFO_FLAG_PIXELASPECT ? "par=" : "", > + f->pixelaspect.numerator, > + f->pixelaspect.denominator); > + > + return str; > +} > + > +void delta_trace_summary(struct delta_ctx *ctx) > +{ > + struct delta_dev *delta = ctx->dev; > + struct delta_streaminfo *s = &ctx->streaminfo; > + unsigned char str[100] = ""; > + > + if (!(ctx->flags & DELTA_FLAG_STREAMINFO)) > + return; > + > + dev_dbg(delta->dev, "%s %s, %d frames decoded, %d frames output, %d > frames dropped, %d stream errors, %d decode errors", > + ctx->name, > + delta_streaminfo_str(s, str, sizeof(str)), > + ctx->decoded_frames, > + ctx->output_frames, > + ctx->dropped_frames, >
Re: [STLinux Kernel] [PATCH v6 01/10] Documentation: DT: add bindings for ST DELTA
On Wed, 01 Feb 2017, Hugues Fruchet wrote: > This patch adds DT binding documentation for STMicroelectronics > DELTA V4L2 video decoder. > > Signed-off-by: Hugues Fruchet Acked-by: Peter Griffin > --- > Documentation/devicetree/bindings/media/st,st-delta.txt | 17 > + > 1 file changed, 17 insertions(+) > create mode 100644 Documentation/devicetree/bindings/media/st,st-delta.txt > > diff --git a/Documentation/devicetree/bindings/media/st,st-delta.txt > b/Documentation/devicetree/bindings/media/st,st-delta.txt > new file mode 100644 > index 000..a538ab3 > --- /dev/null > +++ b/Documentation/devicetree/bindings/media/st,st-delta.txt > @@ -0,0 +1,17 @@ > +* STMicroelectronics DELTA multi-format video decoder > + > +Required properties: > +- compatible: should be "st,st-delta". > +- clocks: from common clock binding: handle hardware IP needed clocks, the > + number of clocks may depend on the SoC type. > + See ../clock/clock-bindings.txt for details. > +- clock-names: names of the clocks listed in clocks property in the same > order. > + > +Example: > + delta0 { > + compatible = "st,st-delta"; > + clock-names = "delta", "delta-st231", "delta-flash-promip"; > + clocks = <&clk_s_c0_flexgen CLK_VID_DMU>, > + <&clk_s_c0_flexgen CLK_ST231_DMU>, > + <&clk_s_c0_flexgen CLK_FLASH_PROMIP>; > + }; -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] [media] c8sectpfe: Remove clk_disable_unprepare hacks
Now that CLK_PROC_STFE is defined as a critical clock in DT, we can remove the commented clk_disable_unprepare from the c8sectpfe driver. This means we now have balanced clk*enable/disable calls in the driver, but on STiH407 family the clock in reality will never actually be disabled. This is due to a HW bug where once the IP has been configured and the SLIM core is running, disabling the clock causes a unrecoverable bus lockup. Signed-off-by: Peter Griffin --- drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c index 30c148b..79d793b 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -888,8 +888,7 @@ static int c8sectpfe_probe(struct platform_device *pdev) return 0; err_clk_disable: - /* TODO uncomment when upstream has taken a reference on this clk */ - /*clk_disable_unprepare(fei->c8sectpfeclk);*/ + clk_disable_unprepare(fei->c8sectpfeclk); return ret; } @@ -924,11 +923,8 @@ static int c8sectpfe_remove(struct platform_device *pdev) if (readl(fei->io + SYS_OTHER_CLKEN)) writel(0, fei->io + SYS_OTHER_CLKEN); - /* TODO uncomment when upstream has taken a reference on this clk */ - /* if (fei->c8sectpfeclk) clk_disable_unprepare(fei->c8sectpfeclk); - */ return 0; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [STLinux Kernel] [PATCH 28/57] [media] c8sectpfe: don't break long lines
On Fri, 14 Oct 2016, Mauro Carvalho Chehab wrote: > Due to the 80-cols checkpatch warnings, several strings > were broken into multiple lines. This is not considered > a good practice anymore, as it makes harder to grep for > strings at the source code. So, join those continuation > lines. > > Signed-off-by: Mauro Carvalho Chehab > --- > drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 15 +------ Acked-by: Peter Griffin -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [STLinux Kernel] [PATCH v3 0/4] STIH CEC driver
Hi Benjamin, On Thu, 15 Sep 2016, Benjamin Gaignard wrote: > version 3: > - remove rx_msg and use local variable instead > - change configuration flag from VIDEO_STIH_CEC to VIDEO_STI_HDMI_CEC > For the series: - Acked-by: Peter Griffin regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [STLinux Kernel] [PATCH 3/4] add stih-cec driver into DT
Hi Benjamin, On Wed, 14 Sep 2016, Benjamin Gaignard wrote: > Signed-off-by: Benjamin Gaignard > --- > arch/arm/boot/dts/stih410.dtsi | 12 > 1 file changed, 12 insertions(+) > > diff --git a/arch/arm/boot/dts/stih410.dtsi b/arch/arm/boot/dts/stih410.dtsi > index 18ed1ad..440c4bd 100644 > --- a/arch/arm/boot/dts/stih410.dtsi > +++ b/arch/arm/boot/dts/stih410.dtsi > @@ -227,5 +227,17 @@ > clock-names = "bdisp"; > clocks = <&clk_s_c0_flexgen CLK_IC_BDISP_0>; > }; > + > + sti-cec@094a087c { > + compatible = "st,stih-cec"; > + reg = <0x94a087c 0x64>; > + clocks = <&clk_sysin>; > + clock-names = "cec-clk"; > + interrupts = ; > + interrupt-names = "cec-irq"; > + pinctrl-names = "default"; > + pinctrl-0 = <&pinctrl_cec0_default>; > + resets = <&softreset STIH407_LPM_SOFTRESET>; > + }; I think this should be put in stih407-family.dtsi. regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [STLinux Kernel] [PATCH v5 0/3] support of v4l2 encoder for STMicroelectronics SOC
Hi Jean-Christophe, On Mon, 29 Aug 2016, Jean-Christophe Trotin wrote: > version 5: > - Compilation problem with 4.8-rc1 corrected: unsigned long used for dma_attrs > - The video bitrate (V4L2_CID_MPEG_VIDEO_BITRATE) and the CPB size > (V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE) were respectively considered in kbps and > kb, while the V4L2 API specifies them in bps and kB. This is corrected and > the code is now aligned with the V4L2 specification > - If the encoder close function (enc->close) has not been called through > hva_stop_streaming (e.g. application is killed), it's called at the encoder > instance release (hva_release) > - hva-v4l2.c: DEFAULT_* renamed HVA_DEFAULT_* > - hva-v4l2.c: few log messages modified > - typos corrected > - V4L2 compliance successfully passed with this version (see report below) > Looks like you forgot to add my: - Acked-by: Peter Griffin regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [STLinux Kernel] [PATCH v4 0/3] support of v4l2 encoder for STMicroelectronics SOC
Hi Jean-Christophe, On Mon, 25 Jul 2016, Jean-Christophe Trotin wrote: > version 4: > - Module renamed "st-hva" as suggested by Hans > - resource_size() inline function used to calculate the esram size > - V4L2 compliance successfully passed with this version (see report below) For the series: - Acked-by: Peter Griffin regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] [media] c8sectpfe: Fix broken circular buffer wp management
During the review process, a regression was intoduced in the circular buffer write pointer management. This means that wp doesn't get managed properly once the buffer becomes full. Signed-off-by: Peter Griffin --- drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c index 78e3cb9..875d384 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -130,7 +130,7 @@ static void channel_swdemux_tsklet(unsigned long data) writel(channel->back_buffer_busaddr, channel->irec + DMA_PRDS_BUSRP_TP(0)); else - writel(wp, channel->irec + DMA_PRDS_BUSWP_TP(0)); + writel(wp, channel->irec + DMA_PRDS_BUSRP_TP(0)); } static int c8sectpfe_start_feed(struct dvb_demux_feed *dvbdmxfeed) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/3] [media] c8sectpfe: Various driver fixups
Hi Mauro, This series includes a few fixes for the c8sectpfe Linux dvb demux driver. The first fixes a bug introduced in the review process to the circular buffer WP management. The second re-works the firmware loading code to not rely on the CONFIG_FW_LOADER_USER_HELPER_FALLBACK which was removed in a previous patch. The third patch simly demotes a print statement to dev_dbg. regards, Peter. Peter Griffin (3): [media] c8sectpfe: Fix broken circular buffer wp management [media] c8sectpfe: Demote print to dev_dbg [media] c8sectpfe: Rework firmware loading mechanism .../media/platform/sti/c8sectpfe/c8sectpfe-core.c | 69 -- 1 file changed, 24 insertions(+), 45 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/3] [media] c8sectpfe: Rework firmware loading mechanism
c8sectpfe driver relied on CONFIG_FW_LOADER_USER_HELPER_FALLBACK option for loading its xp70 firmware. A previous commit removed this Kconfig option, as it is apparently harmful, but did not update the driver code which relied on it. This patch reworks the firmware loading into the start_feed callback. At this point we can be sure the rootfs is present, thereby removing the depedency on CONFIG_FW_LOADER_USER_HELPER_FALLBACK. Fixes: 79f5b6ae960d ('[media] c8sectpfe: Remove select on CONFIG_FW_LOADER_USER_HELPER_FALLBACK') Signed-off-by: Peter Griffin --- .../media/platform/sti/c8sectpfe/c8sectpfe-core.c | 65 -- 1 file changed, 22 insertions(+), 43 deletions(-) diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c index acd0767..7dddf77 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -49,7 +49,7 @@ MODULE_FIRMWARE(FIRMWARE_MEMDMA); #define PID_TABLE_SIZE 1024 #define POLL_MSECS 50 -static int load_c8sectpfe_fw_step1(struct c8sectpfei *fei); +static int load_c8sectpfe_fw(struct c8sectpfei *fei); #define TS_PKT_SIZE 188 #define HEADER_SIZE (4) @@ -141,6 +141,7 @@ static int c8sectpfe_start_feed(struct dvb_demux_feed *dvbdmxfeed) struct channel_info *channel; u32 tmp; unsigned long *bitmap; + int ret; switch (dvbdmxfeed->type) { case DMX_TYPE_TS: @@ -169,8 +170,9 @@ static int c8sectpfe_start_feed(struct dvb_demux_feed *dvbdmxfeed) } if (!atomic_read(&fei->fw_loaded)) { - dev_err(fei->dev, "%s: c8sectpfe fw not loaded\n", __func__); - return -EINVAL; + ret = load_c8sectpfe_fw(fei); + if (ret) + return ret; } mutex_lock(&fei->lock); @@ -265,8 +267,9 @@ static int c8sectpfe_stop_feed(struct dvb_demux_feed *dvbdmxfeed) unsigned long *bitmap; if (!atomic_read(&fei->fw_loaded)) { - dev_err(fei->dev, "%s: c8sectpfe fw not loaded\n", __func__); - return -EINVAL; + ret = load_c8sectpfe_fw(fei); + if (ret) + return ret; } mutex_lock(&fei->lock); @@ -880,13 +883,6 @@ static int c8sectpfe_probe(struct platform_device *pdev) goto err_clk_disable; } - /* ensure all other init has been done before requesting firmware */ - ret = load_c8sectpfe_fw_step1(fei); - if (ret) { - dev_err(dev, "Couldn't load slim core firmware\n"); - goto err_clk_disable; - } - c8sectpfe_debugfs_init(fei); return 0; @@ -1091,15 +1087,14 @@ static void load_dmem_segment(struct c8sectpfei *fei, Elf32_Phdr *phdr, phdr->p_memsz - phdr->p_filesz); } -static int load_slim_core_fw(const struct firmware *fw, void *context) +static int load_slim_core_fw(const struct firmware *fw, struct c8sectpfei *fei) { - struct c8sectpfei *fei = context; Elf32_Ehdr *ehdr; Elf32_Phdr *phdr; u8 __iomem *dst; int err = 0, i; - if (!fw || !context) + if (!fw || !fei) return -EINVAL; ehdr = (Elf32_Ehdr *)fw->data; @@ -1151,29 +1146,35 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) return err; } -static void load_c8sectpfe_fw_cb(const struct firmware *fw, void *context) +static int load_c8sectpfe_fw(struct c8sectpfei *fei) { - struct c8sectpfei *fei = context; + const struct firmware *fw; int err; + dev_info(fei->dev, "Loading firmware: %s\n", FIRMWARE_MEMDMA); + + err = request_firmware(&fw, FIRMWARE_MEMDMA, fei->dev); + if (err) + return err; + err = c8sectpfe_elf_sanity_check(fei, fw); if (err) { dev_err(fei->dev, "c8sectpfe_elf_sanity_check failed err=(%d)\n" , err); - goto err; + return err; } - err = load_slim_core_fw(fw, context); + err = load_slim_core_fw(fw, fei); if (err) { dev_err(fei->dev, "load_slim_core_fw failed err=(%d)\n", err); - goto err; + return err; } /* now the firmware is loaded configure the input blocks */ err = configure_channels(fei); if (err) { dev_err(fei->dev, "configure_channels failed err=(%d)\n", err); - goto err; + return err; } /* @@ -1186,28 +1187,6 @@ static void load_c8sectpfe_fw_cb(const struct firmware *fw, void *context) writel(0x1, fei->io + DMA_CPU_RUN); atom
[PATCH 2/3] [media] c8sectpfe: Demote print to dev_dbg
Signed-off-by: Peter Griffin --- drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c index 875d384..acd0767 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -585,7 +585,7 @@ static int configure_memdma_and_inputblock(struct c8sectpfei *fei, writel(tsin->pid_buffer_busaddr, fei->io + PIDF_BASE(tsin->tsin_id)); - dev_info(fei->dev, "chan=%d PIDF_BASE=0x%x pid_bus_addr=%pad\n", + dev_dbg(fei->dev, "chan=%d PIDF_BASE=0x%x pid_bus_addr=%pad\n", tsin->tsin_id, readl(fei->io + PIDF_BASE(tsin->tsin_id)), &tsin->pid_buffer_busaddr); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v5 2/6] ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node.
This patch adds in the required DT node for the c8sectpfe Linux DVB demux driver which allows the tsin channels to be used on an upstream kernel. Signed-off-by: Peter Griffin Acked-by: Lee Jones --- arch/arm/boot/dts/stihxxx-b2120.dtsi | 35 +++ 1 file changed, 35 insertions(+) diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index 62994ae..f9fca10 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -6,6 +6,9 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + +#include +#include / { soc { sbc_serial0: serial@953 { @@ -85,5 +88,37 @@ status = "okay"; }; + demux@08a2 { + compatible = "st,stih407-c8sectpfe"; + status = "okay"; + reg = <0x08a2 0x1>, + <0x08a0 0x4000>; + reg-names = "c8sectpfe", "c8sectpfe-ram"; + interrupts = , + ; + interrupt-names = "c8sectpfe-error-irq", + "c8sectpfe-idle-irq"; + pinctrl-0 = <&pinctrl_tsin0_serial>; + pinctrl-1 = <&pinctrl_tsin0_parallel>; + pinctrl-2 = <&pinctrl_tsin3_serial>; + pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; + pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; + pinctrl-names = "tsin0-serial", + "tsin0-parallel", + "tsin3-serial", + "tsin4-serial", + "tsin5-serial"; + clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; + clock-names = "c8sectpfe"; + + /* tsin0 is TSA on NIMA */ + tsin0: port@0 { + tsin-num= <0>; + serial-not-parallel; + i2c-bus = <&ssc2>; + rst-gpio= <&pio15 4 GPIO_ACTIVE_HIGH>; + dvb-card= ; + }; + }; }; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v5 1/6] ARM: DT: STi: stihxxx-b2120: Add pulse-width properties to ssc2 & ssc3
Adding these properties makes the I2C bus to the demodulators much more reliable, and we no longer suffer from I2C errors when tuning. Signed-off-by: Peter Griffin Acked-by: Lee Jones --- arch/arm/boot/dts/stihxxx-b2120.dtsi | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index f589fe4..62994ae 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -27,12 +27,18 @@ }; }; - i2c@9842000 { + ssc2: i2c@9842000 { status = "okay"; + clock-frequency = <10>; + st,i2c-min-scl-pulse-width-us = <0>; + st,i2c-min-sda-pulse-width-us = <5>; }; - i2c@9843000 { + ssc3: i2c@9843000 { status = "okay"; + clock-frequency = <10>; + st,i2c-min-scl-pulse-width-us = <0>; + st,i2c-min-sda-pulse-width-us = <5>; }; i2c@9844000 { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v5 5/6] [media] c8sectpfe: Update DT binding doc with some minor fixes
Signed-off-by: Peter Griffin Acked-by: Lee Jones --- .../devicetree/bindings/media/stih407-c8sectpfe.txt| 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt index e70d840..cc51b1f 100644 --- a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +++ b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt @@ -55,20 +55,20 @@ Example: status = "okay"; reg = <0x08a2 0x1>, <0x08a0 0x4000>; reg-names = "stfe", "stfe-ram"; - interrupts = <0 34 0>, <0 35 0>; + interrupts = , ; interrupt-names = "stfe-error-irq", "stfe-idle-irq"; - - pinctrl-names = "tsin0-serial", "tsin0-parallel", "tsin3-serial", - "tsin4-serial", "tsin5-serial"; - pinctrl-0 = <&pinctrl_tsin0_serial>; pinctrl-1 = <&pinctrl_tsin0_parallel>; pinctrl-2 = <&pinctrl_tsin3_serial>; pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; - + pinctrl-names = "tsin0-serial", + "tsin0-parallel", + "tsin3-serial", + "tsin4-serial", + "tsin5-serial"; clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; - clock-names = "stfe"; + clock-names = "c8sectpfe"; /* tsin0 is TSA on NIMA */ tsin0: port@0 { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v5 0/6] [media] c8sectpfe: Various fixups
Hi Mauro, This series includes a couple of fixes for the c8sectpfe Linux dvb driver. The only difference versus v5 is on RobH advice we are back to "reset-gpios" for the binding. One was caused by omitting a patch from the original c8sectpfe series which defined the ssc2 and ssc3 dt nodes, which was then used by the later DT patch. This patch is included, along with the original patch which you reverted. Also Valentin Rothberg spotted LIBELF32 Kconfig symbol I was selecting in the Kconfig, this isn't required upstream and is left over legacy so I've removed it. Also included are some fixups spotted by Lee Jones. Changes since v4: - Change back (again) to "reset-gpios" Changes since v3: - Collect up more acks - Change binding to "reset-gpio" - highlight dtb incompatability in commit message Changes since v2: - Add some "\n" and other formatting fixes - 'Suggested by' should be in chronological order - Simplify load_slim_core_fw loop Changes since v1: - Various formating patches to DT node - Update to reset-gpios - Use GPIO_ACTIVE_HIGH, GIC_SPI and IRQ_TYPE_NONE defines kind regards, Peter. Peter Griffin (6): ARM: DT: STi: stihxxx-b2120: Add pulse-width properties to ssc2 & ssc3 ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node. [media] c8sectpfe: Remove select on undefined LIBELF_32 [media] c8sectpfe: Update binding to reset-gpios [media] c8sectpfe: Update DT binding doc with some minor fixes [media] c8sectpfe: Simplify for loop in load_slim_core_fw .../bindings/media/stih407-c8sectpfe.txt | 20 +- arch/arm/boot/dts/stihxxx-b2120.dtsi | 45 +- drivers/media/platform/sti/c8sectpfe/Kconfig | 1 - .../media/platform/sti/c8sectpfe/c8sectpfe-core.c | 9 +++-- 4 files changed, 58 insertions(+), 17 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v5 6/6] [media] c8sectpfe: Simplify for loop in load_slim_core_fw
Signed-off-by: Peter Griffin --- drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c index c691e13..ce72ffb 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -1096,7 +1096,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) Elf32_Ehdr *ehdr; Elf32_Phdr *phdr; u8 __iomem *dst; - int err, i; + int err = 0, i; if (!fw || !context) return -EINVAL; @@ -1105,7 +1105,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) phdr = (Elf32_Phdr *)(fw->data + ehdr->e_phoff); /* go through the available ELF segments */ - for (i = 0; i < ehdr->e_phnum && !err; i++, phdr++) { + for (i = 0; i < ehdr->e_phnum; i++, phdr++) { /* Only consider LOAD segments */ if (phdr->p_type != PT_LOAD) @@ -1118,7 +1118,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) dev_err(fei->dev, "Segment %d is outside of firmware file\n", i); err = -EINVAL; - break; + goto err; } /* @@ -1146,6 +1146,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) } } +err: release_firmware(fw); return err; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v5 4/6] [media] c8sectpfe: Update binding to reset-gpios
reset-gpios is more clear than rst-gpio. This change has been done as one atomic commit but it does breaks compatability with older dtbs. Signed-off-by: Peter Griffin Acked-by: Lee Jones --- Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++--- arch/arm/boot/dts/stihxxx-b2120.dtsi | 4 ++-- drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt index d4def76..e70d840 100644 --- a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +++ b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt @@ -35,7 +35,7 @@ Required properties (tsin (child) node): - tsin-num : tsin id of the InputBlock (must be between 0 to 6) - i2c-bus : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected. -- rst-gpio : reset gpio for this tsin channel. +- reset-gpios : reset gpio for this tsin channel. Optional properties (tsin (child) node): @@ -75,7 +75,7 @@ Example: tsin-num= <0>; serial-not-parallel; i2c-bus = <&ssc2>; - rst-gpio= <&pio15 4 0>; + reset-gpios = <&pio15 4 GPIO_ACTIVE_HIGH>; dvb-card= ; }; @@ -83,7 +83,7 @@ Example: tsin-num= <3>; serial-not-parallel; i2c-bus = <&ssc3>; - rst-gpio= <&pio15 7 0>; + reset-gpios = <&pio15 7 GPIO_ACTIVE_HIGH>; dvb-card= ; }; }; diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index f9fca10..0b7592e 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -6,8 +6,8 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - #include +#include #include / { soc { @@ -116,7 +116,7 @@ tsin-num= <0>; serial-not-parallel; i2c-bus = <&ssc2>; - rst-gpio= <&pio15 4 GPIO_ACTIVE_HIGH>; + reset-gpios = <&pio15 4 GPIO_ACTIVE_HIGH>; dvb-card= ; }; }; diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c index 3a91093..c691e13 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -822,7 +822,7 @@ static int c8sectpfe_probe(struct platform_device *pdev) } of_node_put(i2c_bus); - tsin->rst_gpio = of_get_named_gpio(child, "rst-gpio", 0); + tsin->rst_gpio = of_get_named_gpio(child, "reset-gpios", 0); ret = gpio_is_valid(tsin->rst_gpio); if (!ret) { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v5 3/6] [media] c8sectpfe: Remove select on undefined LIBELF_32
LIBELF_32 is not defined in Kconfig, and is left over legacy which is not required in the upstream driver, so remove it. Suggested-by: Valentin Rothberg Signed-off-by: Peter Griffin Acked-by: Lee Jones --- drivers/media/platform/sti/c8sectpfe/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/sti/c8sectpfe/Kconfig b/drivers/media/platform/sti/c8sectpfe/Kconfig index d1bfd4c..b9ec667 100644 --- a/drivers/media/platform/sti/c8sectpfe/Kconfig +++ b/drivers/media/platform/sti/c8sectpfe/Kconfig @@ -1,7 +1,6 @@ config DVB_C8SECTPFE tristate "STMicroelectronics C8SECTPFE DVB support" depends on DVB_CORE && I2C && (ARCH_STI || ARCH_MULTIPLATFORM) - select LIBELF_32 select FW_LOADER select FW_LOADER_USER_HELPER_FALLBACK select DEBUG_FS -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios
Hi Rob, On Tue, 01 Sep 2015, Rob Herring wrote: > On Tue, Sep 1, 2015 at 3:32 AM, Javier Martinez Canillas > wrote: > > Hello Peter, > > > > On Fri, Aug 28, 2015 at 7:52 PM, Peter Griffin > > wrote: > >> gpio.txt documents that GPIO properties should be named > >> "[-]gpios", with being the purpose of this > >> GPIO for the device. > >> > >> This change has been done as one atomic commit. > >> > >> Signed-off-by: Peter Griffin > >> Acked-by: Lee Jones > >> --- > >> Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++--- > >> arch/arm/boot/dts/stihxxx-b2120.dtsi | 4 ++-- > >> drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 2 +- > >> 3 files changed, 6 insertions(+), 6 deletions(-) > >> > >> diff --git a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt > >> b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt > >> index d4def76..e70d840 100644 > >> --- a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt > >> +++ b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt > >> @@ -35,7 +35,7 @@ Required properties (tsin (child) node): > >> > >> - tsin-num : tsin id of the InputBlock (must be between 0 to 6) > >> - i2c-bus : phandle to the I2C bus DT node which the demodulators & > >> tuners on this tsin channel are connected. > >> -- rst-gpio : reset gpio for this tsin channel. > >> +- reset-gpios : reset gpio for this tsin channel. > > > > The documentation is a bit outdated, the GPIO subsystem supports both > > -gpio and -gpios, see commit: > > > > dd34c37aa3e8 ("gpio: of: Allow -gpio suffix for property names") > > Yes, because we have lots of them. > > > So it makes sense to me to use -gpio instead of -gpios in this case > > since is a single GPIO. Also rst is already a descriptive name since > > that's how many datasheets name a reset pin. I'm not saying I'm > > against this patch, just pointing out since the commit message is a > > bit misleading. > > I believe that this has been discussed at length and it was decided > that new bindings should use "-gpios" even for 1. Just like "clocks" > is always plural. Doh! Ok I will change back again to 'reset-gpios'. regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 2/6] ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node.
This patch adds in the required DT node for the c8sectpfe Linux DVB demux driver which allows the tsin channels to be used on an upstream kernel. Signed-off-by: Peter Griffin Acked-by: Lee Jones --- arch/arm/boot/dts/stihxxx-b2120.dtsi | 35 +++ 1 file changed, 35 insertions(+) diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index 62994ae..f9fca10 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -6,6 +6,9 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + +#include +#include / { soc { sbc_serial0: serial@953 { @@ -85,5 +88,37 @@ status = "okay"; }; + demux@08a2 { + compatible = "st,stih407-c8sectpfe"; + status = "okay"; + reg = <0x08a2 0x1>, + <0x08a0 0x4000>; + reg-names = "c8sectpfe", "c8sectpfe-ram"; + interrupts = , + ; + interrupt-names = "c8sectpfe-error-irq", + "c8sectpfe-idle-irq"; + pinctrl-0 = <&pinctrl_tsin0_serial>; + pinctrl-1 = <&pinctrl_tsin0_parallel>; + pinctrl-2 = <&pinctrl_tsin3_serial>; + pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; + pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; + pinctrl-names = "tsin0-serial", + "tsin0-parallel", + "tsin3-serial", + "tsin4-serial", + "tsin5-serial"; + clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; + clock-names = "c8sectpfe"; + + /* tsin0 is TSA on NIMA */ + tsin0: port@0 { + tsin-num= <0>; + serial-not-parallel; + i2c-bus = <&ssc2>; + rst-gpio= <&pio15 4 GPIO_ACTIVE_HIGH>; + dvb-card= ; + }; + }; }; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 0/6] [media] c8sectpfe: Various fixups
Hi Mauro, This series includes a couple of fixes for the c8sectpfe Linux dvb driver. One was caused by omitting a patch from the original c8sectpfe series which defined the ssc2 and ssc3 dt nodes, which was then used by the later DT patch. This patch is included, along with the original patch which you reverted. Also Valentin Rothberg spotted LIBELF32 Kconfig symbol I was selecting in the Kconfig, this isn't required upstream and is left over legacy so I've removed it. Also included are some fixups spotted by Lee Jones. Changes since v3: - Collect up more acks - Change binding to "reset-gpio" - highlight dtb incompatability in commit message Changes since v2: - Add some "\n" and other formatting fixes - 'Suggested by' should be in chronological order - Simplify load_slim_core_fw loop Changes since v1: - Various formating patches to DT node - Update to reset-gpios - Use GPIO_ACTIVE_HIGH, GIC_SPI and IRQ_TYPE_NONE defines kind regards, Peter. Peter Griffin (6): ARM: DT: STi: stihxxx-b2120: Add pulse-width properties to ssc2 & ssc3 ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node. [media] c8sectpfe: Remove select on undefined LIBELF_32 [media] c8sectpfe: Update binding to reset-gpio [media] c8sectpfe: Update DT binding doc with some minor fixes [media] c8sectpfe: Simplify for loop in load_slim_core_fw .../bindings/media/stih407-c8sectpfe.txt | 20 +- arch/arm/boot/dts/stihxxx-b2120.dtsi | 45 +- drivers/media/platform/sti/c8sectpfe/Kconfig | 1 - .../media/platform/sti/c8sectpfe/c8sectpfe-core.c | 9 +++-- 4 files changed, 58 insertions(+), 17 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 4/6] [media] c8sectpfe: Update binding to reset-gpio
reset-gpio is more clear than rst-gpio. This change has been done as one atomic commit but it does breaks compatability with older dtbs. Signed-off-by: Peter Griffin Acked-by: Lee Jones --- Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++--- arch/arm/boot/dts/stihxxx-b2120.dtsi | 4 ++-- drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt index d4def76..84ae9d1 100644 --- a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +++ b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt @@ -35,7 +35,7 @@ Required properties (tsin (child) node): - tsin-num : tsin id of the InputBlock (must be between 0 to 6) - i2c-bus : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected. -- rst-gpio : reset gpio for this tsin channel. +- reset-gpio : reset gpio for this tsin channel. Optional properties (tsin (child) node): @@ -75,7 +75,7 @@ Example: tsin-num= <0>; serial-not-parallel; i2c-bus = <&ssc2>; - rst-gpio= <&pio15 4 0>; + reset-gpio = <&pio15 4 GPIO_ACTIVE_HIGH>; dvb-card= ; }; @@ -83,7 +83,7 @@ Example: tsin-num= <3>; serial-not-parallel; i2c-bus = <&ssc3>; - rst-gpio= <&pio15 7 0>; + reset-gpio = <&pio15 7 GPIO_ACTIVE_HIGH>; dvb-card= ; }; }; diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index f9fca10..b940934 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -6,8 +6,8 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - #include +#include #include / { soc { @@ -116,7 +116,7 @@ tsin-num= <0>; serial-not-parallel; i2c-bus = <&ssc2>; - rst-gpio= <&pio15 4 GPIO_ACTIVE_HIGH>; + reset-gpio = <&pio15 4 GPIO_ACTIVE_HIGH>; dvb-card= ; }; }; diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c index 3a91093..e19c6b4 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -822,7 +822,7 @@ static int c8sectpfe_probe(struct platform_device *pdev) } of_node_put(i2c_bus); - tsin->rst_gpio = of_get_named_gpio(child, "rst-gpio", 0); + tsin->rst_gpio = of_get_named_gpio(child, "reset-gpio", 0); ret = gpio_is_valid(tsin->rst_gpio); if (!ret) { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 5/6] [media] c8sectpfe: Update DT binding doc with some minor fixes
Signed-off-by: Peter Griffin Acked-by: Lee Jones --- .../devicetree/bindings/media/stih407-c8sectpfe.txt| 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt index 84ae9d1..4cb539d 100644 --- a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +++ b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt @@ -55,20 +55,20 @@ Example: status = "okay"; reg = <0x08a2 0x1>, <0x08a0 0x4000>; reg-names = "stfe", "stfe-ram"; - interrupts = <0 34 0>, <0 35 0>; + interrupts = , ; interrupt-names = "stfe-error-irq", "stfe-idle-irq"; - - pinctrl-names = "tsin0-serial", "tsin0-parallel", "tsin3-serial", - "tsin4-serial", "tsin5-serial"; - pinctrl-0 = <&pinctrl_tsin0_serial>; pinctrl-1 = <&pinctrl_tsin0_parallel>; pinctrl-2 = <&pinctrl_tsin3_serial>; pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; - + pinctrl-names = "tsin0-serial", + "tsin0-parallel", + "tsin3-serial", + "tsin4-serial", + "tsin5-serial"; clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; - clock-names = "stfe"; + clock-names = "c8sectpfe"; /* tsin0 is TSA on NIMA */ tsin0: port@0 { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 3/6] [media] c8sectpfe: Remove select on undefined LIBELF_32
LIBELF_32 is not defined in Kconfig, and is left over legacy which is not required in the upstream driver, so remove it. Suggested-by: Valentin Rothberg Signed-off-by: Peter Griffin Acked-by: Lee Jones --- drivers/media/platform/sti/c8sectpfe/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/sti/c8sectpfe/Kconfig b/drivers/media/platform/sti/c8sectpfe/Kconfig index d1bfd4c..b9ec667 100644 --- a/drivers/media/platform/sti/c8sectpfe/Kconfig +++ b/drivers/media/platform/sti/c8sectpfe/Kconfig @@ -1,7 +1,6 @@ config DVB_C8SECTPFE tristate "STMicroelectronics C8SECTPFE DVB support" depends on DVB_CORE && I2C && (ARCH_STI || ARCH_MULTIPLATFORM) - select LIBELF_32 select FW_LOADER select FW_LOADER_USER_HELPER_FALLBACK select DEBUG_FS -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 1/6] ARM: DT: STi: stihxxx-b2120: Add pulse-width properties to ssc2 & ssc3
Adding these properties makes the I2C bus to the demodulators much more reliable, and we no longer suffer from I2C errors when tuning. Signed-off-by: Peter Griffin Acked-by: Lee Jones --- arch/arm/boot/dts/stihxxx-b2120.dtsi | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index f589fe4..62994ae 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -27,12 +27,18 @@ }; }; - i2c@9842000 { + ssc2: i2c@9842000 { status = "okay"; + clock-frequency = <10>; + st,i2c-min-scl-pulse-width-us = <0>; + st,i2c-min-sda-pulse-width-us = <5>; }; - i2c@9843000 { + ssc3: i2c@9843000 { status = "okay"; + clock-frequency = <10>; + st,i2c-min-scl-pulse-width-us = <0>; + st,i2c-min-sda-pulse-width-us = <5>; }; i2c@9844000 { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 6/6] [media] c8sectpfe: Simplify for loop in load_slim_core_fw
Signed-off-by: Peter Griffin --- drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c index e19c6b4..782174a 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -1096,7 +1096,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) Elf32_Ehdr *ehdr; Elf32_Phdr *phdr; u8 __iomem *dst; - int err, i; + int err = 0, i; if (!fw || !context) return -EINVAL; @@ -1105,7 +1105,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) phdr = (Elf32_Phdr *)(fw->data + ehdr->e_phoff); /* go through the available ELF segments */ - for (i = 0; i < ehdr->e_phnum && !err; i++, phdr++) { + for (i = 0; i < ehdr->e_phnum; i++, phdr++) { /* Only consider LOAD segments */ if (phdr->p_type != PT_LOAD) @@ -1118,7 +1118,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) dev_err(fei->dev, "Segment %d is outside of firmware file\n", i); err = -EINVAL; - break; + goto err; } /* @@ -1146,6 +1146,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) } } +err: release_firmware(fw); return err; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios
Hi Javier, On Tue, 01 Sep 2015, Javier Martinez Canillas wrote: > Hello Lee, > > On Tue, Sep 1, 2015 at 11:09 AM, Lee Jones wrote: > > On Tue, 01 Sep 2015, Javier Martinez Canillas wrote: > >> On Fri, Aug 28, 2015 at 7:52 PM, Peter Griffin > >> wrote: > >> > gpio.txt documents that GPIO properties should be named > >> > "[-]gpios", with being the purpose of this > >> > GPIO for the device. > >> > > >> > This change has been done as one atomic commit. > >> > > >> > Signed-off-by: Peter Griffin > >> > Acked-by: Lee Jones > >> > --- > >> > Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++--- > >> > arch/arm/boot/dts/stihxxx-b2120.dtsi | 4 ++-- > >> > drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 2 +- > >> > 3 files changed, 6 insertions(+), 6 deletions(-) > >> > > >> > diff --git > >> > a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt > >> > b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt > >> > index d4def76..e70d840 100644 > >> > --- a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt > >> > +++ b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt > >> > @@ -35,7 +35,7 @@ Required properties (tsin (child) node): > >> > > >> > - tsin-num : tsin id of the InputBlock (must be between 0 to 6) > >> > - i2c-bus : phandle to the I2C bus DT node which the demodulators > >> > & tuners on this tsin channel are connected. > >> > -- rst-gpio : reset gpio for this tsin channel. > >> > +- reset-gpios : reset gpio for this tsin channel. > >> > >> The documentation is a bit outdated, the GPIO subsystem supports both > >> -gpio and -gpios, see commit: > >> > >> dd34c37aa3e8 ("gpio: of: Allow -gpio suffix for property names") > >> > >> So it makes sense to me to use -gpio instead of -gpios in this case > >> since is a single GPIO. Also rst is already a descriptive name since > >> that's how many datasheets name a reset pin. I'm not saying I'm > >> against this patch, just pointing out since the commit message is a > >> bit misleading. Ok thanks for pointing that out. It's nice to know the original binding was actually OK. > > > > As I suggested this patch, I feel I must comment. > > > > My order of preference would be: > > > > reset-gpio > > reset-gpios > > rst-gpio > > rst-gpios > > > > This current patch is No2, so it's okay to stay IMHO. > > > > If the property is being changed anyways, why not going with No1 then? I've changed to No1 in v4. > > As I said, I'm not against the patch but I think the commit message > has to be reworded since implies that the problem is that the -gpio > sufix is being used instead of -gpios. But since both are supported by > the GPIO subsystem, the commit should mention that "reset" is more > clear and easier to read than "rst" or something along those lines. I've re-worded the commit message like you suggest in v4 > > BTW, I just posted a patch for the GPIO doc to mention that -gpio is > also supported: > > https://patchwork.kernel.org/patch/7103761/ Ok thanks for the pointer. regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios
Hi Rob, On Mon, 31 Aug 2015, Rob Herring wrote: > On Fri, Aug 28, 2015 at 12:52 PM, Peter Griffin > wrote: > > gpio.txt documents that GPIO properties should be named > > "[-]gpios", with being the purpose of this > > GPIO for the device. > > > > This change has been done as one atomic commit. > > dtb and kernel updates are not necessarily atomic, so you are breaking > compatibility with older dtbs. You should certainly highlight that in > the commit message. I only point this out. I'll leave it to platform > maintainers whether or not this breakage is acceptable. Ok I will highlight that in the commit message of the next version. regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 0/6] [media] c8sectpfe: Various fixups
Hi Mauro, This series includes a couple of fixes for the c8sectpfe Linux dvb driver. One was caused by omitting a patch from the original c8sectpfe series which defined the ssc2 and ssc3 dt nodes, which was then used by the later DT patch. This patch is included, along with the original patch which you reverted. Also Valentin Rothberg spotted LIBELF32 Kconfig symbol I was selecting in the Kconfig, this isn't required upstream and is left over legacy so I've removed it. Also included are some fixups spotted by Lee Jones. Changes since v2: - Add some "\n" and other formatting fixes - 'Suggested by' should be in chronological order - Simplify load_slim_core_fw loop Changes since v1: - Various formating patches to DT node - Update to reset-gpios - Use GPIO_ACTIVE_HIGH, GIC_SPI and IRQ_TYPE_NONE defines kind regards, Peter. Peter Griffin (6): ARM: DT: STi: stihxxx-b2120: Add pulse-width properties to ssc2 & ssc3 ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node. [media] c8sectpfe: Remove select on undefined LIBELF_32 [media] c8sectpfe: Update binding to reset-gpios [media] c8sectpfe: Update DT binding doc with some minor fixes [media] c8sectpfe: Simplify for loop in load_slim_core_fw .../bindings/media/stih407-c8sectpfe.txt | 20 +- arch/arm/boot/dts/stihxxx-b2120.dtsi | 45 +- drivers/media/platform/sti/c8sectpfe/Kconfig | 1 - .../media/platform/sti/c8sectpfe/c8sectpfe-core.c | 9 +++-- 4 files changed, 58 insertions(+), 17 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 4/6] [media] c8sectpfe: Update binding to reset-gpios
gpio.txt documents that GPIO properties should be named "[-]gpios", with being the purpose of this GPIO for the device. This change has been done as one atomic commit. Signed-off-by: Peter Griffin Acked-by: Lee Jones --- Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++--- arch/arm/boot/dts/stihxxx-b2120.dtsi | 4 ++-- drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt index d4def76..e70d840 100644 --- a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +++ b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt @@ -35,7 +35,7 @@ Required properties (tsin (child) node): - tsin-num : tsin id of the InputBlock (must be between 0 to 6) - i2c-bus : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected. -- rst-gpio : reset gpio for this tsin channel. +- reset-gpios : reset gpio for this tsin channel. Optional properties (tsin (child) node): @@ -75,7 +75,7 @@ Example: tsin-num= <0>; serial-not-parallel; i2c-bus = <&ssc2>; - rst-gpio= <&pio15 4 0>; + reset-gpios = <&pio15 4 GPIO_ACTIVE_HIGH>; dvb-card= ; }; @@ -83,7 +83,7 @@ Example: tsin-num= <3>; serial-not-parallel; i2c-bus = <&ssc3>; - rst-gpio= <&pio15 7 0>; + reset-gpios = <&pio15 7 GPIO_ACTIVE_HIGH>; dvb-card= ; }; }; diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index f9fca10..0b7592e 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -6,8 +6,8 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - #include +#include #include / { soc { @@ -116,7 +116,7 @@ tsin-num= <0>; serial-not-parallel; i2c-bus = <&ssc2>; - rst-gpio= <&pio15 4 GPIO_ACTIVE_HIGH>; + reset-gpios = <&pio15 4 GPIO_ACTIVE_HIGH>; dvb-card= ; }; }; diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c index 3a91093..c691e13 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -822,7 +822,7 @@ static int c8sectpfe_probe(struct platform_device *pdev) } of_node_put(i2c_bus); - tsin->rst_gpio = of_get_named_gpio(child, "rst-gpio", 0); + tsin->rst_gpio = of_get_named_gpio(child, "reset-gpios", 0); ret = gpio_is_valid(tsin->rst_gpio); if (!ret) { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 2/6] ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node.
This patch adds in the required DT node for the c8sectpfe Linux DVB demux driver which allows the tsin channels to be used on an upstream kernel. Signed-off-by: Peter Griffin --- arch/arm/boot/dts/stihxxx-b2120.dtsi | 35 +++ 1 file changed, 35 insertions(+) diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index 62994ae..f9fca10 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -6,6 +6,9 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + +#include +#include / { soc { sbc_serial0: serial@953 { @@ -85,5 +88,37 @@ status = "okay"; }; + demux@08a2 { + compatible = "st,stih407-c8sectpfe"; + status = "okay"; + reg = <0x08a2 0x1>, + <0x08a0 0x4000>; + reg-names = "c8sectpfe", "c8sectpfe-ram"; + interrupts = , + ; + interrupt-names = "c8sectpfe-error-irq", + "c8sectpfe-idle-irq"; + pinctrl-0 = <&pinctrl_tsin0_serial>; + pinctrl-1 = <&pinctrl_tsin0_parallel>; + pinctrl-2 = <&pinctrl_tsin3_serial>; + pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; + pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; + pinctrl-names = "tsin0-serial", + "tsin0-parallel", + "tsin3-serial", + "tsin4-serial", + "tsin5-serial"; + clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; + clock-names = "c8sectpfe"; + + /* tsin0 is TSA on NIMA */ + tsin0: port@0 { + tsin-num= <0>; + serial-not-parallel; + i2c-bus = <&ssc2>; + rst-gpio= <&pio15 4 GPIO_ACTIVE_HIGH>; + dvb-card= ; + }; + }; }; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 1/6] ARM: DT: STi: stihxxx-b2120: Add pulse-width properties to ssc2 & ssc3
Adding these properties makes the I2C bus to the demodulators much more reliable, and we no longer suffer from I2C errors when tuning. Signed-off-by: Peter Griffin Acked-by: Lee Jones --- arch/arm/boot/dts/stihxxx-b2120.dtsi | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index f589fe4..62994ae 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -27,12 +27,18 @@ }; }; - i2c@9842000 { + ssc2: i2c@9842000 { status = "okay"; + clock-frequency = <10>; + st,i2c-min-scl-pulse-width-us = <0>; + st,i2c-min-sda-pulse-width-us = <5>; }; - i2c@9843000 { + ssc3: i2c@9843000 { status = "okay"; + clock-frequency = <10>; + st,i2c-min-scl-pulse-width-us = <0>; + st,i2c-min-sda-pulse-width-us = <5>; }; i2c@9844000 { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 3/6] [media] c8sectpfe: Remove select on undefined LIBELF_32
LIBELF_32 is not defined in Kconfig, and is left over legacy which is not required in the upstream driver, so remove it. Suggested-by: Valentin Rothberg Signed-off-by: Peter Griffin Acked-by: Lee Jones --- drivers/media/platform/sti/c8sectpfe/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/sti/c8sectpfe/Kconfig b/drivers/media/platform/sti/c8sectpfe/Kconfig index d1bfd4c..b9ec667 100644 --- a/drivers/media/platform/sti/c8sectpfe/Kconfig +++ b/drivers/media/platform/sti/c8sectpfe/Kconfig @@ -1,7 +1,6 @@ config DVB_C8SECTPFE tristate "STMicroelectronics C8SECTPFE DVB support" depends on DVB_CORE && I2C && (ARCH_STI || ARCH_MULTIPLATFORM) - select LIBELF_32 select FW_LOADER select FW_LOADER_USER_HELPER_FALLBACK select DEBUG_FS -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 5/6] [media] c8sectpfe: Update DT binding doc with some minor fixes
Signed-off-by: Peter Griffin Acked-by: Lee Jones --- .../devicetree/bindings/media/stih407-c8sectpfe.txt| 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt index e70d840..cc51b1f 100644 --- a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +++ b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt @@ -55,20 +55,20 @@ Example: status = "okay"; reg = <0x08a2 0x1>, <0x08a0 0x4000>; reg-names = "stfe", "stfe-ram"; - interrupts = <0 34 0>, <0 35 0>; + interrupts = , ; interrupt-names = "stfe-error-irq", "stfe-idle-irq"; - - pinctrl-names = "tsin0-serial", "tsin0-parallel", "tsin3-serial", - "tsin4-serial", "tsin5-serial"; - pinctrl-0 = <&pinctrl_tsin0_serial>; pinctrl-1 = <&pinctrl_tsin0_parallel>; pinctrl-2 = <&pinctrl_tsin3_serial>; pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; - + pinctrl-names = "tsin0-serial", + "tsin0-parallel", + "tsin3-serial", + "tsin4-serial", + "tsin5-serial"; clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; - clock-names = "stfe"; + clock-names = "c8sectpfe"; /* tsin0 is TSA on NIMA */ tsin0: port@0 { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 6/6] [media] c8sectpfe: Simplify for loop in load_slim_core_fw
Signed-off-by: Peter Griffin --- drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c index c691e13..ce72ffb 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -1096,7 +1096,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) Elf32_Ehdr *ehdr; Elf32_Phdr *phdr; u8 __iomem *dst; - int err, i; + int err = 0, i; if (!fw || !context) return -EINVAL; @@ -1105,7 +1105,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) phdr = (Elf32_Phdr *)(fw->data + ehdr->e_phoff); /* go through the available ELF segments */ - for (i = 0; i < ehdr->e_phnum && !err; i++, phdr++) { + for (i = 0; i < ehdr->e_phnum; i++, phdr++) { /* Only consider LOAD segments */ if (phdr->p_type != PT_LOAD) @@ -1118,7 +1118,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) dev_err(fei->dev, "Segment %d is outside of firmware file\n", i); err = -EINVAL; - break; + goto err; } /* @@ -1146,6 +1146,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context) } } +err: release_firmware(fw); return err; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 5/5] [media] c8sectpfe: Update DT binding doc with some minor fixes
Hi Lee, On Fri, 28 Aug 2015, Lee Jones wrote: > On Thu, 27 Aug 2015, Peter Griffin wrote: > > > Signed-off-by: Peter Griffin > > --- > > .../devicetree/bindings/media/stih407-c8sectpfe.txt | 16 > > +++- > > 1 file changed, 7 insertions(+), 9 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt > > b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt > > index e70d840..5d6438c 100644 > > --- a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt > > +++ b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt > > @@ -55,21 +55,20 @@ Example: > > status = "okay"; > > reg = <0x08a2 0x1>, <0x08a0 0x4000>; > > reg-names = "stfe", "stfe-ram"; > > - interrupts = <0 34 0>, <0 35 0>; > > + interrupts = , > IRQ_TYPE_NONE>; > > interrupt-names = "stfe-error-irq", "stfe-idle-irq"; > > - > > - pinctrl-names = "tsin0-serial", "tsin0-parallel", > > "tsin3-serial", > > - "tsin4-serial", "tsin5-serial"; > > - > > + pinctrl-names = "tsin0-serial", > > + "tsin0-parallel", > > + "tsin3-serial", > > + "tsin4-serial", > > + "tsin5-serial"; > > pinctrl-0 = <&pinctrl_tsin0_serial>; > > pinctrl-1 = <&pinctrl_tsin0_parallel>; > > pinctrl-2 = <&pinctrl_tsin3_serial>; > > pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; > > pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; > > - > > clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; > > - clock-names = "stfe"; > > - > > + clock-names = "c8sectpfe"; > > Are you sure you even need this property? I'm thinking that *-names > properties are *usually* only required if there are more than one in a > single property. Yes that is true, but for tsout and merged input stream functionality the driver will require additional clocks. As I mentioned in a previous email I hope to add support for this in the near future. > > > /* tsin0 is TSA on NIMA */ > > tsin0: port@0 { > > tsin-num= <0>; > > @@ -78,7 +77,6 @@ Example: > > reset-gpios = <&pio15 4 GPIO_ACTIVE_HIGH>; > > dvb-card= ; > > }; > > - > > My personal preference is to have a '\n' between nodes. Yes mine as well, I removed it due to your earlier comment about "superflous \n". I will add it back in again in v3. > > > tsin3: port@3 { > > tsin-num= <3>; > > serial-not-parallel; > > But these comments are pretty trivial, so agree or not, or fix-up or > not, it's that big of a deal. I agree all trivial, but will fixup in v3. > > Either way, > Acked-by: Lee Jones Thanks & regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 3/5] [media] c8sectpfe: Remove select on undefined LIBELF_32
Hi Lee, On Fri, 28 Aug 2015, Lee Jones wrote: > On Thu, 27 Aug 2015, Peter Griffin wrote: > > > LIBELF_32 is not defined in Kconfig, and is left over legacy > > which is not required in the upstream driver, so remove it. > > > > Signed-off-by: Peter Griffin > > Suggested-by: Valentin Rothberg > > These are the wrong way round, they should be in chronological order. Ok will fix in v3. regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 2/5] ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node.
Hi Lee, On Fri, 28 Aug 2015, Lee Jones wrote: > On Thu, 27 Aug 2015, Peter Griffin wrote: > > > This patch adds in the required DT node for the c8sectpfe > > Linux DVB demux driver which allows the tsin channels > > to be used on an upstream kernel. > > > > Signed-off-by: Peter Griffin > > --- > > arch/arm/boot/dts/stihxxx-b2120.dtsi | 34 > > ++ > > 1 file changed, 34 insertions(+) > > > > diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi > > b/arch/arm/boot/dts/stihxxx-b2120.dtsi > > index 62994ae..c014173 100644 > > --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi > > +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi > > @@ -6,6 +6,9 @@ > > * it under the terms of the GNU General Public License version 2 as > > * published by the Free Software Foundation. > > */ > > + > > +#include > > +#include > > / { > > soc { > > sbc_serial0: serial@953 { > > @@ -85,5 +88,36 @@ > > status = "okay"; > > }; > > > > + demux@08a2 { > > + compatible = "st,stih407-c8sectpfe"; > > + status = "okay"; > > + reg = <0x08a2 0x1>, > > + <0x08a0 0x4000>; > > These look like they're the wrong way round. No, it isn't the wrong way round. > > > + reg-names = "c8sectpfe", "c8sectpfe-ram"; > > + interrupts = , > > + ; > > + interrupt-names = "c8sectpfe-error-irq", > > + "c8sectpfe-idle-irq"; > > + pinctrl-names = "tsin0-serial", > > + "tsin0-parallel", > > + "tsin3-serial", > > + "tsin4-serial", > > + "tsin5-serial"; > > + pinctrl-0 = <&pinctrl_tsin0_serial>; > > + pinctrl-1 = <&pinctrl_tsin0_parallel>; > > + pinctrl-2 = <&pinctrl_tsin3_serial>; > > + pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; > > + pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; > > + clock-names = "c8sectpfe"; > > + clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; > > Personal preferenc is that the *-names properties should come *after* > the ones they reference. Ok, will fix this in v3. > > > + /* tsin0 is TSA on NIMA */ > > + tsin0: port@0 { > > + tsin-num= <0>; > > + serial-not-parallel; > > + i2c-bus = <&ssc2>; > > + rst-gpio= <&pio15 4 0>; > > "reset-gpios"? > > Use the GPIO DEFINES. This change is done in patch 4/5 as one atomic commit (code, dt doc, and dt node). I could have used the GPIO_DEFINE in this patch and updated the dt binding in 4/5. I'll do that in v3. regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 0/5] [media] c8sectpfe: Various fixups
Hi Mauro, This series includes a couple of fixes for the c8sectpfe Linux dvb driver. One was caused by omitting a patch from the original c8sectpfe series which defined the ssc2 and ssc3 dt nodes, which was then used by the later DT patch. This patch is included, along with the original patch which you reverted. Also Valentin Rothberg spotted LIBELF32 Kconfig symbol I was selecting in the Kconfig, this isn't required upstream and is left over legacy so I've removed it. Sorry for the delay in sending these fixes, I've been on holiday for the last 3 weeks. Changes since v1: - Various formating patches to DT node - Update to reset-gpios - Use GPIO_ACTIVE_HIGH, GIC_SPI and IRQ_TYPE_NONE defines kind regards, Peter. Peter Griffin (5): ARM: DT: STi: stihxxx-b2120: Add pulse-width properties to ssc2 & ssc3 ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node. [media] c8sectpfe: Remove select on undefined LIBELF_32 [media] c8sectpfe: Update binding to reset-gpios [media] c8sectpfe: Update DT binding doc with some minor fixes .../bindings/media/stih407-c8sectpfe.txt | 22 +-- arch/arm/boot/dts/stihxxx-b2120.dtsi | 44 +- drivers/media/platform/sti/c8sectpfe/Kconfig | 1 - .../media/platform/sti/c8sectpfe/c8sectpfe-core.c | 2 +- 4 files changed, 53 insertions(+), 16 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 2/5] ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node.
This patch adds in the required DT node for the c8sectpfe Linux DVB demux driver which allows the tsin channels to be used on an upstream kernel. Signed-off-by: Peter Griffin --- arch/arm/boot/dts/stihxxx-b2120.dtsi | 34 ++ 1 file changed, 34 insertions(+) diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index 62994ae..c014173 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -6,6 +6,9 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + +#include +#include / { soc { sbc_serial0: serial@953 { @@ -85,5 +88,36 @@ status = "okay"; }; + demux@08a2 { + compatible = "st,stih407-c8sectpfe"; + status = "okay"; + reg = <0x08a2 0x1>, + <0x08a0 0x4000>; + reg-names = "c8sectpfe", "c8sectpfe-ram"; + interrupts = , + ; + interrupt-names = "c8sectpfe-error-irq", + "c8sectpfe-idle-irq"; + pinctrl-names = "tsin0-serial", + "tsin0-parallel", + "tsin3-serial", + "tsin4-serial", + "tsin5-serial"; + pinctrl-0 = <&pinctrl_tsin0_serial>; + pinctrl-1 = <&pinctrl_tsin0_parallel>; + pinctrl-2 = <&pinctrl_tsin3_serial>; + pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; + pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; + clock-names = "c8sectpfe"; + clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; + /* tsin0 is TSA on NIMA */ + tsin0: port@0 { + tsin-num= <0>; + serial-not-parallel; + i2c-bus = <&ssc2>; + rst-gpio= <&pio15 4 0>; + dvb-card= ; + }; + }; }; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 4/5] [media] c8sectpfe: Update binding to reset-gpios
gpio.txt documents that GPIO properties should be named "[-]gpios", with being the purpose of this GPIO for the device. This change has been done as one atomic commit. Signed-off-by: Peter Griffin --- Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt | 6 +++--- arch/arm/boot/dts/stihxxx-b2120.dtsi | 4 ++-- drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt index d4def76..e70d840 100644 --- a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +++ b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt @@ -35,7 +35,7 @@ Required properties (tsin (child) node): - tsin-num : tsin id of the InputBlock (must be between 0 to 6) - i2c-bus : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected. -- rst-gpio : reset gpio for this tsin channel. +- reset-gpios : reset gpio for this tsin channel. Optional properties (tsin (child) node): @@ -75,7 +75,7 @@ Example: tsin-num= <0>; serial-not-parallel; i2c-bus = <&ssc2>; - rst-gpio= <&pio15 4 0>; + reset-gpios = <&pio15 4 GPIO_ACTIVE_HIGH>; dvb-card= ; }; @@ -83,7 +83,7 @@ Example: tsin-num= <3>; serial-not-parallel; i2c-bus = <&ssc3>; - rst-gpio= <&pio15 7 0>; + reset-gpios = <&pio15 7 GPIO_ACTIVE_HIGH>; dvb-card= ; }; }; diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index c014173..f932bfd 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -6,8 +6,8 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - #include +#include #include / { soc { @@ -115,7 +115,7 @@ tsin-num= <0>; serial-not-parallel; i2c-bus = <&ssc2>; - rst-gpio= <&pio15 4 0>; + reset-gpios = <&pio15 4 GPIO_ACTIVE_HIGH>; dvb-card= ; }; }; diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c index 3a91093..c691e13 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -822,7 +822,7 @@ static int c8sectpfe_probe(struct platform_device *pdev) } of_node_put(i2c_bus); - tsin->rst_gpio = of_get_named_gpio(child, "rst-gpio", 0); + tsin->rst_gpio = of_get_named_gpio(child, "reset-gpios", 0); ret = gpio_is_valid(tsin->rst_gpio); if (!ret) { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 3/5] [media] c8sectpfe: Remove select on undefined LIBELF_32
LIBELF_32 is not defined in Kconfig, and is left over legacy which is not required in the upstream driver, so remove it. Signed-off-by: Peter Griffin Suggested-by: Valentin Rothberg --- drivers/media/platform/sti/c8sectpfe/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/sti/c8sectpfe/Kconfig b/drivers/media/platform/sti/c8sectpfe/Kconfig index d1bfd4c..b9ec667 100644 --- a/drivers/media/platform/sti/c8sectpfe/Kconfig +++ b/drivers/media/platform/sti/c8sectpfe/Kconfig @@ -1,7 +1,6 @@ config DVB_C8SECTPFE tristate "STMicroelectronics C8SECTPFE DVB support" depends on DVB_CORE && I2C && (ARCH_STI || ARCH_MULTIPLATFORM) - select LIBELF_32 select FW_LOADER select FW_LOADER_USER_HELPER_FALLBACK select DEBUG_FS -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 5/5] [media] c8sectpfe: Update DT binding doc with some minor fixes
Signed-off-by: Peter Griffin --- .../devicetree/bindings/media/stih407-c8sectpfe.txt | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt index e70d840..5d6438c 100644 --- a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt +++ b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt @@ -55,21 +55,20 @@ Example: status = "okay"; reg = <0x08a2 0x1>, <0x08a0 0x4000>; reg-names = "stfe", "stfe-ram"; - interrupts = <0 34 0>, <0 35 0>; + interrupts = , ; interrupt-names = "stfe-error-irq", "stfe-idle-irq"; - - pinctrl-names = "tsin0-serial", "tsin0-parallel", "tsin3-serial", - "tsin4-serial", "tsin5-serial"; - + pinctrl-names = "tsin0-serial", + "tsin0-parallel", + "tsin3-serial", + "tsin4-serial", + "tsin5-serial"; pinctrl-0 = <&pinctrl_tsin0_serial>; pinctrl-1 = <&pinctrl_tsin0_parallel>; pinctrl-2 = <&pinctrl_tsin3_serial>; pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; - clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; - clock-names = "stfe"; - + clock-names = "c8sectpfe"; /* tsin0 is TSA on NIMA */ tsin0: port@0 { tsin-num= <0>; @@ -78,7 +77,6 @@ Example: reset-gpios = <&pio15 4 GPIO_ACTIVE_HIGH>; dvb-card= ; }; - tsin3: port@3 { tsin-num= <3>; serial-not-parallel; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 1/5] ARM: DT: STi: stihxxx-b2120: Add pulse-width properties to ssc2 & ssc3
Adding these properties makes the I2C bus to the demodulators much more reliable, and we no longer suffer from I2C errors when tuning. Signed-off-by: Peter Griffin --- arch/arm/boot/dts/stihxxx-b2120.dtsi | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index f589fe4..62994ae 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -27,12 +27,18 @@ }; }; - i2c@9842000 { + ssc2: i2c@9842000 { status = "okay"; + clock-frequency = <10>; + st,i2c-min-scl-pulse-width-us = <0>; + st,i2c-min-sda-pulse-width-us = <5>; }; - i2c@9843000 { + ssc3: i2c@9843000 { status = "okay"; + clock-frequency = <10>; + st,i2c-min-scl-pulse-width-us = <0>; + st,i2c-min-sda-pulse-width-us = <5>; }; i2c@9844000 { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 05/11] ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node.
Hi Mauro, On Mon, 17 Aug 2015, Mauro Carvalho Chehab wrote: > Em Thu, 30 Jul 2015 18:08:55 +0100 > Peter Griffin escreveu: > > > This patch adds in the required DT node for the c8sectpfe > > Linux DVB demux driver which allows the tsin channels > > to be used on an upstream kernel. > > > > Signed-off-by: Peter Griffin > > --- > > arch/arm/boot/dts/stihxxx-b2120.dtsi | 38 > > > > 1 file changed, 38 insertions(+) > > > > diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi > > b/arch/arm/boot/dts/stihxxx-b2120.dtsi > > index 62994ae..1bc018e 100644 > > --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi > > +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi > > @@ -6,6 +6,10 @@ > > * it under the terms of the GNU General Public License version 2 as > > * published by the Free Software Foundation. > > */ > > + > > +#include > > +#include > > + > > / { > > soc { > > sbc_serial0: serial@953 { > > @@ -85,5 +89,39 @@ > > status = "okay"; > > }; > > > > + c8sectpfe@08a2 { > > + compatible = "st,stih407-c8sectpfe"; > > + status = "okay"; > > + reg = <0x08a2 0x1>, <0x08a0 0x4000>; > > + reg-names = "c8sectpfe", "c8sectpfe-ram"; > > + > > + interrupts = <0 34 0>, <0 35 0>; > > + interrupt-names = "c8sectpfe-error-irq", > > + "c8sectpfe-idle-irq"; > > + > > + pinctrl-names = "tsin0-serial", "tsin0-parallel", > > + "tsin3-serial", "tsin4-serial", > > + "tsin5-serial"; > > + > > + pinctrl-0 = <&pinctrl_tsin0_serial>; > > + pinctrl-1 = <&pinctrl_tsin0_parallel>; > > + pinctrl-2 = <&pinctrl_tsin3_serial>; > > + pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; > > + pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; > > + > > + clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; > > + clock-names = "c8sectpfe"; > > + > > + /* tsin0 is TSA on NIMA */ > > + tsin0: port@0 { > > + > > + tsin-num = <0>; > > + serial-not-parallel; > > + i2c-bus = <&ssc2>; > > There's no ssc2 defined at the device tree. Whoops, I missed one patch off from the series in v2. > > I'll revert this patch and mark the driver as broken until this gets > fixed. I just sent you another series here https://lkml.org/lkml/2015/8/25/499 which includes this patch, and also the patch which adds ssc2/3, along with a fix to the Kconfig file spotted by Valentin Rothberg. regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 02/11] [media] stv0367: Add support for 16Mhz reference clock
The B2100A dvb NIM card from ST has 2x stv0367 demodulators and 2x TDA18212 silicon tuners, with a 16Mhz crystal. To get this working properly with the upstream driver we need to add support for the 16Mhz reference clock. Signed-off-by: Peter Griffin --- drivers/media/dvb-frontends/stv0367.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/dvb-frontends/stv0367.c index 9a49db1..44cb73f 100644 --- a/drivers/media/dvb-frontends/stv0367.c +++ b/drivers/media/dvb-frontends/stv0367.c @@ -1554,6 +1554,11 @@ static int stv0367ter_init(struct dvb_frontend *fe) switch (state->config->xtal) { /*set internal freq to 53.125MHz */ + case 1600: + stv0367_writereg(state, R367TER_PLLMDIV, 0x2); + stv0367_writereg(state, R367TER_PLLNDIV, 0x1b); + stv0367_writereg(state, R367TER_PLLSETUP, 0x18); + break; case 2500: stv0367_writereg(state, R367TER_PLLMDIV, 0xa); stv0367_writereg(state, R367TER_PLLNDIV, 0x55); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 00/11] Add c8sectpfe LinuxDVB demux driver
Hi Maruro and linux-media folks, This patchset adds support for a LinuxDVB demux driver for the ST STB stih407 family SoC's. Mauro - it is what I spoke to you about when we met at ELC-E in Dusseldorf last year. One big advantage of having a upstream demux driver for ST SoC's is that it will be easier to maintain support for the ST demodulators and tuners which are already upstream (and also add support for newer demods such as the stv6120 and stv910). As this driver allows ST NIM reference boards (which typically have a tuner/demod combination on) to be used easily with a upstream kernel on ST STB reference designs. Up until now it is not easy to test stv0367, stv6110 stv90x.c demod and tuner drivers which are supported upstream with ST STB reference hardware, and as such makes helping support these devices difficult. It also furthers the aim of having a completely open source A/V pipeline for STi chipsets. A upstream DRM driver is already merged for STi SoC's. ALSA SoC is current under review, and when this driver is accepted we would have a totaly open source frontend support (tuner->demod->demux) :-) This initial patchset adds support for the following demux HW called c8sectpfe: - * Input Block HW * HW PID filtering * memdma engine (moves TS from input block sram to RAM) The driver creates one Linux DVB adapter, and each tsin channel which is described in DT has a set of LDVB device nodes. Currently the driver supports 7 tsin channels. This driver has been tested with the stih407-b2120 board and stih410-b2120 reference design boards, and currently we support the following DVB fronend cards: - STMicroelectronics DVB-T B2100A (STV0367 + TDA18212) - STMicroelectronics DVB-S/S2 STV0903 + STV6110 + LNBP24 board This patchset also includes some small changes to stv0367.c to get the upstream driver working correctly with the ST NIM reference board. Also Joe Perches dvb-pll patch is included with this series. regards, Peter. Changes since v1: - Rebase patches on v4.2-rc3 (Peter) - Rework firmware loading mechanism to be async (Peter) - Rework ELF firmware loading code (Peter) - Add support for 8192 special PID (Peter) - Fixup Kconfig depedencies for c8sectpfe (Peter) - Fix typo in Makefile rule for c8sectpfe-debugfs (Paul) - Include Joe Perches dvb-pll patch as requested by (Mauro) - Remove BUG_ON from various places (Mauro) - Drop THOMSON DTT7546X tuner support (rework based on tuner-simple later) (Mike) - Move driver to drivers/media/platform/sti/c8sectpfe/ - usleep_range instead of msleep (Mauro) Joe Perches (1): dvb-pll: Convert struct dvb_pll_desc uses to const. Peter Griffin (10): [media] stv0367: Refine i2c error trace to include i2c address [media] stv0367: Add support for 16Mhz reference clock [media] c8sectpfe: Add DT bindings documentation for c8sectpfe driver. ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node. [media] c8sectpfe: STiH407/10 Linux DVB demux support [media] c8sectpfe: Add LDVB helper functions. [media] c8sectpfe: Add support for various ST NIM cards. [media] c8sectpfe: Add c8sectpfe debugfs support. [media] c8sectpfe: Add Kconfig and Makefile for the driver. MAINTAINERS: Add c8sectpfe driver directory to STi section .../bindings/media/stih407-c8sectpfe.txt | 89 ++ MAINTAINERS|1 + arch/arm/boot/dts/stihxxx-b2120.dtsi | 38 + drivers/media/dvb-frontends/dvb-pll.c | 50 +- drivers/media/dvb-frontends/stv0367.c | 17 +- drivers/media/platform/Kconfig |4 +- drivers/media/platform/Makefile|1 + drivers/media/platform/sti/c8sectpfe/Kconfig | 28 + drivers/media/platform/sti/c8sectpfe/Makefile |9 + .../platform/sti/c8sectpfe/c8sectpfe-common.c | 265 + .../platform/sti/c8sectpfe/c8sectpfe-common.h | 64 + .../media/platform/sti/c8sectpfe/c8sectpfe-core.c | 1235 .../media/platform/sti/c8sectpfe/c8sectpfe-core.h | 288 + .../platform/sti/c8sectpfe/c8sectpfe-debugfs.c | 271 + .../platform/sti/c8sectpfe/c8sectpfe-debugfs.h | 26 + .../media/platform/sti/c8sectpfe/c8sectpfe-dvb.c | 244 .../media/platform/sti/c8sectpfe/c8sectpfe-dvb.h | 20 + include/dt-bindings/media/c8sectpfe.h | 12 + 18 files changed, 2632 insertions(+), 30 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt create mode 100644 drivers/media/platform/sti/c8sectpfe/Kconfig create mode 100644 drivers/media/platform/sti/c8sectpfe/Makefile create mode 100644 drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.c create mode 100644 drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.h create mode 100644 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c create mode 100644 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.h create mode 100644 drive
[PATCH v2 03/11] dvb-pll: Convert struct dvb_pll_desc uses to const.
From: Joe Perches Convert the struct dvb_pll_desc uses to const and change the "entries" fixed array size from 12 to [] It saves a couple KB overall and remove ~5KB of data. $ size drivers/media/dvb-frontends/dvb-pll.o* textdata bss dec hex filename 852015522120 121922fa0 drivers/media/dvb-frontends/dvb-pll.o.new 562463632120 14107371b drivers/media/dvb-frontends/dvb-pll.o.old [PG] Patch taken from https://lkml.org/lkml/2015/6/24/721 with commit message updated. Signed-off-by: Joe Perches Signed-off-by: Peter Griffin Reviewed-by: Michael Ira Krufky --- drivers/media/dvb-frontends/dvb-pll.c | 50 +-- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/media/dvb-frontends/dvb-pll.c b/drivers/media/dvb-frontends/dvb-pll.c index 6d8fe88..53089e1 100644 --- a/drivers/media/dvb-frontends/dvb-pll.c +++ b/drivers/media/dvb-frontends/dvb-pll.c @@ -34,7 +34,7 @@ struct dvb_pll_priv { struct i2c_adapter *i2c; /* the PLL descriptor */ - struct dvb_pll_desc *pll_desc; + const struct dvb_pll_desc *pll_desc; /* cached frequency/bandwidth */ u32 frequency; @@ -57,7 +57,7 @@ MODULE_PARM_DESC(id, "force pll id to use (DEBUG ONLY)"); /* --- */ struct dvb_pll_desc { - char *name; + const char *name; u32 min; u32 max; u32 iffreq; @@ -71,13 +71,13 @@ struct dvb_pll_desc { u32 stepsize; u8 config; u8 cb; - } entries[12]; + } entries[]; }; /* --- */ /* descriptions*/ -static struct dvb_pll_desc dvb_pll_thomson_dtt7579 = { +static const struct dvb_pll_desc dvb_pll_thomson_dtt7579 = { .name = "Thomson dtt7579", .min = 17700, .max = 85800, @@ -99,7 +99,7 @@ static void thomson_dtt759x_bw(struct dvb_frontend *fe, u8 *buf) buf[3] |= 0x10; } -static struct dvb_pll_desc dvb_pll_thomson_dtt759x = { +static const struct dvb_pll_desc dvb_pll_thomson_dtt759x = { .name = "Thomson dtt759x", .min = 17700, .max = 89600, @@ -123,7 +123,7 @@ static void thomson_dtt7520x_bw(struct dvb_frontend *fe, u8 *buf) buf[3] ^= 0x10; } -static struct dvb_pll_desc dvb_pll_thomson_dtt7520x = { +static const struct dvb_pll_desc dvb_pll_thomson_dtt7520x = { .name = "Thomson dtt7520x", .min = 18500, .max = 9, @@ -141,7 +141,7 @@ static struct dvb_pll_desc dvb_pll_thomson_dtt7520x = { }, }; -static struct dvb_pll_desc dvb_pll_lg_z201 = { +static const struct dvb_pll_desc dvb_pll_lg_z201 = { .name = "LG z201", .min = 17400, .max = 86200, @@ -157,7 +157,7 @@ static struct dvb_pll_desc dvb_pll_lg_z201 = { }, }; -static struct dvb_pll_desc dvb_pll_unknown_1 = { +static const struct dvb_pll_desc dvb_pll_unknown_1 = { .name = "unknown 1", /* used by dntv live dvb-t */ .min = 17400, .max = 86200, @@ -179,7 +179,7 @@ static struct dvb_pll_desc dvb_pll_unknown_1 = { /* Infineon TUA6010XS * used in Thomson Cable Tuner */ -static struct dvb_pll_desc dvb_pll_tua6010xs = { +static const struct dvb_pll_desc dvb_pll_tua6010xs = { .name = "Infineon TUA6010XS", .min = 4425, .max = 85800, @@ -193,7 +193,7 @@ static struct dvb_pll_desc dvb_pll_tua6010xs = { }; /* Panasonic env57h1xd5 (some Philips PLL ?) */ -static struct dvb_pll_desc dvb_pll_env57h1xd5 = { +static const struct dvb_pll_desc dvb_pll_env57h1xd5 = { .name = "Panasonic ENV57H1XD5", .min = 4425, .max = 85800, @@ -217,7 +217,7 @@ static void tda665x_bw(struct dvb_frontend *fe, u8 *buf) buf[3] |= 0x08; } -static struct dvb_pll_desc dvb_pll_tda665x = { +static const struct dvb_pll_desc dvb_pll_tda665x = { .name = "Philips TDA6650/TDA6651", .min = 4425, .max = 85800, @@ -251,7 +251,7 @@ static void tua6034_bw(struct dvb_frontend *fe, u8 *buf) buf[3] |= 0x08; } -static struct dvb_pll_desc dvb_pll_tua6034 = { +static const struct dvb_pll_desc dvb_pll_tua6034 = { .name = "Infineon TUA6034", .min = 4425, .max = 85800, @@ -275,7 +275,7 @@ static void tded4_bw(struct dvb_frontend *fe, u8 *buf) buf[3] |= 0x04; } -static struct dvb_pll_desc dvb_pll_tded4 = { +static const struct dvb_pll_desc dvb_pll_tded4 = { .name = "ALPS TDED4", .min = 4700, .max = 86300, @@ -293,7 +293,7 @@ st
[PATCH v2 01/11] [media] stv0367: Refine i2c error trace to include i2c address
When using stv0367 demodulator with STi STB platforms, we can have easily have four or more stv0367 demods running in the system at one time. As typically the b2120 reference design ships with a b2004a daughter board, which can accept two dvb NIM cards, and each b2100A NIM has 2x stv0367 demods and 2x NXPs tuner on it. In such circumstances it is useful to print the i2c address on error messages to know which one is failing due to I2C issues. Signed-off-by: Peter Griffin --- drivers/media/dvb-frontends/stv0367.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/dvb-frontends/stv0367.c index ec3e18e..9a49db1 100644 --- a/drivers/media/dvb-frontends/stv0367.c +++ b/drivers/media/dvb-frontends/stv0367.c @@ -791,11 +791,13 @@ int stv0367_writeregs(struct stv0367_state *state, u16 reg, u8 *data, int len) memcpy(buf + 2, data, len); if (i2cdebug) - printk(KERN_DEBUG "%s: %02x: %02x\n", __func__, reg, buf[2]); + printk(KERN_DEBUG "%s: [%02x] %02x: %02x\n", __func__, + state->config->demod_address, reg, buf[2]); ret = i2c_transfer(state->i2c, &msg, 1); if (ret != 1) - printk(KERN_ERR "%s: i2c write error!\n", __func__); + printk(KERN_ERR "%s: i2c write error! ([%02x] %02x: %02x)\n", + __func__, state->config->demod_address, reg, buf[2]); return (ret != 1) ? -EREMOTEIO : 0; } @@ -829,10 +831,12 @@ static u8 stv0367_readreg(struct stv0367_state *state, u16 reg) ret = i2c_transfer(state->i2c, msg, 2); if (ret != 2) - printk(KERN_ERR "%s: i2c read error\n", __func__); + printk(KERN_ERR "%s: i2c read error ([%02x] %02x: %02x)\n", + __func__, state->config->demod_address, reg, b1[0]); if (i2cdebug) - printk(KERN_DEBUG "%s: %02x: %02x\n", __func__, reg, b1[0]); + printk(KERN_DEBUG "%s: [%02x] %02x: %02x\n", __func__, + state->config->demod_address, reg, b1[0]); return b1[0]; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 04/11] [media] c8sectpfe: Add DT bindings documentation for c8sectpfe driver.
This patch adds the DT bindings documentation for the c8sectpfe LinuxDVB demux driver whose IP is in the STiH407 family silicon SoC's. Signed-off-by: Peter Griffin --- .../bindings/media/stih407-c8sectpfe.txt | 89 ++ include/dt-bindings/media/c8sectpfe.h | 12 +++ 2 files changed, 101 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt create mode 100644 include/dt-bindings/media/c8sectpfe.h diff --git a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt new file mode 100644 index 000..d4def76 --- /dev/null +++ b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt @@ -0,0 +1,89 @@ +STMicroelectronics STi c8sectpfe binding + + +This document describes the c8sectpfe device bindings that is used to get transport +stream data into the SoC on the TS pins, and into DDR for further processing. + +It is typically used in conjunction with one or more demodulator and tuner devices +which converts from the RF to digital domain. Demodulators and tuners are usually +located on an external DVB frontend card connected to SoC TS input pins. + +Currently 7 TS input (tsin) channels are supported on the stih407 family SoC. + +Required properties (controller (parent) node): +- compatible : Should be "stih407-c8sectpfe" + +- reg : Address and length of register sets for each device in + "reg-names" + +- reg-names: The names of the register addresses corresponding to the + registers filled in "reg": + - c8sectpfe: c8sectpfe registers + - c8sectpfe-ram: c8sectpfe internal sram + +- clocks : phandle list of c8sectpfe clocks +- clock-names : should be "c8sectpfe" +See: Documentation/devicetree/bindings/clock/clock-bindings.txt + +- pinctrl-names: a pinctrl state named tsin%d-serial or tsin%d-parallel (where %d is tsin-num) + must be defined for each tsin child node. +- pinctrl-0: phandle referencing pin configuration for this tsin configuration +See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt + + +Required properties (tsin (child) node): + +- tsin-num : tsin id of the InputBlock (must be between 0 to 6) +- i2c-bus : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected. +- rst-gpio : reset gpio for this tsin channel. + +Optional properties (tsin (child) node): + +- invert-ts-clk: Bool property to control sense of ts input clock (data stored on falling edge of clk). +- serial-not-parallel : Bool property to configure input bus width (serial on ts_data<7>). +- async-not-sync : Bool property to control if data is received in asynchronous mode + (all bits/bytes with ts_valid or ts_packet asserted are valid). + +- dvb-card : Describes the NIM card connected to this tsin channel. + +Example: + +/* stih410 SoC b2120 + b2004a + stv0367-pll(NIMB) + stv0367-tda18212 (NIMA) DT example) */ + + c8sectpfe@08a2 { + compatible = "st,stih407-c8sectpfe"; + status = "okay"; + reg = <0x08a2 0x1>, <0x08a0 0x4000>; + reg-names = "stfe", "stfe-ram"; + interrupts = <0 34 0>, <0 35 0>; + interrupt-names = "stfe-error-irq", "stfe-idle-irq"; + + pinctrl-names = "tsin0-serial", "tsin0-parallel", "tsin3-serial", + "tsin4-serial", "tsin5-serial"; + + pinctrl-0 = <&pinctrl_tsin0_serial>; + pinctrl-1 = <&pinctrl_tsin0_parallel>; + pinctrl-2 = <&pinctrl_tsin3_serial>; + pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; + pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; + + clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; + clock-names = "stfe"; + + /* tsin0 is TSA on NIMA */ + tsin0: port@0 { + tsin-num= <0>; + serial-not-parallel; + i2c-bus = <&ssc2>; + rst-gpio= <&pio15 4 0>; + dvb-card= ; + }; + + tsin3: port@3 { + tsin-num= <3>; + serial-not-parallel; + i2c-bus = <&ssc3>; +
[PATCH v2 06/11] [media] c8sectpfe: STiH407/10 Linux DVB demux support
This patch adds support for the c8sectpfe input HW found on STiH407/410 SoC's. It currently supports the TS input block, memdma engine and hw PID filtering blocks of the C8SECTPFE subsystem. The driver creates one LinuxDVB adapter, and a demux/dvr/frontend set of devices for each tsin channel which is specificed in the DT. It has been tested with multiple tsin channels tuned, locked, and grabbing TS simultaneously. Signed-off-by: Peter Griffin --- .../media/platform/sti/c8sectpfe/c8sectpfe-core.c | 1235 .../media/platform/sti/c8sectpfe/c8sectpfe-core.h | 288 + 2 files changed, 1523 insertions(+) create mode 100644 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c create mode 100644 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.h diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c new file mode 100644 index 000..3a91093 --- /dev/null +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c @@ -0,0 +1,1235 @@ +/* + * c8sectpfe-core.c - C8SECTPFE STi DVB driver + * + * Copyright (c) STMicroelectronics 2015 + * + * Author:Peter Bennett + * Peter Griffin + * + * 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. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "c8sectpfe-core.h" +#include "c8sectpfe-common.h" +#include "c8sectpfe-debugfs.h" +#include "dmxdev.h" +#include "dvb_demux.h" +#include "dvb_frontend.h" +#include "dvb_net.h" + +#define FIRMWARE_MEMDMA "pti_memdma_h407.elf" +MODULE_FIRMWARE(FIRMWARE_MEMDMA); + +#define PID_TABLE_SIZE 1024 +#define POLL_MSECS 50 + +static int load_c8sectpfe_fw_step1(struct c8sectpfei *fei); + +#define TS_PKT_SIZE 188 +#define HEADER_SIZE (4) +#define PACKET_SIZE (TS_PKT_SIZE+HEADER_SIZE) + +#define FEI_ALIGNMENT (32) +/* hw requires minimum of 8*PACKET_SIZE and padded to 8byte boundary */ +#define FEI_BUFFER_SIZE (8*PACKET_SIZE*340) + +#define FIFO_LEN 1024 + +static void c8sectpfe_timer_interrupt(unsigned long ac8sectpfei) +{ + struct c8sectpfei *fei = (struct c8sectpfei *)ac8sectpfei; + struct channel_info *channel; + int chan_num; + + /* iterate through input block channels */ + for (chan_num = 0; chan_num < fei->tsin_count; chan_num++) { + channel = fei->channel_data[chan_num]; + + /* is this descriptor initialised and TP enabled */ + if (channel->irec && readl(channel->irec + DMA_PRDS_TPENABLE)) + tasklet_schedule(&channel->tsklet); + } + + fei->timer.expires = jiffies + msecs_to_jiffies(POLL_MSECS); + add_timer(&fei->timer); +} + +static void channel_swdemux_tsklet(unsigned long data) +{ + struct channel_info *channel = (struct channel_info *)data; + struct c8sectpfei *fei = channel->fei; + unsigned long wp, rp; + int pos, num_packets, n, size; + u8 *buf; + + if (unlikely(!channel || !channel->irec)) + return; + + wp = readl(channel->irec + DMA_PRDS_BUSWP_TP(0)); + rp = readl(channel->irec + DMA_PRDS_BUSRP_TP(0)); + + pos = rp - channel->back_buffer_busaddr; + + /* has it wrapped */ + if (wp < rp) + wp = channel->back_buffer_busaddr + FEI_BUFFER_SIZE; + + size = wp - rp; + num_packets = size / PACKET_SIZE; + + /* manage cache so data is visible to CPU */ + dma_sync_single_for_cpu(fei->dev, + rp, + size, + DMA_FROM_DEVICE); + + buf = (u8 *) channel->back_buffer_aligned; + + dev_dbg(fei->dev, + "chan=%d channel=%p num_packets = %d, buf = %p, pos = 0x%x\n\t" + "rp=0x%lx, wp=0x%lx\n", + channel->tsin_id, channel, num_packets, buf, pos, rp, wp); + + for (n = 0; n < num_packets; n++) { + dvb_dmx_swfilter_packets( + &fei->c8sectpfe[0]-> + demux[channel->demux_mapping].dvb_demux, + &buf[pos], 1); + + pos += PACKET_SIZE; + } + + /* advance the read pointer */ + if (wp == (channel->back_buffer_busaddr + FEI_BUFFER_SIZE)) + writel(channel->back_buffer_busaddr, channel->irec + + DM
[PATCH v2 08/11] [media] c8sectpfe: Add support for various ST NIM cards.
This patch adds support for the following 2 NIM cards: - 1) B2100A (2x stv0367 demods & 2x NXP tda18212 tuners) 2) STV0903-6110NIM (stv0903 demod + 6110 tuner, lnb24) A NIM card is a cold plugable expansion card which usually features a demodulator / tuner combination. Signed-off-by: Peter Griffin --- .../media/platform/sti/c8sectpfe/c8sectpfe-dvb.c | 244 + .../media/platform/sti/c8sectpfe/c8sectpfe-dvb.h | 20 ++ 2 files changed, 264 insertions(+) create mode 100644 drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c create mode 100644 drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.h diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c new file mode 100644 index 000..69d7fe4 --- /dev/null +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c @@ -0,0 +1,244 @@ +/* + * c8sectpfe-dvb.c - C8SECTPFE STi DVB driver + * + * Copyright (c) STMicroelectronics 2015 + * + * Author Peter Griffin + * + * 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 +#include +#include +#include + +#include + +#include "c8sectpfe-common.h" +#include "c8sectpfe-core.h" +#include "c8sectpfe-dvb.h" + +#include "dvb-pll.h" +#include "lnbh24.h" +#include "stv0367.h" +#include "stv0367_priv.h" +#include "stv6110x.h" +#include "stv090x.h" +#include "tda18212.h" + +static inline const char *dvb_card_str(unsigned int c) +{ + switch (c) { + case STV0367_TDA18212_NIMA_1: return "STV0367_TDA18212_NIMA_1"; + case STV0367_TDA18212_NIMA_2: return "STV0367_TDA18212_NIMA_2"; + case STV0367_TDA18212_NIMB_1: return "STV0367_TDA18212_NIMB_1"; + case STV0367_TDA18212_NIMB_2: return "STV0367_TDA18212_NIMB_2"; + case STV0903_6110_LNB24_NIMA: return "STV0903_6110_LNB24_NIMA"; + case STV0903_6110_LNB24_NIMB: return "STV0903_6110_LNB24_NIMB"; + default:return "unknown dvb frontend card"; + } +} + +static struct stv090x_config stv090x_config = { + .device = STV0903, + .demod_mode = STV090x_SINGLE, + .clk_mode = STV090x_CLK_EXT, + .xtal = 1600, + .address= 0x69, + + .ts1_mode = STV090x_TSMODE_SERIAL_CONTINUOUS, + .ts2_mode = STV090x_TSMODE_SERIAL_CONTINUOUS, + + .repeater_level = STV090x_RPTLEVEL_64, + + .tuner_init = NULL, + .tuner_set_mode = NULL, + .tuner_set_frequency= NULL, + .tuner_get_frequency= NULL, + .tuner_set_bandwidth= NULL, + .tuner_get_bandwidth= NULL, + .tuner_set_bbgain = NULL, + .tuner_get_bbgain = NULL, + .tuner_set_refclk = NULL, + .tuner_get_status = NULL, +}; + +static struct stv6110x_config stv6110x_config = { + .addr = 0x60, + .refclk = 1600, +}; + +#define NIMA 0 +#define NIMB 1 + +static struct stv0367_config stv0367_tda18212_config[] = { + { + .demod_address = 0x1c, + .xtal = 1600, + .if_khz = 4500, + .if_iq_mode = FE_TER_NORMAL_IF_TUNER, + .ts_mode = STV0367_SERIAL_PUNCT_CLOCK, + .clk_pol = STV0367_CLOCKPOLARITY_DEFAULT, + }, { + .demod_address = 0x1d, + .xtal = 1600, + .if_khz = 4500, + .if_iq_mode = FE_TER_NORMAL_IF_TUNER, + .ts_mode = STV0367_SERIAL_PUNCT_CLOCK, + .clk_pol = STV0367_CLOCKPOLARITY_DEFAULT, + }, { + .demod_address = 0x1e, + .xtal = 1600, + .if_khz = 4500, + .if_iq_mode = FE_TER_NORMAL_IF_TUNER, + .ts_mode = STV0367_SERIAL_PUNCT_CLOCK, + .clk_pol = STV0367_CLOCKPOLARITY_DEFAULT, + }, +}; + +static struct tda18212_config tda18212_conf = { + .if_dvbt_6 = 4150, + .if_dvbt_7 = 4150, + .if_dvbt_8 = 4500, + .if_dvbc = 5000, +}; + +int c8sectpfe_frontend_attach(struct dvb_frontend **fe, + struct c8sectpfe *c8sectpfe, + struct channel_info *tsin, int chan_num) +{ + struct tda182
[PATCH v2 11/11] MAINTAINERS: Add c8sectpfe driver directory to STi section
Add the new c8sectpfe demux driver to the STi section of the MAINTAINERS file. Signed-off-by: Peter Griffin --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index a226416..a9f2f37 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1506,6 +1506,7 @@ F:arch/arm/boot/dts/sti* F: drivers/clocksource/arm_global_timer.c F: drivers/i2c/busses/i2c-st.c F: drivers/media/rc/st_rc.c +F: drivers/media/platform/sti/c8sectpfe/ F: drivers/mmc/host/sdhci-st.c F: drivers/phy/phy-miphy28lp.c F: drivers/phy/phy-miphy365x.c -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 07/11] [media] c8sectpfe: Add LDVB helper functions.
These functions are used by the core code for creating the LDVB devices and adapter. Addtionally some older SoC's (and potentially newer ones) have different frontend HW which would allow those devices to be easily supported in the future by keeping the code specific to the IP separate from the more generic code. Signed-off-by: Peter Griffin --- .../platform/sti/c8sectpfe/c8sectpfe-common.c | 265 + .../platform/sti/c8sectpfe/c8sectpfe-common.h | 64 + 2 files changed, 329 insertions(+) create mode 100644 drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.c create mode 100644 drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.h diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.c new file mode 100644 index 000..95223ab --- /dev/null +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-common.c @@ -0,0 +1,265 @@ +/* + * c8sectpfe-common.c - C8SECTPFE STi DVB driver + * + * Copyright (c) STMicroelectronics 2015 + * + * Author: Peter Griffin + * + * 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. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dmxdev.h" +#include "dvbdev.h" +#include "dvb_demux.h" +#include "dvb_frontend.h" +#include "dvb_net.h" + +#include "c8sectpfe-common.h" +#include "c8sectpfe-core.h" +#include "c8sectpfe-dvb.h" + +static int register_dvb(struct stdemux *demux, struct dvb_adapter *adap, + void *start_feed, void *stop_feed, + struct c8sectpfei *fei) +{ + int result; + + demux->dvb_demux.dmx.capabilities = DMX_TS_FILTERING | + DMX_SECTION_FILTERING | + DMX_MEMORY_BASED_FILTERING; + + demux->dvb_demux.priv = demux; + demux->dvb_demux.filternum = C8SECTPFE_MAXCHANNEL; + demux->dvb_demux.feednum = C8SECTPFE_MAXCHANNEL; + + demux->dvb_demux.start_feed = start_feed; + demux->dvb_demux.stop_feed = stop_feed; + demux->dvb_demux.write_to_decoder = NULL; + + result = dvb_dmx_init(&demux->dvb_demux); + if (result < 0) { + dev_err(fei->dev, "dvb_dmx_init failed (errno = %d)\n", + result); + goto err_dmx; + } + + demux->dmxdev.filternum = demux->dvb_demux.filternum; + demux->dmxdev.demux = &demux->dvb_demux.dmx; + demux->dmxdev.capabilities = 0; + + result = dvb_dmxdev_init(&demux->dmxdev, adap); + if (result < 0) { + dev_err(fei->dev, "dvb_dmxdev_init failed (errno = %d)\n", + result); + + goto err_dmxdev; + } + + demux->hw_frontend.source = DMX_FRONTEND_0 + demux->tsin_index; + + result = demux->dvb_demux.dmx.add_frontend(&demux->dvb_demux.dmx, + &demux->hw_frontend); + if (result < 0) { + dev_err(fei->dev, "add_frontend failed (errno = %d)\n", result); + goto err_fe_hw; + } + + demux->mem_frontend.source = DMX_MEMORY_FE; + result = demux->dvb_demux.dmx.add_frontend(&demux->dvb_demux.dmx, + &demux->mem_frontend); + if (result < 0) { + dev_err(fei->dev, "add_frontend failed (%d)\n", result); + goto err_fe_mem; + } + + result = demux->dvb_demux.dmx.connect_frontend(&demux->dvb_demux.dmx, + &demux->hw_frontend); + if (result < 0) { + dev_err(fei->dev, "connect_frontend (%d)\n", result); + goto err_fe_con; + } + + return 0; + +err_fe_con: + demux->dvb_demux.dmx.remove_frontend(&demux->dvb_demux.dmx, +&demux->mem_frontend); +err_fe_mem: + demux->dvb_demux.dmx.remove_frontend(&demux->dvb_demux.dmx, +&demux->hw_frontend); +err_fe_hw: + dvb_dmxdev_release(&demux->dmxdev); +err_dmxdev: + dvb_dmx_release(&demux->dvb_demux); +err_dmx: + return result; + +} + +static void unregister_dvb(struct stdemux *demux) +{ + + demux->dvb_demux.dmx.remove_frontend(&am
[PATCH v2 10/11] [media] c8sectpfe: Add Kconfig and Makefile for the driver.
This patch adds the Kconfig and Makefile for the c8sectpfe driver so it will be built. It also selects additional demodulator and tuners which are required by the supported NIM cards. Signed-off-by: Peter Griffin --- drivers/media/platform/Kconfig| 4 +++- drivers/media/platform/Makefile | 1 + drivers/media/platform/sti/c8sectpfe/Kconfig | 28 +++ drivers/media/platform/sti/c8sectpfe/Makefile | 9 + 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 drivers/media/platform/sti/c8sectpfe/Kconfig create mode 100644 drivers/media/platform/sti/c8sectpfe/Makefile diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig index f6bed19..68d7ed1 100644 --- a/drivers/media/platform/Kconfig +++ b/drivers/media/platform/Kconfig @@ -1,6 +1,6 @@ # # Platform drivers -# All drivers here are currently for webcam support +# Most drivers here are currently for webcam support menuconfig V4L_PLATFORM_DRIVERS bool "V4L platform devices" @@ -280,3 +280,5 @@ config VIDEO_VIM2M This is a virtual test device for the memory-to-memory driver framework. endif #V4L_TEST_DRIVERS + +source "drivers/media/platform/sti/c8sectpfe/Kconfig" diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile index 114f9ab..301bc1d 100644 --- a/drivers/media/platform/Makefile +++ b/drivers/media/platform/Makefile @@ -35,6 +35,7 @@ obj-$(CONFIG_VIDEO_SAMSUNG_S5P_G2D) += s5p-g2d/ obj-$(CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC) += exynos-gsc/ obj-$(CONFIG_VIDEO_STI_BDISP) += sti/bdisp/ +obj-$(CONFIG_DVB_C8SECTPFE)+= sti/c8sectpfe/ obj-$(CONFIG_BLACKFIN) += blackfin/ diff --git a/drivers/media/platform/sti/c8sectpfe/Kconfig b/drivers/media/platform/sti/c8sectpfe/Kconfig new file mode 100644 index 000..d1bfd4c --- /dev/null +++ b/drivers/media/platform/sti/c8sectpfe/Kconfig @@ -0,0 +1,28 @@ +config DVB_C8SECTPFE + tristate "STMicroelectronics C8SECTPFE DVB support" + depends on DVB_CORE && I2C && (ARCH_STI || ARCH_MULTIPLATFORM) + select LIBELF_32 + select FW_LOADER + select FW_LOADER_USER_HELPER_FALLBACK + select DEBUG_FS + select DVB_LNBP21 if MEDIA_SUBDRV_AUTOSELECT + select DVB_STV090x if MEDIA_SUBDRV_AUTOSELECT + select DVB_STB6100 if MEDIA_SUBDRV_AUTOSELECT + select DVB_STV6110 if MEDIA_SUBDRV_AUTOSELECT + select DVB_STV0900 if MEDIA_SUBDRV_AUTOSELECT + select DVB_STV0367 if MEDIA_SUBDRV_AUTOSELECT + select MEDIA_TUNER_TDA18212 if MEDIA_SUBDRV_AUTOSELECT + + ---help--- + This adds support for DVB front-end cards connected + to TS inputs of STiH407/410 SoC. + + The driver currently supports C8SECTPFE's TS input block, + memdma engine, and HW PID filtering. + + Supported DVB front-end cards are: + - STMicroelectronics DVB-T B2100A (STV0367 + TDA18212) + - STMicroelectronics DVB-S/S2 STV0903 + STV6110 + LNBP24 board + + To compile this driver as a module, choose M here: the + module will be called c8sectpfe. diff --git a/drivers/media/platform/sti/c8sectpfe/Makefile b/drivers/media/platform/sti/c8sectpfe/Makefile new file mode 100644 index 000..b578c7c --- /dev/null +++ b/drivers/media/platform/sti/c8sectpfe/Makefile @@ -0,0 +1,9 @@ +c8sectpfe-y += c8sectpfe-core.o c8sectpfe-common.o c8sectpfe-dvb.o \ + c8sectpfe-debugfs.o + +obj-$(CONFIG_DVB_C8SECTPFE) += c8sectpfe.o + +ccflags-y += -Idrivers/media/i2c +ccflags-y += -Idrivers/media/common +ccflags-y += -Idrivers/media/dvb-core/ -Idrivers/media/dvb-frontends/ \ + -Idrivers/media/tuners/ -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 05/11] ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node.
This patch adds in the required DT node for the c8sectpfe Linux DVB demux driver which allows the tsin channels to be used on an upstream kernel. Signed-off-by: Peter Griffin --- arch/arm/boot/dts/stihxxx-b2120.dtsi | 38 1 file changed, 38 insertions(+) diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index 62994ae..1bc018e 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -6,6 +6,10 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + +#include +#include + / { soc { sbc_serial0: serial@953 { @@ -85,5 +89,39 @@ status = "okay"; }; + c8sectpfe@08a2 { + compatible = "st,stih407-c8sectpfe"; + status = "okay"; + reg = <0x08a2 0x1>, <0x08a0 0x4000>; + reg-names = "c8sectpfe", "c8sectpfe-ram"; + + interrupts = <0 34 0>, <0 35 0>; + interrupt-names = "c8sectpfe-error-irq", + "c8sectpfe-idle-irq"; + + pinctrl-names = "tsin0-serial", "tsin0-parallel", + "tsin3-serial", "tsin4-serial", + "tsin5-serial"; + + pinctrl-0 = <&pinctrl_tsin0_serial>; + pinctrl-1 = <&pinctrl_tsin0_parallel>; + pinctrl-2 = <&pinctrl_tsin3_serial>; + pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; + pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; + + clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; + clock-names = "c8sectpfe"; + + /* tsin0 is TSA on NIMA */ + tsin0: port@0 { + + tsin-num = <0>; + serial-not-parallel; + i2c-bus = <&ssc2>; + rst-gpio = <&pio15 4 0>; + + dvb-card = ; + }; + }; }; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 09/11] [media] c8sectpfe: Add c8sectpfe debugfs support.
Some basic debugfs support to dump the IP registers. Further statistics could easily be added in the future for example for each enabled tsin channel we could expose number of corrupt packets received etc. Signed-off-by: Peter Griffin --- .../platform/sti/c8sectpfe/c8sectpfe-debugfs.c | 271 + .../platform/sti/c8sectpfe/c8sectpfe-debugfs.h | 26 ++ 2 files changed, 297 insertions(+) create mode 100644 drivers/media/platform/sti/c8sectpfe/c8sectpfe-debugfs.c create mode 100644 drivers/media/platform/sti/c8sectpfe/c8sectpfe-debugfs.h diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-debugfs.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-debugfs.c new file mode 100644 index 000..e9ba13d --- /dev/null +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-debugfs.c @@ -0,0 +1,271 @@ +/* + * c8sectpfe-debugfs.c - C8SECTPFE STi DVB driver + * + * Copyright (c) STMicroelectronics 2015 + * + * Author: Peter Griffin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 of + * the License as published by the Free Software Foundation. + * + * 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 +#include +#include +#include +#include +#include +#include + +#include "c8sectpfe-debugfs.h" + +#define dump_register(nm ...) \ +{ \ + .name = #nm, \ + .offset = nm, \ +} + +static const struct debugfs_reg32 fei_sys_regs[] = { + dump_register(SYS_INPUT_ERR_STATUS), + dump_register(SYS_OTHER_ERR_STATUS), + dump_register(SYS_INPUT_ERR_MASK), + dump_register(SYS_DMA_ROUTE), + dump_register(SYS_INPUT_CLKEN), + dump_register(IBENABLE_MASK), + dump_register(SYS_OTHER_CLKEN), + dump_register(SYS_CFG_NUM_IB), + dump_register(SYS_CFG_NUM_MIB), + dump_register(SYS_CFG_NUM_SWTS), + dump_register(SYS_CFG_NUM_TSOUT), + dump_register(SYS_CFG_NUM_CCSC), + dump_register(SYS_CFG_NUM_RAM), + dump_register(SYS_CFG_NUM_TP), + + dump_register(C8SECTPFE_IB_IP_FMT_CFG(0)), + dump_register(C8SECTPFE_IB_TAGBYTES_CFG(0)), + dump_register(C8SECTPFE_IB_PID_SET(0)), + dump_register(C8SECTPFE_IB_PKT_LEN(0)), + dump_register(C8SECTPFE_IB_BUFF_STRT(0)), + dump_register(C8SECTPFE_IB_BUFF_END(0)), + dump_register(C8SECTPFE_IB_READ_PNT(0)), + dump_register(C8SECTPFE_IB_WRT_PNT(0)), + dump_register(C8SECTPFE_IB_PRI_THRLD(0)), + dump_register(C8SECTPFE_IB_STAT(0)), + dump_register(C8SECTPFE_IB_MASK(0)), + dump_register(C8SECTPFE_IB_SYS(0)), + + dump_register(C8SECTPFE_IB_IP_FMT_CFG(1)), + dump_register(C8SECTPFE_IB_TAGBYTES_CFG(1)), + dump_register(C8SECTPFE_IB_PID_SET(1)), + dump_register(C8SECTPFE_IB_PKT_LEN(1)), + dump_register(C8SECTPFE_IB_BUFF_STRT(1)), + dump_register(C8SECTPFE_IB_BUFF_END(1)), + dump_register(C8SECTPFE_IB_READ_PNT(1)), + dump_register(C8SECTPFE_IB_WRT_PNT(1)), + dump_register(C8SECTPFE_IB_PRI_THRLD(1)), + dump_register(C8SECTPFE_IB_STAT(1)), + dump_register(C8SECTPFE_IB_MASK(1)), + dump_register(C8SECTPFE_IB_SYS(1)), + + dump_register(C8SECTPFE_IB_IP_FMT_CFG(2)), + dump_register(C8SECTPFE_IB_TAGBYTES_CFG(2)), + dump_register(C8SECTPFE_IB_PID_SET(2)), + dump_register(C8SECTPFE_IB_PKT_LEN(2)), + dump_register(C8SECTPFE_IB_BUFF_STRT(2)), + dump_register(C8SECTPFE_IB_BUFF_END(2)), + dump_register(C8SECTPFE_IB_READ_PNT(2)), + dump_register(C8SECTPFE_IB_WRT_PNT(2)), + dump_register(C8SECTPFE_IB_PRI_THRLD(2)), + dump_register(C8SECTPFE_IB_STAT(2)), + dump_register(C8SECTPFE_IB_MASK(2)), + dump_register(C8SECTPFE_IB_SYS(2)), + + dump_register(C8SECTPFE_IB_IP_FMT_CFG(3)), + dump_register(C8SECTPFE_IB_TAGBYTES_CFG(3)), + dump_register(C8SECTPFE_IB_PID_SET(3)), + dump_register(C8SECTPFE_IB_PKT_LEN(3)), + dump_register(C8SECTPFE_IB_BUFF_STRT(3)), + dump_register(C8SECTPFE_IB_BUFF_END(3)), + dump_register(C8SECTPFE_IB_READ_PNT(3)), + dump_register(C8SECTPFE_IB_WRT_PNT(3)), + dump_register(C8SECTPFE_IB_PRI_THRLD(3)), + dump_register(C8SECTPFE_IB_STAT(3)), + dump_register(C8SECTPFE_IB_MASK(3)), + dump_register(C8SECTPFE_IB_SYS(3)), + + dump_register(C8SECTPFE_IB_IP_FMT_CFG(4)), + dump_register(C8SECTPFE_IB_TAGBYTES_CFG(4)), + dump_register(C8SECTPFE_IB_PID_SET(4)), + dump_register(C8SECTPFE_IB_PKT_LEN(4)), + dump_register(C8SECTPFE_IB_BUFF_STRT(4)), + dum
Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
Hi Michael, On Thu, 30 Jul 2015, Michael Ira Krufky wrote: > On Thu, Jul 30, 2015 at 7:14 AM, Michael Ira Krufky > wrote: > > On Thu, Jul 30, 2015 at 6:08 AM, Joe Perches wrote: > >> On Thu, 2015-07-30 at 10:47 +0100, Peter Griffin wrote: > >>> Hi Mauro / Joe, > >>> > >>> On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: > >>> > >>> > Em Wed, 24 Jun 2015 18:17:37 -0700 > >>> > Joe Perches escreveu: > >>> > > >>> > > On Wed, 2015-06-24 at 16:11 +0100, Peter Griffin wrote: > >>> > > > This is used in conjunction with the STV0367 demodulator on > >>> > > > the STV0367-NIM-V1.0 NIM card which can be used with the STi > >>> > > > STB SoC's. > >>> > > > >>> > > Barely associated to this specific patch, but for > >>> > > dvb-pll.c, another thing that seems possible is to > >>> > > convert the struct dvb_pll_desc uses to const and > >>> > > change the "entries" fixed array size from 12 to [] > >>> > > > >>> > > It'd save a couple KB overall and remove ~5KB of data. > >>> > > > >>> > > $ size drivers/media/dvb-frontends/dvb-pll.o* > >>> > >text data bss dec hex filename > >>> > >8520 15522120 121922fa0 > >>> > > drivers/media/dvb-frontends/dvb-pll.o.new > >>> > >5624 63632120 14107371b > >>> > > drivers/media/dvb-frontends/dvb-pll.o.old > >>> > > >>> > Peter, > >>> > > >>> > Please add this patch on the next patch series you submit. > >>> > >>> Ok will do, I've added this patch with a slightly updated commit message > >>> to my series. > >>> > >>> Joe - Can I add your signed-off-by? > >> > >> Signed-off-by: Joe Perches > > > > Reviewed-by: Michael Ira Krufky > > > > Joe, nice optimization - thanks for that. > > > > With regards to Peter's patch, is this a digital-only tuner, or is it > > a hybrid tuner? > > > > The 5th byte that you send to the THOMSON DTT7546X seems to resemble > > the 'auxiliary byte' that gets set in tuner-simple.c > > > > I'm not sure that dvb-pll is the right place for this tuner > > definition, if this is the case. Maybe this definition belongs in > > tuner-simple instead, if the pattern matches better there. > > > > Mauro, can we hold off on merging Peter's patch until we resolve this? > > This code block, specifically, I would rather not see added into dvb-pll: > > +static int dvb_pll_get_num_regs(struct dvb_pll_priv *priv) > +{ > + int num_regs = 4; > + > + if (strncmp(priv->pll_desc->name, "Thomson dtt7546x", 16) == 0) > + num_regs = 5; > + > + return num_regs; > +} > + > > tuner-simple provides an infrastructure that allows this tuner to be > added in a more elegant way without the need to add special cases to > otherwise generic code, as done in the above. > > I'm sorry, Peter. Can you take a look at tuner-simple and consider > sending a new patch? Yes sure. I wasn't actually aware that tuner-simple existed. From what I can see briefly looking at it, it does look a more suitable way of adding support for this tuner. The dtt7546x is a dual tuner in that it supports dvb-t and dvb-c, however I have only tested it with DVB-T as that is the only feed I have to my home office. As I have a V2 incorporating all of Mauro's changes ready to send, and I'm on holiday for 3 weeks from Friday, I will temporarily drop support for this tuner and NIM card in V2, and migrate over to the new driver when I return end of August. regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
Hi Michael, On Thu, 30 Jul 2015, Michael Ira Krufky wrote: > On Thu, Jul 30, 2015 at 7:14 AM, Michael Ira Krufky > wrote: > > On Thu, Jul 30, 2015 at 6:08 AM, Joe Perches wrote: > >> On Thu, 2015-07-30 at 10:47 +0100, Peter Griffin wrote: > >>> Hi Mauro / Joe, > >>> > >>> On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: > >>> > >>> > Em Wed, 24 Jun 2015 18:17:37 -0700 > >>> > Joe Perches escreveu: > >>> > > >>> > > On Wed, 2015-06-24 at 16:11 +0100, Peter Griffin wrote: > >>> > > > This is used in conjunction with the STV0367 demodulator on > >>> > > > the STV0367-NIM-V1.0 NIM card which can be used with the STi > >>> > > > STB SoC's. > >>> > > > >>> > > Barely associated to this specific patch, but for > >>> > > dvb-pll.c, another thing that seems possible is to > >>> > > convert the struct dvb_pll_desc uses to const and > >>> > > change the "entries" fixed array size from 12 to [] > >>> > > > >>> > > It'd save a couple KB overall and remove ~5KB of data. > >>> > > > >>> > > $ size drivers/media/dvb-frontends/dvb-pll.o* > >>> > >text data bss dec hex filename > >>> > >8520 15522120 121922fa0 > >>> > > drivers/media/dvb-frontends/dvb-pll.o.new > >>> > >5624 63632120 14107371b > >>> > > drivers/media/dvb-frontends/dvb-pll.o.old > >>> > > >>> > Peter, > >>> > > >>> > Please add this patch on the next patch series you submit. > >>> > >>> Ok will do, I've added this patch with a slightly updated commit message > >>> to my series. > >>> > >>> Joe - Can I add your signed-off-by? > >> > >> Signed-off-by: Joe Perches > > > > Reviewed-by: Michael Ira Krufky > > > > Joe, nice optimization - thanks for that. > > > > With regards to Peter's patch, is this a digital-only tuner, or is it > > a hybrid tuner? > > > > The 5th byte that you send to the THOMSON DTT7546X seems to resemble > > the 'auxiliary byte' that gets set in tuner-simple.c > > > > I'm not sure that dvb-pll is the right place for this tuner > > definition, if this is the case. Maybe this definition belongs in > > tuner-simple instead, if the pattern matches better there. > > > > Mauro, can we hold off on merging Peter's patch until we resolve this? > > > > -Michael Ira Krufky > > eek! I mispelled my own email address. > > > With regards to Joe's patch - I'd like to see that merged. ...and > here is my correctly spelled email address: > > > Reviewed-by: Michael Ira Krufky Ok I will add your reviewed-by and include it in my v2. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 07/12] [media] tsin: c8sectpfe: STiH407/10 Linux DVB demux support
Hi Mauro, Thanks for reviewing. On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: > Em Wed, 24 Jun 2015 16:11:05 +0100 > Peter Griffin escreveu: > > > This patch adds support for the c8sectpfe input HW found on > > STiH407/410 SoC's. > > > > It currently supports the TS input block, memdma engine > > and hw PID filtering blocks of the C8SECTPFE subsystem. > > > > The driver creates one LinuxDVB adapter, and a > > demux/dvr/frontend set of devices for each tsin channel > > which is specificed in the DT. It has been tested with > > multiple tsin channels tuned, locked, and grabbing TS > > simultaneously. > > > > Signed-off-by: Peter Griffin > > --- > > drivers/media/tsin/c8sectpfe/c8sectpfe-core.c | 1105 > > + > > drivers/media/tsin/c8sectpfe/c8sectpfe-core.h | 288 +++ > > 2 files changed, 1393 insertions(+) > > create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-core.c > > create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-core.h > > > > diff --git a/drivers/media/tsin/c8sectpfe/c8sectpfe-core.c > > b/drivers/media/tsin/c8sectpfe/c8sectpfe-core.c > > new file mode 100644 > > index 000..fbbe323 > > --- /dev/null > > +++ b/drivers/media/tsin/c8sectpfe/c8sectpfe-core.c > > @@ -0,0 +1,1105 @@ > > +/* > > + * c8sectpfe-core.c - C8SECTPFE STi DVB driver > > + * > > + * Copyright (c) STMicroelectronics 2015 > > + * > > + * Author:Peter Bennett > > + * Peter Griffin > > + * > > + * 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. > > + */ > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include "c8sectpfe-core.h" > > +#include "c8sectpfe-common.h" > > +#include "c8sectpfe-debugfs.h" > > +#include "dmxdev.h" > > +#include "dvb_demux.h" > > +#include "dvb_frontend.h" > > +#include "dvb_net.h" > > + > > +#define FIRMWARE_MEMDMA "pti_memdma_h407.elf" > > +MODULE_FIRMWARE(FIRMWARE_MEMDMA); > > + > > +#define PID_TABLE_SIZE 1024 > > +#define POLL_20_HZ_DIV 20 /* poll at 20 Hz */ > > + > > +static int load_slim_core_fw(struct c8sectpfei *fei); > > + > > +#define TS_PKT_SIZE 188 > > +#define HEADER_SIZE (4) > > +#define PACKET_SIZE (TS_PKT_SIZE+HEADER_SIZE) > > + > > +#define FEI_ALIGNMENT (32) > > +/* hw requires minimum of 8*PACKET_SIZE and padded to 8byte boundary */ > > +#define FEI_BUFFER_SIZE (8*PACKET_SIZE*340) > > + > > +#define FIFO_LEN 1024 > > + > > +static void c8sectpfe_timer_interrupt(unsigned long ac8sectpfei) > > +{ > > + struct c8sectpfei *fei = (struct c8sectpfei *)ac8sectpfei; > > + struct channel_info *channel; > > + int chan_num; > > + > > + /* iterate through input block channels */ > > + for (chan_num = 0; chan_num < fei->tsin_count; chan_num++) { > > + channel = fei->channel_data[chan_num]; > > + > > + /* is this descriptor initialised and TP enabled */ > > + if (channel->irec && readl((void __iomem *) > > + &channel->irec->tp_enable)) > > + tasklet_schedule(&channel->tsklet); > > + } > > + > > + fei->timer.expires = jiffies + (HZ / POLL_20_HZ_DIV); > > Please use the macros for jiffies conversions. In this case, I guess > you want to use ms_to_jiffies(), right? Fixed in V2. > > > + add_timer(&fei->timer); > > +} > > + > > +static void channel_swdemux_tsklet(unsigned long data) > > +{ > > + struct channel_info *channel = (struct channel_info *)data; > > + struct c8sectpfei *fei = channel->fei; > > + struct tpentry *ptrblk; > > + unsigned long wp, rp; > > + int pos, num_packets, n, size; > > + u8 *buf; > > + > > + BUG_ON(!channel); > > + BUG_ON(
Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
Hi Mauro / Joe, On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: > Em Wed, 24 Jun 2015 18:17:37 -0700 > Joe Perches escreveu: > > > On Wed, 2015-06-24 at 16:11 +0100, Peter Griffin wrote: > > > This is used in conjunction with the STV0367 demodulator on > > > the STV0367-NIM-V1.0 NIM card which can be used with the STi > > > STB SoC's. > > > > Barely associated to this specific patch, but for > > dvb-pll.c, another thing that seems possible is to > > convert the struct dvb_pll_desc uses to const and > > change the "entries" fixed array size from 12 to [] > > > > It'd save a couple KB overall and remove ~5KB of data. > > > > $ size drivers/media/dvb-frontends/dvb-pll.o* > >textdata bss dec hex filename > >852015522120 121922fa0 > > drivers/media/dvb-frontends/dvb-pll.o.new > >562463632120 14107371b > > drivers/media/dvb-frontends/dvb-pll.o.old > > Peter, > > Please add this patch on the next patch series you submit. Ok will do, I've added this patch with a slightly updated commit message to my series. Joe - Can I add your signed-off-by? regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
Hi Mauro, On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: > Em Wed, 24 Jun 2015 16:11:00 +0100 > Peter Griffin escreveu: > > > This is used in conjunction with the STV0367 demodulator on > > the STV0367-NIM-V1.0 NIM card which can be used with the STi > > STB SoC's. > > > > This tuner has a fifth register, so some changes have been made > > to accommodate this. > > > > Signed-off-by: Peter Griffin > > --- > > drivers/media/dvb-frontends/dvb-pll.c | 74 > > +-- > > drivers/media/dvb-frontends/dvb-pll.h | 1 + > > 2 files changed, 64 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/media/dvb-frontends/dvb-pll.c > > b/drivers/media/dvb-frontends/dvb-pll.c > > index 6d8fe88..f7381c7 100644 > > --- a/drivers/media/dvb-frontends/dvb-pll.c > > +++ b/drivers/media/dvb-frontends/dvb-pll.c > > @@ -141,6 +141,35 @@ static struct dvb_pll_desc dvb_pll_thomson_dtt7520x = { > > }, > > }; > > > > +static void thomson_dtt7546x_bw(struct dvb_frontend *fe, u8 *buf) > > +{ > > + /* set CB2 reg - set ATC, XTO */ > > + buf[4] = 0xc3; > > +} > > + > > +static struct dvb_pll_desc dvb_pll_thomson_dtt7546x = { > > + .name = "Thomson dtt7546x", > > + .min = 4425, > > + .max = 86325, > > + .set = thomson_dtt7546x_bw, > > + .iffreq= 3617, > > Whitespace is missing. Please check the patchs with scripts/checkpatch.pl. Will fix in V2. regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 09/12] [media] tsin: c8sectpfe: Add support for various ST NIM cards.
Hi Mauro, On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: > Em Wed, 24 Jun 2015 16:11:07 +0100 > Peter Griffin escreveu: > > > This patch adds support for the following 3 NIM cards: - > > 1) STV0367-NIM (stv0367 demod with Thompson PLL) > > 2) B2100A (2x stv0367 demods & 2x NXP tda18212 tuners) > > 3) STV0903-6110NIM (stv0903 demod + 6110 tuner, lnb24) > > > > Signed-off-by: Peter Griffin > > --- > > drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.c | 296 > > +++ > > drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.h | 20 ++ > > 2 files changed, 316 insertions(+) > > create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.c > > create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.h > > > > diff --git a/drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.c > > b/drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.c > > new file mode 100644 > > index 000..5c4ecb4 > > --- /dev/null > > +++ b/drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.c > > @@ -0,0 +1,296 @@ > > +/* > > + * c8sectpfe-dvb.c - C8SECTPFE STi DVB driver > > + * > > + * Copyright (c) STMicroelectronics 2015 > > + * > > + * Author Peter Griffin > > + * > > + * 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 > > +#include > > +#include > > +#include > > + > > +#include > > + > > +#include "c8sectpfe-common.h" > > +#include "c8sectpfe-core.h" > > +#include "c8sectpfe-dvb.h" > > + > > +#include "dvb-pll.h" > > +#include "lnbh24.h" > > +#include "stv0367.h" > > +#include "stv0367_priv.h" > > +#include "stv6110x.h" > > +#include "stv090x.h" > > +#include "tda18212.h" > > + > > +static inline const char *dvb_card_str(unsigned int c) > > +{ > > + switch (c) { > > + case STV0367_PLL_BOARD_NIMA:return "STV0367_PLL_BOARD_NIMA"; > > + case STV0367_PLL_BOARD_NIMB:return "STV0367_PLL_BOARD_NIMB"; > > + case STV0367_TDA18212_NIMA_1: return "STV0367_TDA18212_NIMA_1"; > > + case STV0367_TDA18212_NIMA_2: return "STV0367_TDA18212_NIMA_2"; > > + case STV0367_TDA18212_NIMB_1: return "STV0367_TDA18212_NIMB_1"; > > + case STV0367_TDA18212_NIMB_2: return "STV0367_TDA18212_NIMB_2"; > > + case STV0903_6110_LNB24_NIMA: return "STV0903_6110_LNB24_NIMA"; > > + case STV0903_6110_LNB24_NIMB: return "STV0903_6110_LNB24_NIMB"; > > + default:return "unknown dvb frontend card"; > > + } > > +} > > + > > +static struct stv090x_config stv090x_config = { > > + .device = STV0903, > > + .demod_mode = STV090x_SINGLE, > > + .clk_mode = STV090x_CLK_EXT, > > + .xtal = 1600, > > + .address= 0x69, > > + > > + .ts1_mode = STV090x_TSMODE_SERIAL_CONTINUOUS, > > + .ts2_mode = STV090x_TSMODE_SERIAL_CONTINUOUS, > > + > > + .repeater_level = STV090x_RPTLEVEL_64, > > + > > + .tuner_init = NULL, > > + .tuner_set_mode = NULL, > > + .tuner_set_frequency= NULL, > > + .tuner_get_frequency= NULL, > > + .tuner_set_bandwidth= NULL, > > + .tuner_get_bandwidth= NULL, > > + .tuner_set_bbgain = NULL, > > + .tuner_get_bbgain = NULL, > > + .tuner_set_refclk = NULL, > > + .tuner_get_status = NULL, > > +}; > > + > > +static struct stv6110x_config stv6110x_config = { > > + .addr = 0x60, > > + .refclk = 1600, > > +}; > > + > > +#define NIMA 0 > > +#define NIMB 1 > > + > > +static struct stv0367_config stv0367_pll_config[] = { > > + { > > + .demod_address = 0x1c,
Re: [PATCH 11/12] [media] tsin: c8sectpfe: Add Kconfig and Makefile for the driver.
Hi Mauro, Thanks for reviewing. Sending my reply again, as it looks like I dropped the CC list on my first reply, and my second reply bounced on the mailing lists :-( On Wed, 22 Jul 2015, Mauro Carvalho Chehab wrote: > Em Wed, 24 Jun 2015 16:11:09 +0100 > Peter Griffin escreveu: > > > This patch adds the Kconfig and Makefile for the c8sectpfe driver > > so it will be built. It also selects additional demodulator and tuners > > which are required by the supported NIM cards. > > > > Signed-off-by: Peter Griffin > > --- > > drivers/media/Kconfig | 1 + > > drivers/media/Makefile| 1 + > > drivers/media/tsin/c8sectpfe/Kconfig | 26 ++ > > drivers/media/tsin/c8sectpfe/Makefile | 11 +++ > > 4 files changed, 39 insertions(+) > > create mode 100644 drivers/media/tsin/c8sectpfe/Kconfig > > create mode 100644 drivers/media/tsin/c8sectpfe/Makefile > > > > diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig > > index 1570992..82bc1dc 100644 > > --- a/drivers/media/Kconfig > > +++ b/drivers/media/Kconfig > > @@ -170,6 +170,7 @@ source "drivers/media/pci/Kconfig" > > source "drivers/media/platform/Kconfig" > > source "drivers/media/mmc/Kconfig" > > source "drivers/media/radio/Kconfig" > > +source "drivers/media/tsin/c8sectpfe/Kconfig" > > > > comment "Supported FireWire (IEEE 1394) Adapters" > > depends on DVB_CORE && FIREWIRE > > diff --git a/drivers/media/Makefile b/drivers/media/Makefile > > index e608bbc..0a567b8 100644 > > --- a/drivers/media/Makefile > > +++ b/drivers/media/Makefile > > @@ -29,5 +29,6 @@ obj-y += rc/ > > # > > > > obj-y += common/ platform/ pci/ usb/ mmc/ firewire/ > > +obj-$(CONFIG_DVB_C8SECTPFE) += tsin/c8sectpfe/ > > Hmm... why are you adding it at a new "tsin" directory? We're putting > those SoC platform drivers under platform/. I didn't realise that. I will move this under there in the V2 patchset then? The rationale behind a new 'tsin' directory was that all the current DVB drivers seemed to be grouped by the underlying bus on which TS data enters the system (e.g. pci / usb). As this didn't fit in with that scheme I created a new tsin directory for SoC's which have dedicated hardware for Transport Stream INput (tsin) into the SoC. regards, Peter. p.s. Mauro - appologies again for spaming you -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 11/12] [media] tsin: c8sectpfe: Add Kconfig and Makefile for the driver.
Hi Paul, Thanks for reviewing. On Thu, 25 Jun 2015, Paul Bolle wrote: > On Wed, 2015-06-24 at 16:11 +0100, Peter Griffin wrote: > > --- /dev/null > > +++ b/drivers/media/tsin/c8sectpfe/Makefile > > > +c8sectpfe-y += c8sectpfe-core.o c8sectpfe-common.o c8sectpfe-dvb.o > > + > > +obj-$(CONFIG_DVB_C8SECTPFE) += c8sectpfe.o > > + > > +ifneq ($(CONFIG_DVB_C8SECTPFE),) > > + c8sectpfe-y += c8sectpfe-debugfs.o > > +endif > > Isn't the above equivalent to > c8sectpfe-y += c8sectpfe-core.o c8sectpfe-common.o c8sectpfe-dvb.o > c8sectpfe-debugfs.o > > obj-$(CONFIG_DVB_C8SECTPFE) += c8sectpfe.o > > Or am I missing something subtle here? No I think I just messed up. Will fix in v2. I suspect what happened was I was starting to add a CONFIG_DVB_C8SECTPFE_DEBUGFS Kconfig option, and then forgot ;) In v2 I have added a "select DEBUG_FS" to Kconfig for the driver, and put it all on one line. Also at the same time fixing some other Kconfig dependencies I noticed so it now has 'select LIBELF_32' and 'select FW_LOADER'. regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 11/12] [media] tsin: c8sectpfe: Add Kconfig and Makefile for the driver.
This patch adds the Kconfig and Makefile for the c8sectpfe driver so it will be built. It also selects additional demodulator and tuners which are required by the supported NIM cards. Signed-off-by: Peter Griffin --- drivers/media/Kconfig | 1 + drivers/media/Makefile| 1 + drivers/media/tsin/c8sectpfe/Kconfig | 26 ++ drivers/media/tsin/c8sectpfe/Makefile | 11 +++ 4 files changed, 39 insertions(+) create mode 100644 drivers/media/tsin/c8sectpfe/Kconfig create mode 100644 drivers/media/tsin/c8sectpfe/Makefile diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig index 1570992..82bc1dc 100644 --- a/drivers/media/Kconfig +++ b/drivers/media/Kconfig @@ -170,6 +170,7 @@ source "drivers/media/pci/Kconfig" source "drivers/media/platform/Kconfig" source "drivers/media/mmc/Kconfig" source "drivers/media/radio/Kconfig" +source "drivers/media/tsin/c8sectpfe/Kconfig" comment "Supported FireWire (IEEE 1394) Adapters" depends on DVB_CORE && FIREWIRE diff --git a/drivers/media/Makefile b/drivers/media/Makefile index e608bbc..0a567b8 100644 --- a/drivers/media/Makefile +++ b/drivers/media/Makefile @@ -29,5 +29,6 @@ obj-y += rc/ # obj-y += common/ platform/ pci/ usb/ mmc/ firewire/ +obj-$(CONFIG_DVB_C8SECTPFE) += tsin/c8sectpfe/ obj-$(CONFIG_VIDEO_DEV) += radio/ diff --git a/drivers/media/tsin/c8sectpfe/Kconfig b/drivers/media/tsin/c8sectpfe/Kconfig new file mode 100644 index 000..8d99a87 --- /dev/null +++ b/drivers/media/tsin/c8sectpfe/Kconfig @@ -0,0 +1,26 @@ +config DVB_C8SECTPFE + tristate "STMicroelectronics C8SECTPFE DVB support" + depends on DVB_CORE && I2C && (ARCH_STI || ARCH_MULTIPLATFORM) + select DVB_LNBP21 if MEDIA_SUBDRV_AUTOSELECT + select DVB_STV090x if MEDIA_SUBDRV_AUTOSELECT + select DVB_STB6100 if MEDIA_SUBDRV_AUTOSELECT + select DVB_STV6110 if MEDIA_SUBDRV_AUTOSELECT + select DVB_STV0900 if MEDIA_SUBDRV_AUTOSELECT + select DVB_STV0367 if MEDIA_SUBDRV_AUTOSELECT + select DVB_PLL if MEDIA_SUBDRV_AUTOSELECT + select MEDIA_TUNER_TDA18212 if MEDIA_SUBDRV_AUTOSELECT + + ---help--- + This adds support for DVB front-end cards connected + to TS inputs of STiH407/410 SoC. + + The driver currently supports C8SECTPFE's TS input block, + memdma engine, and HW PID filtering. + + Supported DVB front-end cards are: + - STMicroelectronics DVB-T B2100A (STV0367 + TDA18212) + - STMicroelectronics DVB-T STV0367 PLL board (STV0367 + DTT7546X) + - STMicroelectronics DVB-S/S2 STV0903 + STV6110 + LNBP24 board + + To compile this driver as a module, choose M here: the + module will be called c8sectpfe. diff --git a/drivers/media/tsin/c8sectpfe/Makefile b/drivers/media/tsin/c8sectpfe/Makefile new file mode 100644 index 000..777f06d --- /dev/null +++ b/drivers/media/tsin/c8sectpfe/Makefile @@ -0,0 +1,11 @@ +c8sectpfe-y += c8sectpfe-core.o c8sectpfe-common.o c8sectpfe-dvb.o + +obj-$(CONFIG_DVB_C8SECTPFE) += c8sectpfe.o + +ifneq ($(CONFIG_DVB_C8SECTPFE),) + c8sectpfe-y += c8sectpfe-debugfs.o +endif + +ccflags-y += -Idrivers/media/i2c +ccflags-y += -Idrivers/media/common +ccflags-y += -Idrivers/media/dvb-core/ -Idrivers/media/dvb-frontends/ -Idrivers/media/tuners/ -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 00/12] Add c8sectpfe LinuxDVB demux driver
Hi Maruro, This patchset adds support for a LinuxDVB demux driver for the ST STB stih407 family SoC's. It is what I spoke to you about when we met at ELC-E in Dusseldorf last year. One advantage of having a upstream demux driver implementation for ST SoC's is that it will be easier to add support and maintain existing support for the ST demodulators and tuners which are upstream. As this driver allows ST NIM daughter boards (which typically have a tuner/demod combination) to be used with a upstream kernel. This initial patchset adds support for the following demux HW called c8sectpfe: - * Input Block HW * HW PID filtering * memdma engine (moves TS from sram to RAM) The driver creates one Linux DVB adapter, and each tsin channel which is described in DT has a set of LDVB dev nodes. Currently the driver supports 7 tsin channels. This driver has been tested with the stih407-b2120 board and stih410-b2120 reference design boards, and currently we support the following DVB fronend cards: - STMicroelectronics DVB-T B2100A (STV0367 + TDA18212) - STMicroelectronics DVB-T STV0367 PLL board (STV0367 + DTT7546X) - STMicroelectronics DVB-S/S2 STV0903 + STV6110 + LNBP24 board There are also some small changes to dvb-pll.c and stv0367.c to get these NIM daughterboards working correctly. regards, Peter. p.s. The series which adds pinctrl config used by this driver is https://lkml.org/lkml/2015/6/10/377 Peter Griffin (12): ARM: DT: STi: stihxxx-b2120: Add pulse-width properties to ssc2 & ssc3 [media] dvb-pll: Add support for THOMSON DTT7546X tuner. [media] stv0367: Refine i2c error trace to include i2c address [media] stv0367: Add support for 16Mhz reference clock [media] tsin: c8sectpfe: Add DT bindings documentation for c8sectpfe driver. ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node. [media] tsin: c8sectpfe: STiH407/10 Linux DVB demux support [media] tsin: c8sectpfe: Add LDVB helper functions. [media] tsin: c8sectpfe: Add support for various ST NIM cards. [media] tsin: c8sectpfe: Add c8sectpfe debugfs support. [media] tsin: c8sectpfe: Add Kconfig and Makefile for the driver. MAINTAINERS: Add c8sectpfe driver directory to STi section .../bindings/media/stih407-c8sectpfe.txt | 90 ++ MAINTAINERS|1 + arch/arm/boot/dts/stihxxx-b2120.dtsi | 60 +- drivers/media/Kconfig |1 + drivers/media/Makefile |1 + drivers/media/dvb-frontends/dvb-pll.c | 74 +- drivers/media/dvb-frontends/dvb-pll.h |1 + drivers/media/dvb-frontends/stv0367.c | 17 +- drivers/media/tsin/c8sectpfe/Kconfig | 26 + drivers/media/tsin/c8sectpfe/Makefile | 11 + drivers/media/tsin/c8sectpfe/c8sectpfe-common.c| 266 + drivers/media/tsin/c8sectpfe/c8sectpfe-common.h| 66 ++ drivers/media/tsin/c8sectpfe/c8sectpfe-core.c | 1105 drivers/media/tsin/c8sectpfe/c8sectpfe-core.h | 288 + drivers/media/tsin/c8sectpfe/c8sectpfe-debugfs.c | 271 + drivers/media/tsin/c8sectpfe/c8sectpfe-debugfs.h | 26 + drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.c | 296 ++ drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.h | 20 + include/dt-bindings/media/c8sectpfe.h | 14 + 19 files changed, 2617 insertions(+), 17 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt create mode 100644 drivers/media/tsin/c8sectpfe/Kconfig create mode 100644 drivers/media/tsin/c8sectpfe/Makefile create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-common.c create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-common.h create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-core.c create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-core.h create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-debugfs.c create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-debugfs.h create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.c create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.h create mode 100644 include/dt-bindings/media/c8sectpfe.h -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 06/12] ARM: DT: STi: STiH407: Add c8sectpfe LinuxDVB DT node.
This patch adds in the required DT node for the c8sectpfe Linux DVB demux driver which allows the tsin channels to be used on an upstream kernel. Signed-off-by: Peter Griffin --- arch/arm/boot/dts/stihxxx-b2120.dtsi | 50 1 file changed, 50 insertions(+) diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index 1f27589..ece2ede 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -6,6 +6,10 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + +#include +#include + / { soc { sbc_serial0: serial@953 { @@ -72,5 +76,51 @@ st,osc-force-ext; }; }; + + c8sectpfe@08a2 { + compatible = "st,stih407-c8sectpfe"; + status = "okay"; + reg = <0x08a2 0x1>, <0x08a0 0x4000>; + reg-names = "c8sectpfe", "c8sectpfe-ram"; + + interrupts = <0 34 0>, <0 35 0>; + interrupt-names = "c8sectpfe-error-irq", + "c8sectpfe-idle-irq"; + + pinctrl-names = "tsin0-serial", "tsin0-parallel", + "tsin3-serial", "tsin4-serial", + "tsin5-serial"; + + pinctrl-0 = <&pinctrl_tsin0_serial>; + pinctrl-1 = <&pinctrl_tsin0_parallel>; + pinctrl-2 = <&pinctrl_tsin3_serial>; + pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; + pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; + + clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; + clock-names = "c8sectpfe"; + + /* tsin0 is TSA on NIMA */ + tsin0: port@0 { + + tsin-num = <0>; + serial-not-parallel; + i2c-bus = <&ssc2>; + rst-gpio = <&pio15 4 0>; + + dvb-card = ; + }; + + /* tsin3 is TSB on NIMB */ + tsin3: port@3 { + + tsin-num = <3>; + serial-not-parallel; + i2c-bus = <&ssc3>; + rst-gpio = <&pio15 7 0>; + + dvb-card = ; + }; + }; }; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 08/12] [media] tsin: c8sectpfe: Add LDVB helper functions.
These functions are used by the core code for creating the LDVB devices and adapter. Addtionally some older SoC's (and potentially newer ones) have different frontend HW which would allow those devices to be easily supported in the future by keeping the code specific to the IP separate from the more generic code. Signed-off-by: Peter Griffin --- drivers/media/tsin/c8sectpfe/c8sectpfe-common.c | 266 drivers/media/tsin/c8sectpfe/c8sectpfe-common.h | 66 ++ 2 files changed, 332 insertions(+) create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-common.c create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-common.h diff --git a/drivers/media/tsin/c8sectpfe/c8sectpfe-common.c b/drivers/media/tsin/c8sectpfe/c8sectpfe-common.c new file mode 100644 index 000..c8d607d --- /dev/null +++ b/drivers/media/tsin/c8sectpfe/c8sectpfe-common.c @@ -0,0 +1,266 @@ +/* + * c8sectpfe-common.c - C8SECTPFE STi DVB driver + * + * Copyright (c) STMicroelectronics 2015 + * + * Author: Peter Griffin + * + * 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. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dmxdev.h" +#include "dvbdev.h" +#include "dvb_demux.h" +#include "dvb_frontend.h" +#include "dvb_net.h" + +#include "c8sectpfe-common.h" +#include "c8sectpfe-core.h" +#include "c8sectpfe-dvb.h" + +static int register_dvb(struct stdemux *demux, struct dvb_adapter *adap, + void *start_feed, void *stop_feed, + struct c8sectpfei *fei) +{ + int result; + + demux->dvb_demux.dmx.capabilities = DMX_TS_FILTERING | + DMX_SECTION_FILTERING | + DMX_MEMORY_BASED_FILTERING; + + demux->dvb_demux.priv = demux; + demux->dvb_demux.filternum = C8SECTPFE_MAXCHANNEL; + demux->dvb_demux.feednum = C8SECTPFE_MAXCHANNEL; + + demux->dvb_demux.start_feed = start_feed; + demux->dvb_demux.stop_feed = stop_feed; + demux->dvb_demux.write_to_decoder = NULL; + + result = dvb_dmx_init(&demux->dvb_demux); + if (result < 0) { + dev_err(fei->dev, "dvb_dmx_init failed (errno = %d)\n", + result); + goto err_dmx; + } + + demux->dmxdev.filternum = demux->dvb_demux.filternum; + demux->dmxdev.demux = &demux->dvb_demux.dmx; + demux->dmxdev.capabilities = 0; + + result = dvb_dmxdev_init(&demux->dmxdev, adap); + if (result < 0) { + dev_err(fei->dev, "dvb_dmxdev_init failed (errno = %d)\n", + result); + + goto err_dmxdev; + } + + demux->hw_frontend.source = DMX_FRONTEND_0 + demux->tsin_index; + + result = demux->dvb_demux.dmx.add_frontend(&demux->dvb_demux.dmx, + &demux->hw_frontend); + if (result < 0) { + dev_err(fei->dev, "add_frontend failed (errno = %d)\n", result); + goto err_fe_hw; + } + + demux->mem_frontend.source = DMX_MEMORY_FE; + result = demux->dvb_demux.dmx.add_frontend(&demux->dvb_demux.dmx, + &demux->mem_frontend); + if (result < 0) { + dev_err(fei->dev, "add_frontend failed (%d)\n", result); + goto err_fe_mem; + } + + result = demux->dvb_demux.dmx.connect_frontend(&demux->dvb_demux.dmx, + &demux->hw_frontend); + if (result < 0) { + dev_err(fei->dev, "connect_frontend (%d)\n", result); + goto err_fe_con; + } + + return 0; + +err_fe_con: + demux->dvb_demux.dmx.remove_frontend(&demux->dvb_demux.dmx, +&demux->mem_frontend); +err_fe_mem: + demux->dvb_demux.dmx.remove_frontend(&demux->dvb_demux.dmx, +&demux->hw_frontend); +err_fe_hw: + dvb_dmxdev_release(&demux->dmxdev); +err_dmxdev: + dvb_dmx_release(&demux->dvb_demux); +err_dmx: + return result; + +} + +static void unregister_dvb(struct stdemux *demux) +{ + + demux->dvb_demux.dmx.remove_frontend(&demux->dvb_demux.dmx, +
[PATCH 10/12] [media] tsin: c8sectpfe: Add c8sectpfe debugfs support.
Some basic debugfs support to dump the IP registers. Further statistics could easily be added in the future for example for each enabled tsin channel we could expose number of corrupt packets received etc. Signed-off-by: Peter Griffin --- drivers/media/tsin/c8sectpfe/c8sectpfe-debugfs.c | 271 +++ drivers/media/tsin/c8sectpfe/c8sectpfe-debugfs.h | 26 +++ 2 files changed, 297 insertions(+) create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-debugfs.c create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-debugfs.h diff --git a/drivers/media/tsin/c8sectpfe/c8sectpfe-debugfs.c b/drivers/media/tsin/c8sectpfe/c8sectpfe-debugfs.c new file mode 100644 index 000..e9ba13d --- /dev/null +++ b/drivers/media/tsin/c8sectpfe/c8sectpfe-debugfs.c @@ -0,0 +1,271 @@ +/* + * c8sectpfe-debugfs.c - C8SECTPFE STi DVB driver + * + * Copyright (c) STMicroelectronics 2015 + * + * Author: Peter Griffin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 of + * the License as published by the Free Software Foundation. + * + * 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 +#include +#include +#include +#include +#include +#include + +#include "c8sectpfe-debugfs.h" + +#define dump_register(nm ...) \ +{ \ + .name = #nm, \ + .offset = nm, \ +} + +static const struct debugfs_reg32 fei_sys_regs[] = { + dump_register(SYS_INPUT_ERR_STATUS), + dump_register(SYS_OTHER_ERR_STATUS), + dump_register(SYS_INPUT_ERR_MASK), + dump_register(SYS_DMA_ROUTE), + dump_register(SYS_INPUT_CLKEN), + dump_register(IBENABLE_MASK), + dump_register(SYS_OTHER_CLKEN), + dump_register(SYS_CFG_NUM_IB), + dump_register(SYS_CFG_NUM_MIB), + dump_register(SYS_CFG_NUM_SWTS), + dump_register(SYS_CFG_NUM_TSOUT), + dump_register(SYS_CFG_NUM_CCSC), + dump_register(SYS_CFG_NUM_RAM), + dump_register(SYS_CFG_NUM_TP), + + dump_register(C8SECTPFE_IB_IP_FMT_CFG(0)), + dump_register(C8SECTPFE_IB_TAGBYTES_CFG(0)), + dump_register(C8SECTPFE_IB_PID_SET(0)), + dump_register(C8SECTPFE_IB_PKT_LEN(0)), + dump_register(C8SECTPFE_IB_BUFF_STRT(0)), + dump_register(C8SECTPFE_IB_BUFF_END(0)), + dump_register(C8SECTPFE_IB_READ_PNT(0)), + dump_register(C8SECTPFE_IB_WRT_PNT(0)), + dump_register(C8SECTPFE_IB_PRI_THRLD(0)), + dump_register(C8SECTPFE_IB_STAT(0)), + dump_register(C8SECTPFE_IB_MASK(0)), + dump_register(C8SECTPFE_IB_SYS(0)), + + dump_register(C8SECTPFE_IB_IP_FMT_CFG(1)), + dump_register(C8SECTPFE_IB_TAGBYTES_CFG(1)), + dump_register(C8SECTPFE_IB_PID_SET(1)), + dump_register(C8SECTPFE_IB_PKT_LEN(1)), + dump_register(C8SECTPFE_IB_BUFF_STRT(1)), + dump_register(C8SECTPFE_IB_BUFF_END(1)), + dump_register(C8SECTPFE_IB_READ_PNT(1)), + dump_register(C8SECTPFE_IB_WRT_PNT(1)), + dump_register(C8SECTPFE_IB_PRI_THRLD(1)), + dump_register(C8SECTPFE_IB_STAT(1)), + dump_register(C8SECTPFE_IB_MASK(1)), + dump_register(C8SECTPFE_IB_SYS(1)), + + dump_register(C8SECTPFE_IB_IP_FMT_CFG(2)), + dump_register(C8SECTPFE_IB_TAGBYTES_CFG(2)), + dump_register(C8SECTPFE_IB_PID_SET(2)), + dump_register(C8SECTPFE_IB_PKT_LEN(2)), + dump_register(C8SECTPFE_IB_BUFF_STRT(2)), + dump_register(C8SECTPFE_IB_BUFF_END(2)), + dump_register(C8SECTPFE_IB_READ_PNT(2)), + dump_register(C8SECTPFE_IB_WRT_PNT(2)), + dump_register(C8SECTPFE_IB_PRI_THRLD(2)), + dump_register(C8SECTPFE_IB_STAT(2)), + dump_register(C8SECTPFE_IB_MASK(2)), + dump_register(C8SECTPFE_IB_SYS(2)), + + dump_register(C8SECTPFE_IB_IP_FMT_CFG(3)), + dump_register(C8SECTPFE_IB_TAGBYTES_CFG(3)), + dump_register(C8SECTPFE_IB_PID_SET(3)), + dump_register(C8SECTPFE_IB_PKT_LEN(3)), + dump_register(C8SECTPFE_IB_BUFF_STRT(3)), + dump_register(C8SECTPFE_IB_BUFF_END(3)), + dump_register(C8SECTPFE_IB_READ_PNT(3)), + dump_register(C8SECTPFE_IB_WRT_PNT(3)), + dump_register(C8SECTPFE_IB_PRI_THRLD(3)), + dump_register(C8SECTPFE_IB_STAT(3)), + dump_register(C8SECTPFE_IB_MASK(3)), + dump_register(C8SECTPFE_IB_SYS(3)), + + dump_register(C8SECTPFE_IB_IP_FMT_CFG(4)), + dump_register(C8SECTPFE_IB_TAGBYTES_CFG(4)), + dump_register(C8SECTPFE_IB_PID_SET(4)), + dump_register(C8SECTPFE_IB_PKT_LEN(4)), + dump_register(C8SECTPFE_IB_BUFF_STRT(4)), + dump_register(C8SECTPFE_IB_
[PATCH 09/12] [media] tsin: c8sectpfe: Add support for various ST NIM cards.
This patch adds support for the following 3 NIM cards: - 1) STV0367-NIM (stv0367 demod with Thompson PLL) 2) B2100A (2x stv0367 demods & 2x NXP tda18212 tuners) 3) STV0903-6110NIM (stv0903 demod + 6110 tuner, lnb24) Signed-off-by: Peter Griffin --- drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.c | 296 +++ drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.h | 20 ++ 2 files changed, 316 insertions(+) create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.c create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.h diff --git a/drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.c b/drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.c new file mode 100644 index 000..5c4ecb4 --- /dev/null +++ b/drivers/media/tsin/c8sectpfe/c8sectpfe-dvb.c @@ -0,0 +1,296 @@ +/* + * c8sectpfe-dvb.c - C8SECTPFE STi DVB driver + * + * Copyright (c) STMicroelectronics 2015 + * + * Author Peter Griffin + * + * 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 +#include +#include +#include + +#include + +#include "c8sectpfe-common.h" +#include "c8sectpfe-core.h" +#include "c8sectpfe-dvb.h" + +#include "dvb-pll.h" +#include "lnbh24.h" +#include "stv0367.h" +#include "stv0367_priv.h" +#include "stv6110x.h" +#include "stv090x.h" +#include "tda18212.h" + +static inline const char *dvb_card_str(unsigned int c) +{ + switch (c) { + case STV0367_PLL_BOARD_NIMA:return "STV0367_PLL_BOARD_NIMA"; + case STV0367_PLL_BOARD_NIMB:return "STV0367_PLL_BOARD_NIMB"; + case STV0367_TDA18212_NIMA_1: return "STV0367_TDA18212_NIMA_1"; + case STV0367_TDA18212_NIMA_2: return "STV0367_TDA18212_NIMA_2"; + case STV0367_TDA18212_NIMB_1: return "STV0367_TDA18212_NIMB_1"; + case STV0367_TDA18212_NIMB_2: return "STV0367_TDA18212_NIMB_2"; + case STV0903_6110_LNB24_NIMA: return "STV0903_6110_LNB24_NIMA"; + case STV0903_6110_LNB24_NIMB: return "STV0903_6110_LNB24_NIMB"; + default:return "unknown dvb frontend card"; + } +} + +static struct stv090x_config stv090x_config = { + .device = STV0903, + .demod_mode = STV090x_SINGLE, + .clk_mode = STV090x_CLK_EXT, + .xtal = 1600, + .address= 0x69, + + .ts1_mode = STV090x_TSMODE_SERIAL_CONTINUOUS, + .ts2_mode = STV090x_TSMODE_SERIAL_CONTINUOUS, + + .repeater_level = STV090x_RPTLEVEL_64, + + .tuner_init = NULL, + .tuner_set_mode = NULL, + .tuner_set_frequency= NULL, + .tuner_get_frequency= NULL, + .tuner_set_bandwidth= NULL, + .tuner_get_bandwidth= NULL, + .tuner_set_bbgain = NULL, + .tuner_get_bbgain = NULL, + .tuner_set_refclk = NULL, + .tuner_get_status = NULL, +}; + +static struct stv6110x_config stv6110x_config = { + .addr = 0x60, + .refclk = 1600, +}; + +#define NIMA 0 +#define NIMB 1 + +static struct stv0367_config stv0367_pll_config[] = { + { + .demod_address = 0x1c, + .xtal = 2700, + .if_khz = 36166, + .if_iq_mode = FE_TER_NORMAL_IF_TUNER, + .ts_mode = STV0367_SERIAL_PUNCT_CLOCK, + .clk_pol = STV0367_CLOCKPOLARITY_DEFAULT, + }, { + .demod_address = 0x1d, + .xtal = 2700, + .if_khz = 36166, + .if_iq_mode = FE_TER_NORMAL_IF_TUNER, + .ts_mode = STV0367_SERIAL_PUNCT_CLOCK, + .clk_pol = STV0367_CLOCKPOLARITY_DEFAULT, + }, +}; + +static struct stv0367_config stv0367_tda18212_config[] = { + { + .demod_address = 0x1c, + .xtal = 1600, + .if_khz = 4500, + .if_iq_mode = FE_TER_NORMAL_IF_TUNER, + .ts_mode = STV0367_SERIAL_PUNCT_CLOCK, + .clk_pol = STV0367_CLOCKPOLARITY_DEFAULT, + }, { + .demod_address = 0x1d, + .xtal = 1600, + .if_khz = 4500, + .if_iq_mode = FE_TER_NORMAL_IF_TUNER, + .ts_mode = STV0367_SERIAL_PUNCT_CLOCK, +
[PATCH 07/12] [media] tsin: c8sectpfe: STiH407/10 Linux DVB demux support
This patch adds support for the c8sectpfe input HW found on STiH407/410 SoC's. It currently supports the TS input block, memdma engine and hw PID filtering blocks of the C8SECTPFE subsystem. The driver creates one LinuxDVB adapter, and a demux/dvr/frontend set of devices for each tsin channel which is specificed in the DT. It has been tested with multiple tsin channels tuned, locked, and grabbing TS simultaneously. Signed-off-by: Peter Griffin --- drivers/media/tsin/c8sectpfe/c8sectpfe-core.c | 1105 + drivers/media/tsin/c8sectpfe/c8sectpfe-core.h | 288 +++ 2 files changed, 1393 insertions(+) create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-core.c create mode 100644 drivers/media/tsin/c8sectpfe/c8sectpfe-core.h diff --git a/drivers/media/tsin/c8sectpfe/c8sectpfe-core.c b/drivers/media/tsin/c8sectpfe/c8sectpfe-core.c new file mode 100644 index 000..fbbe323 --- /dev/null +++ b/drivers/media/tsin/c8sectpfe/c8sectpfe-core.c @@ -0,0 +1,1105 @@ +/* + * c8sectpfe-core.c - C8SECTPFE STi DVB driver + * + * Copyright (c) STMicroelectronics 2015 + * + * Author:Peter Bennett + * Peter Griffin + * + * 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. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "c8sectpfe-core.h" +#include "c8sectpfe-common.h" +#include "c8sectpfe-debugfs.h" +#include "dmxdev.h" +#include "dvb_demux.h" +#include "dvb_frontend.h" +#include "dvb_net.h" + +#define FIRMWARE_MEMDMA "pti_memdma_h407.elf" +MODULE_FIRMWARE(FIRMWARE_MEMDMA); + +#define PID_TABLE_SIZE 1024 +#define POLL_20_HZ_DIV 20 /* poll at 20 Hz */ + +static int load_slim_core_fw(struct c8sectpfei *fei); + +#define TS_PKT_SIZE 188 +#define HEADER_SIZE (4) +#define PACKET_SIZE (TS_PKT_SIZE+HEADER_SIZE) + +#define FEI_ALIGNMENT (32) +/* hw requires minimum of 8*PACKET_SIZE and padded to 8byte boundary */ +#define FEI_BUFFER_SIZE (8*PACKET_SIZE*340) + +#define FIFO_LEN 1024 + +static void c8sectpfe_timer_interrupt(unsigned long ac8sectpfei) +{ + struct c8sectpfei *fei = (struct c8sectpfei *)ac8sectpfei; + struct channel_info *channel; + int chan_num; + + /* iterate through input block channels */ + for (chan_num = 0; chan_num < fei->tsin_count; chan_num++) { + channel = fei->channel_data[chan_num]; + + /* is this descriptor initialised and TP enabled */ + if (channel->irec && readl((void __iomem *) + &channel->irec->tp_enable)) + tasklet_schedule(&channel->tsklet); + } + + fei->timer.expires = jiffies + (HZ / POLL_20_HZ_DIV); + add_timer(&fei->timer); +} + +static void channel_swdemux_tsklet(unsigned long data) +{ + struct channel_info *channel = (struct channel_info *)data; + struct c8sectpfei *fei = channel->fei; + struct tpentry *ptrblk; + unsigned long wp, rp; + int pos, num_packets, n, size; + u8 *buf; + + BUG_ON(!channel); + BUG_ON(!channel->irec); + + ptrblk = &channel->irec->ptr_data[0]; + + wp = readl((void __iomem *)&ptrblk->dma_bus_wp); + rp = readl((void __iomem *)&ptrblk->dma_bus_rp); + + pos = rp - channel->back_buffer_busaddr; + + /* has it wrapped */ + if (wp < rp) + wp = channel->back_buffer_busaddr + FEI_BUFFER_SIZE; + + size = wp - rp; + num_packets = size / PACKET_SIZE; + + /* manage cache so data is visible to CPU */ + dma_sync_single_for_cpu(fei->dev, + rp, + size, + DMA_FROM_DEVICE); + + buf = (u8 *) channel->back_buffer_aligned; + + dev_dbg(fei->dev, + "chan=%d channel=%p num_packets = %d, buf = %p, pos = 0x%x\n\t" + "rp=0x%lx, wp=0x%lx\n", + channel->tsin_id, channel, num_packets, buf, pos, rp, wp); + + for (n = 0; n < num_packets; n++) { + dvb_dmx_swfilter_packets( + &fei->c8sectpfe[0]-> + demux[channel->demux_mapping].dvb_demux, + &buf[pos], 1); + + pos += PACKET_SIZE; + } + + /* advance the read pointer */ + if (wp == (channel->back_buffer_busaddr + FEI_BUFFER_SIZE)) +
[PATCH 02/12] [media] dvb-pll: Add support for THOMSON DTT7546X tuner.
This is used in conjunction with the STV0367 demodulator on the STV0367-NIM-V1.0 NIM card which can be used with the STi STB SoC's. This tuner has a fifth register, so some changes have been made to accommodate this. Signed-off-by: Peter Griffin --- drivers/media/dvb-frontends/dvb-pll.c | 74 +-- drivers/media/dvb-frontends/dvb-pll.h | 1 + 2 files changed, 64 insertions(+), 11 deletions(-) diff --git a/drivers/media/dvb-frontends/dvb-pll.c b/drivers/media/dvb-frontends/dvb-pll.c index 6d8fe88..f7381c7 100644 --- a/drivers/media/dvb-frontends/dvb-pll.c +++ b/drivers/media/dvb-frontends/dvb-pll.c @@ -141,6 +141,35 @@ static struct dvb_pll_desc dvb_pll_thomson_dtt7520x = { }, }; +static void thomson_dtt7546x_bw(struct dvb_frontend *fe, u8 *buf) +{ + /* set CB2 reg - set ATC, XTO */ + buf[4] = 0xc3; +} + +static struct dvb_pll_desc dvb_pll_thomson_dtt7546x = { + .name = "Thomson dtt7546x", + .min = 4425, + .max = 86325, + .set = thomson_dtt7546x_bw, + .iffreq= 3617, + .count = 12, + .entries = { + { 12100, 17, 0x88, 0x01 }, + { 14100, 17, 0x88, 0x41 }, + { 16600, 17, 0x88, 0x81 }, + { 18200, 17, 0x88, 0xc1 }, + { 28600, 17, 0x88, 0x02 }, + { 38600, 17, 0x88, 0x42 }, + { 44600, 17, 0x88, 0x82 }, + { 46600, 17, 0x88, 0xc2 }, + { 50600, 17, 0x88, 0x08 }, + { 76100, 17, 0x88, 0x48 }, + { 84600, 17, 0x88, 0x88 }, + { 90500, 17, 0x88, 0xc8 }, + }, +}; + static struct dvb_pll_desc dvb_pll_lg_z201 = { .name = "LG z201", .min = 17400, @@ -537,6 +566,7 @@ static struct dvb_pll_desc dvb_pll_alps_tdee4 = { static struct dvb_pll_desc *pll_list[] = { [DVB_PLL_UNDEFINED] = NULL, [DVB_PLL_THOMSON_DTT7579]= &dvb_pll_thomson_dtt7579, + [DVB_PLL_THOMSON_DTT7546X] = &dvb_pll_thomson_dtt7546x, [DVB_PLL_THOMSON_DTT759X]= &dvb_pll_thomson_dtt759x, [DVB_PLL_THOMSON_DTT7520X] = &dvb_pll_thomson_dtt7520x, [DVB_PLL_LG_Z201]= &dvb_pll_lg_z201, @@ -561,7 +591,7 @@ static struct dvb_pll_desc *pll_list[] = { /* code*/ static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf, -const u32 frequency) + const u32 frequency, const u32 len) { struct dvb_pll_priv *priv = fe->tuner_priv; struct dvb_pll_desc *desc = priv->pll_desc; @@ -593,11 +623,15 @@ static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf, if (desc->set) desc->set(fe, buf); - if (debug) - printk("pll: %s: div=%d | buf=0x%02x,0x%02x,0x%02x,0x%02x\n", - desc->name, div, buf[0], buf[1], buf[2], buf[3]); + if (debug) { + printk(KERN_DEBUG "pll: %s: div=%d | buf=", desc->name, div); + for (i = 0; i < len; i++) + printk(KERN_DEBUG "0x%02x,", buf[i]); - // calculate the frequency we set it to + printk(KERN_DEBUG "\n"); + } + + /* calculate the frequency we set it to */ return (div * desc->entries[i].stepsize) - desc->iffreq; } @@ -634,21 +668,39 @@ static int dvb_pll_sleep(struct dvb_frontend *fe) return -EINVAL; } +static int dvb_pll_get_num_regs(struct dvb_pll_priv *priv) +{ + int num_regs = 4; + + if (strncmp(priv->pll_desc->name, "Thomson dtt7546x", 16) == 0) + num_regs = 5; + + return num_regs; +} + static int dvb_pll_set_params(struct dvb_frontend *fe) { struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dvb_pll_priv *priv = fe->tuner_priv; - u8 buf[4]; - struct i2c_msg msg = - { .addr = priv->pll_i2c_address, .flags = 0, - .buf = buf, .len = sizeof(buf) }; + struct i2c_msg msg; + u8 *bufp; int result; u32 frequency = 0; + bufp = kzalloc(dvb_pll_get_num_regs(priv), GFP_KERNEL); + + if (!bufp) + return -ENOMEM; + + msg.addr = priv->pll_i2c_address; + msg.flags = 0; + msg.buf = bufp; + msg.len = dvb_pll_get_num_regs(priv); + if (priv->i2c == NULL) return -EINVAL; - result = dvb_pll_configure(fe, buf, c->frequency); + result = dvb_pll_configure(fe, bufp, c->frequency, msg.len); if (result < 0) return result; else @@ -677,7 +729,7 @@ static
[PATCH 12/12] MAINTAINERS: Add c8sectpfe driver directory to STi section
Add the new c8sectpfe demux driver to the STi section of the MAINTAINERS file. Signed-off-by: Peter Griffin --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index d8afd29..49c8963 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1481,6 +1481,7 @@ F:arch/arm/boot/dts/sti* F: drivers/clocksource/arm_global_timer.c F: drivers/i2c/busses/i2c-st.c F: drivers/media/rc/st_rc.c +F: drivers/media/tsin/c8sectpfe/ F: drivers/mmc/host/sdhci-st.c F: drivers/phy/phy-miphy28lp.c F: drivers/phy/phy-miphy365x.c -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 04/12] [media] stv0367: Add support for 16Mhz reference clock
The B2100A dvb NIM card from ST has 2x stv0367 demodulators and 2x TDA18212 silicon tuners, with a 16Mhz crystal. To get this working properly with the upstream driver we need to add support for the 16Mhz reference clock. Signed-off-by: Peter Griffin --- drivers/media/dvb-frontends/stv0367.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/dvb-frontends/stv0367.c index c3b7e6c..ad7cab7 100644 --- a/drivers/media/dvb-frontends/stv0367.c +++ b/drivers/media/dvb-frontends/stv0367.c @@ -1554,6 +1554,11 @@ static int stv0367ter_init(struct dvb_frontend *fe) switch (state->config->xtal) { /*set internal freq to 53.125MHz */ + case 1600: + stv0367_writereg(state, R367TER_PLLMDIV, 0x2); + stv0367_writereg(state, R367TER_PLLNDIV, 0x1b); + stv0367_writereg(state, R367TER_PLLSETUP, 0x18); + break; case 2500: stv0367_writereg(state, R367TER_PLLMDIV, 0xa); stv0367_writereg(state, R367TER_PLLNDIV, 0x55); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 03/12] [media] stv0367: Refine i2c error trace to include i2c address
When using stv0367 demodulator with STi STB platforms, we can have easily have four or more stv0367 demods running in the system at one time. As typically the b2120 reference design ships with a b2004a daughter board, which can accept two dvb NIM cards, and each b2100A NIM has 2x stv0367 demods and 2x NXPs tuner on it. In such circumstances it is useful to print the i2c address on error messages to know which one is failing due to I2C issues. Signed-off-by: Peter Griffin --- drivers/media/dvb-frontends/stv0367.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/dvb-frontends/stv0367.c index b31ff26..c3b7e6c 100644 --- a/drivers/media/dvb-frontends/stv0367.c +++ b/drivers/media/dvb-frontends/stv0367.c @@ -791,11 +791,13 @@ int stv0367_writeregs(struct stv0367_state *state, u16 reg, u8 *data, int len) memcpy(buf + 2, data, len); if (i2cdebug) - printk(KERN_DEBUG "%s: %02x: %02x\n", __func__, reg, buf[2]); + printk(KERN_DEBUG "%s: [%02x] %02x: %02x\n", __func__, + state->config->demod_address, reg, buf[2]); ret = i2c_transfer(state->i2c, &msg, 1); if (ret != 1) - printk(KERN_ERR "%s: i2c write error!\n", __func__); + printk(KERN_ERR "%s: i2c write error! ([%02x] %02x: %02x)\n", + __func__, state->config->demod_address, reg, buf[2]); return (ret != 1) ? -EREMOTEIO : 0; } @@ -829,10 +831,12 @@ static u8 stv0367_readreg(struct stv0367_state *state, u16 reg) ret = i2c_transfer(state->i2c, msg, 2); if (ret != 2) - printk(KERN_ERR "%s: i2c read error\n", __func__); + printk(KERN_ERR "%s: i2c read error ([%02x] %02x: %02x)\n", + __func__, state->config->demod_address, reg, b1[0]); if (i2cdebug) - printk(KERN_DEBUG "%s: %02x: %02x\n", __func__, reg, b1[0]); + printk(KERN_DEBUG "%s: [%02x] %02x: %02x\n", __func__, + state->config->demod_address, reg, b1[0]); return b1[0]; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 05/12] [media] tsin: c8sectpfe: Add DT bindings documentation for c8sectpfe driver.
This patch adds the DT bindings documentation for the c8sectpfe LinuxDVB demux driver whose IP is in the STiH407 family silicon SoC's. Signed-off-by: Peter Griffin --- .../bindings/media/stih407-c8sectpfe.txt | 90 ++ include/dt-bindings/media/c8sectpfe.h | 14 2 files changed, 104 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt create mode 100644 include/dt-bindings/media/c8sectpfe.h diff --git a/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt new file mode 100644 index 000..1ed4b12 --- /dev/null +++ b/Documentation/devicetree/bindings/media/stih407-c8sectpfe.txt @@ -0,0 +1,90 @@ +STMicroelectronics STi c8sectpfe binding + + +This document describes the c8sectpfe device bindings that is used to get transport +stream data into the SoC on the TS pins, and into DDR for further processing. + +It is typically used in conjunction with one or more demodulator and tuner devices +which converts from the RF to digital domain. Demodulators and tuners are usually +located on an external DVB frontend card connected to SoC TS input pins. + +Currently 7 TS input (tsin) channels are supported on the stih407 family SoC. + +Required properties (controller (parent) node): +- compatible : Should be "stih407-c8sectpfe" + +- reg : Address and length of register sets for each device in + "reg-names" + +- reg-names: The names of the register addresses corresponding to the + registers filled in "reg": + - c8sectpfe: c8sectpfe registers + - c8sectpfe-ram: c8sectpfe internal sram + +- clocks : phandle list of c8sectpfe clocks +- clock-names : should be "c8sectpfe" +See: Documentation/devicetree/bindings/clock/clock-bindings.txt + +- pinctrl-names: a pinctrl state named tsin%d-serial or tsin%d-parallel (where %d is tsin-num) + must be defined for each tsin child node. +- pinctrl-0: phandle referencing pin configuration for this tsin configuration +See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt + + +Required properties (tsin (child) node): + +- tsin-num : tsin id of the InputBlock (must be between 0 to 6) +- i2c-bus : phandle to the I2C bus DT node which the demodulators & tuners on this tsin channel are connected. +- rst-gpio : reset gpio for this tsin channel. + +Optional properties (tsin (child) node): + +- invert-ts-clk: Bool property to control sense of ts input clock (data stored on falling edge of clk). +- serial-not-parallel : Bool property to configure input bus width (serial on ts_data<7>). +- async-not-sync : Bool property to control if data is received in asynchronous mode + (all bits/bytes with ts_valid or ts_packet asserted are valid). + +- dvb-card : Describes the NIM card connected to this tsin channel. + +Example: + +/* stih410 SoC b2120 + b2004a + stv0367-pll(NIMB) + stv0367-tda18212 (NIMA) DT example) */ + + c8sectpfe@08a2 { + compatible = "st,stih407-c8sectpfe"; + status = "okay"; + reg = <0x08a2 0x1>, <0x08a0 0x4000>; + reg-names = "stfe", "stfe-ram"; + interrupts = <0 34 0>, <0 35 0>; + interrupt-names = "stfe-error-irq", "stfe-idle-irq"; + + pinctrl-names = "tsin0-serial", "tsin0-parallel", "tsin3-serial", + "tsin4-serial", "tsin5-serial"; + + pinctrl-0 = <&pinctrl_tsin0_serial>; + pinctrl-1 = <&pinctrl_tsin0_parallel>; + pinctrl-2 = <&pinctrl_tsin3_serial>; + pinctrl-3 = <&pinctrl_tsin4_serial_alt3>; + pinctrl-4 = <&pinctrl_tsin5_serial_alt1>; + + clocks = <&clk_s_c0_flexgen CLK_PROC_STFE>; + clock-names = "stfe"; + + /* tsin0 is TSA on NIMA */ + tsin0: port@0 { + tsin-num= <0>; + serial-not-parallel; + i2c-bus = <&ssc2>; + rst-gpio= <&pio15 4 0>; + dvb-card= ; + }; + + /* tsin3 is TSB on NIMB */ + tsin3: port@3 { + tsin-num= <3>; + serial-not-parallel; + i2c-bus
[PATCH 01/12] ARM: DT: STi: stihxxx-b2120: Add pulse-width properties to ssc2 & ssc3
Adding these properties makes the I2C bus to the demodulators much more reliable, and we no longer suffer from I2C errors when tuning. Signed-off-by: Peter Griffin --- arch/arm/boot/dts/stihxxx-b2120.dtsi | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/stihxxx-b2120.dtsi b/arch/arm/boot/dts/stihxxx-b2120.dtsi index c1d8590..1f27589 100644 --- a/arch/arm/boot/dts/stihxxx-b2120.dtsi +++ b/arch/arm/boot/dts/stihxxx-b2120.dtsi @@ -27,12 +27,18 @@ }; }; - i2c@9842000 { + ssc2: i2c@9842000 { status = "okay"; + clock-frequency = <10>; + st,i2c-min-scl-pulse-width-us = <0>; + st,i2c-min-sda-pulse-width-us = <5>; }; - i2c@9843000 { + ssc3: i2c@9843000 { status = "okay"; + clock-frequency = <10>; + st,i2c-min-scl-pulse-width-us = <0>; + st,i2c-min-sda-pulse-width-us = <5>; }; i2c@9844000 { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [STLinux Kernel] [PATCH 1/3] media: st-rc: move to using reset_control_get_optional
Hi Srini, Sorry seems I never replied to this. > >>drivers/media/rc/st_rc.c:281:15: warning: assignment makes pointer > >>from integer without a cast [enabled by default] > >> rc_dev->rstc = reset_control_get(dev, NULL); > > > >Is managing the reset line actually optional though? I can't test atm as I > >don't have > >access to my board, but quite often if the IP's aren't taken out of reset > >reads / writes > >to the perhpiheral will hang the SoC. > > > Yes and No. > AFAIK reset line is optional on SOCs like 7108, 7141. > I think having the driver function without reset might is a value > add in case we plan to reuse the mainline driver for these SOCs. Yes that is a good point, for the series: - Acked-by: Peter Griffin regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [STLinux Kernel] [PATCH 3/3] media: st-rc: Remove .owner field for driver
On Mon, 22 Sep 2014, Srinivas Kandagatla wrote: > There is no need to init .owner field. > > Based on the patch from Peter Griffin > "mmc: remove .owner field for drivers using module_platform_driver" > > This patch removes the superflous .owner field for drivers which > use the module_platform_driver API, as this is overriden in > platform_driver_register anyway." > > Signed-off-by: Srinivas Kandagatla Acked by: Acked-by: Peter Griffin -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [STLinux Kernel] [PATCH 1/3] media: st-rc: move to using reset_control_get_optional
Hi Srini, On Mon, 22 Sep 2014, Srinivas Kandagatla wrote: > This patch fixes a compilation error while building with the > random kernel configuration. > > drivers/media/rc/st_rc.c: In function 'st_rc_probe': > drivers/media/rc/st_rc.c:281:2: error: implicit declaration of > function 'reset_control_get' [-Werror=implicit-function-declaration] > rc_dev->rstc = reset_control_get(dev, NULL); > > drivers/media/rc/st_rc.c:281:15: warning: assignment makes pointer > from integer without a cast [enabled by default] > rc_dev->rstc = reset_control_get(dev, NULL); Is managing the reset line actually optional though? I can't test atm as I don't have access to my board, but quite often if the IP's aren't taken out of reset reads / writes to the perhpiheral will hang the SoC. If managing the reset line isn't optional then I think the correct fix is to add depends on RESET_CONTROLLER in the kconfig. This will then do the right thing for randconfig builds as well. regards, Peter. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html