Re: [PATCH v3 2/3] hwmon: xgene: Add hwmon driver

2016-09-08 Thread Arnd Bergmann
On Wednesday, September 7, 2016 3:37:05 PM CEST Guenter Roeck wrote:
> On Wed, Sep 07, 2016 at 11:41:44PM +0200, Arnd Bergmann wrote:
> > On Thursday, July 21, 2016 1:55:56 PM CEST Hoan Tran wrote:
> > > +   ctx->comm_base_addr = cppc_ss->base_address;
> > > +   if (ctx->comm_base_addr) {
> > > +   ctx->pcc_comm_addr =
> > > +   
> > > acpi_os_ioremap(ctx->comm_base_addr,
> > > +   cppc_ss->length);
> > > 
> > 
> > This causes the arm64 allmodconfig build to fail now, according to
> > kernelci:
> > 
> >   1  ERROR: "memblock_is_memory" [drivers/hwmon/xgene-hwmon.ko] 
> > undefined!
> > 
> > Should this perhaps call ioremap() or memremap() instead?
> > 
> Hmmm ... almost sounds to me like blaming the messenger. e7cd190385d1 ("arm64:
> mark reserved memblock regions explicitly in iomem") starts using a function
> in acpi_os_ioremap() which is not exported. On top of that, 
> memblock_is_memory()
> is declared as __init_memblock, which makes me really uncomfortable.
> If acpi_os_ioremap() must not be used by modules, and possibly only during
> early (?) initialization, maybe its declaration should state those 
> limitations ?

Ah, I didn't notice that. I guess both patches were correct individually and
got added to linux-next around the same time but caused allmodconfig to blow up
when used together.

Adding everyone who was involved in the memblock patch to Cc here, maybe one
of them has an idea what the correct fix is. There are only two other drivers
using acpi_os_ioremap() and one of them is x86-specific, so it's still likely
that drivers are not actually supposed to use this symbol. Making
acpi_os_ioremap() an exported function in arm64 would also work.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" 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 2/3] hwmon: xgene: Add hwmon driver

2016-09-08 Thread Arnd Bergmann
On Wednesday, September 7, 2016 3:27:54 PM CEST Guenter Roeck wrote:
> On Wed, Sep 07, 2016 at 11:41:44PM +0200, Arnd Bergmann wrote:
> > On Thursday, July 21, 2016 1:55:56 PM CEST Hoan Tran wrote:
> > > +   ctx->comm_base_addr = cppc_ss->base_address;
> > > +   if (ctx->comm_base_addr) {
> > > +   ctx->pcc_comm_addr =
> > > +   
> > > acpi_os_ioremap(ctx->comm_base_addr,
> > > +   cppc_ss->length);
> > > 
> > 
> > This causes the arm64 allmodconfig build to fail now, according to
> > kernelci:
> > 
> >   1  ERROR: "memblock_is_memory" [drivers/hwmon/xgene-hwmon.ko] 
> > undefined!
> > 
> How do you even get there ? arm64:allmodconfig fails for me in -next with
> 
> drivers/pwm/pwm-berlin.c: In function ‘berlin_pwm_suspend’:
> drivers/pwm/pwm-berlin.c:245:35: error: ‘struct berlin_pwm_chip’ has no 
> member named ‘chips’

That was fixed in yesterday's linux-next.

Arnd

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


Re: Source and Make files under Documentation directory

2016-09-08 Thread Jonathan Corbet
On Wed, 7 Sep 2016 18:11:59 -0600
Shuah Khan  wrote:

> I noticed there are several source files and Makefiles under the
> Documentation directory. Some of them look very much like tests.
> 
> If they are indeed tests, maybe it is worth while to move them to
> selftests? If you think this topic needs larger audience, I could
> send in a KS topic for discussion. If we can identify useful tests,
> I can volunteer to get them into selftests

Moving runnable code out of Documentation/ into tests/ or tools/ as
appropriate has been a long-term goal, and some progress has been made.
I don't really think we need a KS session for it, I don't think
there's really any disagreement here; it's just a matter of getting the
work done.  If you see something that would be better placed elsewhere and
have the time, just send a patch making the change.

Thanks,

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


Re: [PATCHv12 1/3] rdmacg: Added rdma cgroup controller

2016-09-08 Thread Parav Pandit
On Thu, Sep 8, 2016 at 11:42 AM, Leon Romanovsky  wrote:
> On Wed, Sep 07, 2016 at 08:37:23PM +0530, Parav Pandit wrote:
>> Did you get a chance to review the series?
>
> We need to decide on fundamental question before reviewing it, which is
> "how to fit rdmacg to new ABI model".

>From last discussion with Matan in this email thread, it appears that -
only broken case are:
(a) HW vendor driver specific resources (if they have crazy big list),
which cannot be abstracted out well enough, won't be controlled by
rdma cgroup.
(b) Such resource objects are not well defined today with new ABI model.
If such objects are well defined today, lets call them out and discuss
with Doug, Tejun, Christoph and larger group, whether they qualify for
inclusion or not.

rdma cgroup currently supports including handful of HW resource that
can be abstracted (at least at functionality level).

Please include any other option issue, if any.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] cpufreq-stats: Minor documentation fix

2016-09-08 Thread Jean Delvare
The cpufreq-stats code can no longer be built as a module, so it now
appears with square brackets in menuconfig.

Signed-off-by: Jean Delvare 
Fixes: 1aefc75b2449 ("cpufreq: stats: Make the stats code non-modular")
Cc: Rafael J. Wysocki 
Cc: Viresh Kumar 
---
 Documentation/cpu-freq/cpufreq-stats.txt |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-4.8-rc5.orig/Documentation/cpu-freq/cpufreq-stats.txt 2016-09-04 
23:31:46.0 +0200
+++ linux-4.8-rc5/Documentation/cpu-freq/cpufreq-stats.txt  2016-09-08 
11:34:34.805606601 +0200
@@ -103,7 +103,7 @@ Config Main Menu
Power management options (ACPI, APM)  --->
CPU Frequency scaling  --->
[*] CPU Frequency scaling
-   <*>   CPU frequency translation statistics 
+   [*]   CPU frequency translation statistics
[*] CPU frequency translation statistics details
 
 


-- 
Jean Delvare
SUSE L3 Support
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" 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 2/3] hwmon: xgene: Add hwmon driver

2016-09-08 Thread James Morse
Hi,

On 08/09/16 09:14, Arnd Bergmann wrote:
> On Wednesday, September 7, 2016 3:37:05 PM CEST Guenter Roeck wrote:
>> On Wed, Sep 07, 2016 at 11:41:44PM +0200, Arnd Bergmann wrote:
>>> On Thursday, July 21, 2016 1:55:56 PM CEST Hoan Tran wrote:
 +   ctx->comm_base_addr = cppc_ss->base_address;
 +   if (ctx->comm_base_addr) {
 +   ctx->pcc_comm_addr =
 +   
 acpi_os_ioremap(ctx->comm_base_addr,
 +   cppc_ss->length);

>>>
>>> This causes the arm64 allmodconfig build to fail now, according to
>>> kernelci:
>>>
>>>   1  ERROR: "memblock_is_memory" [drivers/hwmon/xgene-hwmon.ko] 
>>> undefined!
>>>
>>> Should this perhaps call ioremap() or memremap() instead?
>>>
>> Hmmm ... almost sounds to me like blaming the messenger. e7cd190385d1 
>> ("arm64:
>> mark reserved memblock regions explicitly in iomem") starts using a function
>> in acpi_os_ioremap() which is not exported. On top of that, 
>> memblock_is_memory()
>> is declared as __init_memblock, which makes me really uncomfortable.
>> If acpi_os_ioremap() must not be used by modules, and possibly only during
>> early (?) initialization, maybe its declaration should state those 
>> limitations ?
> 
> Ah, I didn't notice that. I guess both patches were correct individually and
> got added to linux-next around the same time but caused allmodconfig to blow 
> up
> when used together.
> 
> Adding everyone who was involved in the memblock patch to Cc here, maybe one
> of them has an idea what the correct fix is. There are only two other drivers
> using acpi_os_ioremap() and one of them is x86-specific, so it's still likely
> that drivers are not actually supposed to use this symbol. Making
> acpi_os_ioremap() an exported function in arm64 would also work.

You could use acpi_os_map_iomem()/acpi_os_unmap_iomem() from acpi/acpi_io.h.
If there isn't an existing mapping these end up in acpi_os_ioremap(), and are
already EXPORT_SYMBOL_GPL().

(I'm still waiting for allmodconfig on linux-next to finish building)


Thanks,

James


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


Re: [PATCH] cpufreq-stats: Minor documentation fix

2016-09-08 Thread Viresh Kumar
On 08-09-16, 12:39, Jean Delvare wrote:
> The cpufreq-stats code can no longer be built as a module, so it now
> appears with square brackets in menuconfig.
> 
> Signed-off-by: Jean Delvare 
> Fixes: 1aefc75b2449 ("cpufreq: stats: Make the stats code non-modular")
> Cc: Rafael J. Wysocki 
> Cc: Viresh Kumar 
> ---
>  Documentation/cpu-freq/cpufreq-stats.txt |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-4.8-rc5.orig/Documentation/cpu-freq/cpufreq-stats.txt   
> 2016-09-04 23:31:46.0 +0200
> +++ linux-4.8-rc5/Documentation/cpu-freq/cpufreq-stats.txt2016-09-08 
> 11:34:34.805606601 +0200
> @@ -103,7 +103,7 @@ Config Main Menu
>   Power management options (ACPI, APM)  --->
>   CPU Frequency scaling  --->
>   [*] CPU Frequency scaling
> - <*>   CPU frequency translation statistics 
> + [*]   CPU frequency translation statistics
>   [*] CPU frequency translation statistics details

Acked-by: Viresh Kumar 

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" 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] docs-rst: ignore arguments on macro definitions

2016-09-08 Thread Mauro Carvalho Chehab
Hi Jon/Markus,

Em Mon, 29 Aug 2016 16:12:39 +0200
Markus Heiser  escreveu:

> Am 29.08.2016 um 15:13 schrieb Mauro Carvalho Chehab 
> :
> 
> > A macro definition is mapped via .. c:function:: at the
> > ReST markup when using the following kernel-doc tag:
> > 
> > /**
> >  * DMX_FE_ENTRY - Casts elements in the list of registered
> >  *   front-ends from the generic type struct list_head
> >  *   to the type * struct dmx_frontend
> >  *
> >  * @list: list of struct dmx_frontend
> >  */
> >  #define DMX_FE_ENTRY(list) \
> > list_entry(list, struct dmx_frontend, connectivity_list)
> > 
> > However, unlike a function description, the arguments of a macro
> > doesn't contain the data type.
> > 
> > This causes warnings when enabling Sphinx on nitkpick mode,
> > like this one:
> > ./drivers/media/dvb-core/demux.h:358: WARNING: c:type reference target 
> > not found: list  
> 
> I think this is a drawback of sphinx's C-domain, using function
> definition for macros also. From the function documentation
> 
>  """This is also used to describe function-like preprocessor
> macros. The names of the arguments should be given so
> they may be used in the description."""
> 
> I think about to fix the nitpick message for macros (aka function
> directive) in the C-domain extension (we already have).
> 
> But for this, I need a rule to distinguish between macros
> and functions ... is the uppercase of the macro name a good
> rule to suppress the nitpick message? Any other suggestions?

What's the status of the C domain patches meant to fix this issue?

I managed to fix most warnings on media documents on nitpick mode.
With this patch applied, there are only 21 warnings (and all are
due to the lack of function or struct documentation). I'm about
to patchbomb such fixup series.

Yet, without  this patch, and latest docs-next, there are 20 extra
bogus warnings, due to function parameters:

 ./drivers/media/dvb-core/dvb_ringbuffer.h:121: WARNING: c:type reference 
target not found: rbuf
 ./drivers/media/dvb-core/dvb_ringbuffer.h:121: WARNING: c:type reference 
target not found: offs
 ./drivers/media/dvb-core/dvb_ringbuffer.h:130: WARNING: c:type reference 
target not found: rbuf
 ./drivers/media/dvb-core/dvb_ringbuffer.h:130: WARNING: c:type reference 
target not found: num
 ./drivers/media/dvb-core/dvb_ringbuffer.h:173: WARNING: c:type reference 
target not found: rbuf
 ./drivers/media/dvb-core/dvb_ringbuffer.h:173: WARNING: c:type reference 
target not found: byte
 ./drivers/media/dvb-core/demux.h:358: WARNING: c:type reference target not 
found: list
 ./include/media/media-device.h:263: WARNING: c:type reference target not 
found: mdev
 ./include/media/media-device.h:495: WARNING: c:type reference target not 
found: mdev
 ./include/media/media-device.h:495: WARNING: c:type reference target not 
found: udev
 ./include/media/media-device.h:495: WARNING: c:type reference target not 
found: name
 ./include/media/media-entity.h:527: WARNING: c:type reference target not 
found: gobj
 ./include/media/media-entity.h:536: WARNING: c:type reference target not 
found: gobj
 ./include/media/media-entity.h:545: WARNING: c:type reference target not 
found: gobj
 ./include/media/media-entity.h:554: WARNING: c:type reference target not 
found: gobj
 ./include/media/media-entity.h:563: WARNING: c:type reference target not 
found: intf
 ./include/media/media-entity.h:1041: WARNING: c:type reference target not 
found: entity
 ./include/media/media-entity.h:1041: WARNING: c:type reference target not 
found: operation
 ./include/media/v4l2-ctrls.h:397: WARNING: c:type reference target not found: 
hdl
 ./include/media/v4l2-ctrls.h:397: WARNING: c:type reference target not found: 
nr_of_controls_hint

So, it would be great if we could either merge this patch or the ones that
Markus did (assuming they're ready for merge).

Regards,
Mauro

> 
> -- Markus --
> 
> > 
> > That happens because kernel-doc output for the above is:
> > 
> > .. c:function:: DMX_FE_ENTRY ( list)
> > 
> >Casts elements in the list of registered front-ends from the generic 
> > type struct list_head to the type * struct dmx_frontend
> > 
> > **Parameters**
> > 
> > ``list``
> >   list of struct dmx_frontend
> > 
> > As the type is blank, Sphinx would think that ``list`` is a type,
> > and will try to add a cross reference for it, using their internal
> > representation for c:type:`list`.
> > 
> > However, ``list`` is not a type. So, that would cause either the
> > above warning, or if a ``list`` type exists, it would create
> > a reference to the wrong place at the doc.
> > 
> > To avoid that, let's ommit macro arguments from c:function::
> > declaration. As each argument will appear below the Parameters,
> > the type of the argument can be described there, if needed.
> > 
> > Signed-off-by: Mauro Carvalho Chehab 
> > ---
> > 
> > v3: version 2 patch caused a regression wh

[PATCH 13/47] [media] rc-map.h: document structs/enums on it

2016-09-08 Thread Mauro Carvalho Chehab
There are some structs/enums that aren't documented via
kernel-doc markup. Add documentation for them.

Fix those warnings:
./include/media/rc-map.h:103: WARNING: c:type reference target not found: 
rc_map_list
./include/media/rc-map.h:110: WARNING: c:type reference target not found: 
rc_map_list
./include/media/rc-map.h:117: WARNING: c:type reference target not found: rc_map

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/rc-map.h | 94 ++
 1 file changed, 71 insertions(+), 23 deletions(-)

diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index daa75fcc1ff1..173ad58fb61b 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -11,27 +11,51 @@
 
 #include 
 
+/**
+ * enum rc_type - type of the Remote Controller protocol
+ *
+ * @RC_TYPE_UNKNOWN: Protocol not known
+ * @RC_TYPE_OTHER: Protocol known but proprietary
+ * @RC_TYPE_RC5: Philips RC5 protocol
+ * @RC_TYPE_RC5X: Philips RC5x protocol
+ * @RC_TYPE_RC5_SZ: StreamZap variant of RC5
+ * @RC_TYPE_JVC: JVC protocol
+ * @RC_TYPE_SONY12: Sony 12 bit protocol
+ * @RC_TYPE_SONY15: Sony 15 bit protocol
+ * @RC_TYPE_SONY20: Sony 20 bit protocol
+ * @RC_TYPE_NEC: NEC protocol
+ * @RC_TYPE_SANYO: Sanyo protocol
+ * @RC_TYPE_MCE_KBD: RC6-ish MCE keyboard/mouse
+ * @RC_TYPE_RC6_0: Philips RC6-0-16 protocol
+ * @RC_TYPE_RC6_6A_20: Philips RC6-6A-20 protocol
+ * @RC_TYPE_RC6_6A_24: Philips RC6-6A-24 protocol
+ * @RC_TYPE_RC6_6A_32: Philips RC6-6A-32 protocol
+ * @RC_TYPE_RC6_MCE: MCE (Philips RC6-6A-32 subtype) protocol
+ * @RC_TYPE_SHARP: Sharp protocol
+ * @RC_TYPE_XMP: XMP protocol
+ * @RC_TYPE_CEC: CEC protocol
+ */
 enum rc_type {
-   RC_TYPE_UNKNOWN = 0,/* Protocol not known */
-   RC_TYPE_OTHER   = 1,/* Protocol known but proprietary */
-   RC_TYPE_RC5 = 2,/* Philips RC5 protocol */
-   RC_TYPE_RC5X= 3,/* Philips RC5x protocol */
-   RC_TYPE_RC5_SZ  = 4,/* StreamZap variant of RC5 */
-   RC_TYPE_JVC = 5,/* JVC protocol */
-   RC_TYPE_SONY12  = 6,/* Sony 12 bit protocol */
-   RC_TYPE_SONY15  = 7,/* Sony 15 bit protocol */
-   RC_TYPE_SONY20  = 8,/* Sony 20 bit protocol */
-   RC_TYPE_NEC = 9,/* NEC protocol */
-   RC_TYPE_SANYO   = 10,   /* Sanyo protocol */
-   RC_TYPE_MCE_KBD = 11,   /* RC6-ish MCE keyboard/mouse */
-   RC_TYPE_RC6_0   = 12,   /* Philips RC6-0-16 protocol */
-   RC_TYPE_RC6_6A_20   = 13,   /* Philips RC6-6A-20 protocol */
-   RC_TYPE_RC6_6A_24   = 14,   /* Philips RC6-6A-24 protocol */
-   RC_TYPE_RC6_6A_32   = 15,   /* Philips RC6-6A-32 protocol */
-   RC_TYPE_RC6_MCE = 16,   /* MCE (Philips RC6-6A-32 subtype) 
protocol */
-   RC_TYPE_SHARP   = 17,   /* Sharp protocol */
-   RC_TYPE_XMP = 18,   /* XMP protocol */
-   RC_TYPE_CEC = 19,   /* CEC protocol */
+   RC_TYPE_UNKNOWN = 0,
+   RC_TYPE_OTHER   = 1,
+   RC_TYPE_RC5 = 2,
+   RC_TYPE_RC5X= 3,
+   RC_TYPE_RC5_SZ  = 4,
+   RC_TYPE_JVC = 5,
+   RC_TYPE_SONY12  = 6,
+   RC_TYPE_SONY15  = 7,
+   RC_TYPE_SONY20  = 8,
+   RC_TYPE_NEC = 9,
+   RC_TYPE_SANYO   = 10,
+   RC_TYPE_MCE_KBD = 11,
+   RC_TYPE_RC6_0   = 12,
+   RC_TYPE_RC6_6A_20   = 13,
+   RC_TYPE_RC6_6A_24   = 14,
+   RC_TYPE_RC6_6A_32   = 15,
+   RC_TYPE_RC6_MCE = 16,
+   RC_TYPE_SHARP   = 17,
+   RC_TYPE_XMP = 18,
+   RC_TYPE_CEC = 19,
 };
 
 #define RC_BIT_NONE0ULL
@@ -76,21 +100,45 @@ enum rc_type {
 #define RC_SCANCODE_RC6_0(sys, cmd)(((sys) << 8) | (cmd))
 #define RC_SCANCODE_RC6_6A(vendor, sys, cmd)   (((vendor) << 16) | ((sys) << 
8) | (cmd))
 
+/**
+ * struct rc_map_table - represents a scancode/keycode pair
+ *
+ * @scancode: scan code (u32)
+ * @keycode: Linux input keycode
+ */
 struct rc_map_table {
u32 scancode;
u32 keycode;
 };
 
+/**
+ * struct rc_map - represents a keycode map table
+ *
+ * @scan: pointer to struct &rc_map_table
+ * @size: Max number of entries
+ * @len: Number of entries that are in use
+ * @alloc: size of *scan, in bytes
+ * @rc_type: type of the remote controller protocol, as defined at
+ *  enum &rc_type
+ * @name: name of the key map table
+ * @lock: lock to protect access to this structure
+ */
 struct rc_map {
struct rc_map_table *scan;
-   unsigned intsize;   /* Max number of entries */
-   unsigned intlen;/* Used number of entries */
-   unsigned intalloc;  /* Size of *scan in bytes */
+   unsigned intsize;
+   unsigned intlen;

[PATCH 40/47] [media] libv4l-introdution.rst: fix function definitions

2016-09-08 Thread Mauro Carvalho Chehab
c:type is not the right tag for function definitions.
Replace them by .. c:function::

Signed-off-by: Mauro Carvalho Chehab 
---
 .../media/uapi/v4l/libv4l-introduction.rst | 62 --
 1 file changed, 35 insertions(+), 27 deletions(-)

diff --git a/Documentation/media/uapi/v4l/libv4l-introduction.rst 
b/Documentation/media/uapi/v4l/libv4l-introduction.rst
index 61d085f9f105..1c1278d17fa7 100644
--- a/Documentation/media/uapi/v4l/libv4l-introduction.rst
+++ b/Documentation/media/uapi/v4l/libv4l-introduction.rst
@@ -116,45 +116,53 @@ The common file operation methods are provided by libv4l.
 Those functions operate just like glibc
 open/close/dup/ioctl/read/mmap/munmap:
 
--  :c:type:`int v4l2_open(const char *file, int oflag, ...)` - operates like 
the
-   standard :ref:`open() ` function.
+.. c:function:: int v4l2_open(const char *file, int oflag, ...)
 
--  :c:type:`int v4l2_close(int fd)` - operates like the standard
-   :ref:`close() ` function.
+   operates like the standard :ref:`open() ` function.
 
--  :c:type:`int v4l2_dup(int fd)` - operates like the standard dup() function,
-   duplicating a file handler.
+.. c:function:: int v4l2_close(int fd)
 
--  :c:type:`int v4l2_ioctl (int fd, unsigned long int request, ...)` - operates
-   like the standard :ref:`ioctl() ` function.
+   operates like the standard :ref:`close() ` function.
 
--  :c:type:`int v4l2_read (int fd, void* buffer, size_t n)` - operates like the
-   standard :ref:`read() ` function.
+.. c:function:: int v4l2_dup(int fd)
 
--  :c:type:`void v4l2_mmap(void *start, size_t length, int prot, int flags, int
-   fd, int64_t offset);` - operates like the standard
-   :ref:`mmap() ` function.
+   operates like the standard dup() function, duplicating a file handler.
 
--  :c:type:`int v4l2_munmap(void *_start, size_t length);` - operates like the
-   standard :ref:`munmap() ` function.
+.. c:function:: int v4l2_ioctl (int fd, unsigned long int request, ...)
+
+   operates like the standard :ref:`ioctl() ` function.
+
+.. c:function:: int v4l2_read (int fd, void* buffer, size_t n)
+
+   operates like the standard :ref:`read() ` function.
+
+.. c:function:: void v4l2_mmap(void *start, size_t length, int prot, int 
flags, int fd, int64_t offset);
+
+   operates like the standard :ref:`mmap() ` function.
+
+.. c:function:: int v4l2_munmap(void *_start, size_t length);
+   operates like the standard :ref:`munmap() ` function.
 
 Those functions provide additional control:
 
--  :c:type:`int v4l2_fd_open(int fd, int v4l2_flags)` - opens an already opened
-   fd for further use through v4l2lib and possibly modify libv4l2's
-   default behavior through the v4l2_flags argument. Currently,
-   v4l2_flags can be ``V4L2_DISABLE_CONVERSION``, to disable format
-   conversion.
+.. c:function:: int v4l2_fd_open(int fd, int v4l2_flags)
 
--  :c:type:`int v4l2_set_control(int fd, int cid, int value)` - This function
-   takes a value of 0 - 65535, and then scales that range to the actual
-   range of the given v4l control id, and then if the cid exists and is
+   opens an already opened fd for further use through v4l2lib and possibly
+   modify libv4l2's default behavior through the v4l2_flags argument.
+   Currently, v4l2_flags can be ``V4L2_DISABLE_CONVERSION``, to disable
+   format conversion.
+
+.. c:function:: int v4l2_set_control(int fd, int cid, int value)
+
+   This function takes a value of 0 - 65535, and then scales that range to the
+   actual range of the given v4l control id, and then if the cid exists and is
not locked sets the cid to the scaled value.
 
--  :c:type:`int v4l2_get_control(int fd, int cid)` - This function returns a
-   value of 0 - 65535, scaled to from the actual range of the given v4l
-   control id. when the cid does not exist, could not be accessed for
-   some reason, or some error occurred 0 is returned.
+.. c:function:: int v4l2_get_control(int fd, int cid)
+
+   This function returns a value of 0 - 65535, scaled to from the actual range
+   of the given v4l control id. when the cid does not exist, could not be
+   accessed for some reason, or some error occurred 0 is returned.
 
 
 v4l1compat.so wrapper library
-- 
2.7.4


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


[PATCH 45/47] [media] media-ioc-g-topology.rst: fix a c domain reference

2016-09-08 Thread Mauro Carvalho Chehab
One reference there is still using :ref:. Fix it, to solve this
warning:
  Documentation/media/uapi/mediactl/media-ioc-g-topology.rst:236: WARNING: 
undefined label: media-v2-intf-devnode (if the link has no caption the label 
must precede a section header)

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/mediactl/media-ioc-g-topology.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/mediactl/media-ioc-g-topology.rst 
b/Documentation/media/uapi/mediactl/media-ioc-g-topology.rst
index 0b26fd865b72..48c9531f4db0 100644
--- a/Documentation/media/uapi/mediactl/media-ioc-g-topology.rst
+++ b/Documentation/media/uapi/mediactl/media-ioc-g-topology.rst
@@ -234,7 +234,7 @@ desired arrays with the media graph elements.
-  ``devnode``
 
-  Used only for device node interfaces. See
- :ref:`media-v2-intf-devnode` for details..
+ :c:type:`media_v2_intf_devnode` for details..
 
 
 .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
-- 
2.7.4


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


[PATCH 42/47] [media] hist-v4l2.rst: don't do refs to old structures

2016-09-08 Thread Mauro Carvalho Chehab
Several structs were renamed or removed during V4L2 development.
Don't try to cross-reference the legacy ones.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/hist-v4l2.rst | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/Documentation/media/uapi/v4l/hist-v4l2.rst 
b/Documentation/media/uapi/v4l/hist-v4l2.rst
index b18fb7e6c39a..d86d6343a20a 100644
--- a/Documentation/media/uapi/v4l/hist-v4l2.rst
+++ b/Documentation/media/uapi/v4l/hist-v4l2.rst
@@ -30,14 +30,14 @@ aliases ``O_NONCAP`` and ``O_NOIO`` were defined. 
Applications can set
 this flag if they intend to access controls only, as opposed to capture
 applications which need exclusive access. The ``VIDEO_STD_XXX``
 identifiers are now ordinals instead of flags, and the
-:c:func:`video_std_construct()` helper function takes id and
+``video_std_construct()`` helper function takes id and
 transmission arguments.
 
 1998-09-28: Revamped video standard. Made video controls individually
 enumerable.
 
 1998-10-02: The ``id`` field was removed from struct
-struct :c:type:`video_standard` and the color subcarrier fields were
+struct ``video_standard`` and the color subcarrier fields were
 renamed. The :ref:`VIDIOC_QUERYSTD` ioctl was
 renamed to :ref:`VIDIOC_ENUMSTD`,
 :ref:`VIDIOC_G_INPUT ` to
@@ -254,7 +254,7 @@ multiple tuners into account.)
 2000-09-18: ``V4L2_BUF_TYPE_VBI`` was added. This may *break
 compatibility* as the :ref:`VIDIOC_G_FMT ` and
 :ref:`VIDIOC_S_FMT ` ioctls may fail now if the struct
-struct :c:type:`v4l2_fmt` ``type`` field does not contain
+struct ``v4l2_fmt`` ``type`` field does not contain
 ``V4L2_BUF_TYPE_VBI``. In the documentation of the struct
 :c:type:`v4l2_vbi_format` ``offset`` field the
 ambiguous phrase "rising edge" was changed to "leading edge".
@@ -415,7 +415,7 @@ This unnamed version was finally merged into Linux 2.5.46.
 originally needed to distguish between variations of standards, were
 removed.
 
-Struct struct :c:type:`v4l2_enumstd` ceased to be.
+Struct ``v4l2_enumstd`` ceased to be.
 :ref:`VIDIOC_ENUMSTD` now takes a pointer to a
 struct :c:type:`v4l2_standard` directly. The
 information which standards are supported by a particular video
@@ -671,11 +671,11 @@ This unnamed version was finally merged into Linux 2.5.46.
 distinguish between field and frame (interlaced) overlay.
 
 17. The digital zoom interface, including struct
-struct :c:type:`v4l2_zoomcap`, struct
-struct :c:type:`v4l2_zoom`, ``V4L2_ZOOM_NONCAP`` and
+struct ``v4l2_zoomcap``, struct
+struct ``v4l2_zoom``, ``V4L2_ZOOM_NONCAP`` and
 ``V4L2_ZOOM_WHILESTREAMING`` was replaced by a new cropping and
 scaling interface. The previously unused struct
-struct :c:type:`v4l2_cropcap` and :c:type:`struct v4l2_crop`
+struct :c:type:`v4l2_cropcap` and struct :c:type:`v4l2_crop`
 where redefined for this purpose. See :ref:`crop` for details.
 
 18. In struct :c:type:`v4l2_vbi_format` the
@@ -694,7 +694,7 @@ This unnamed version was finally merged into Linux 2.5.46.
 Similar changes were made to struct
 :c:type:`v4l2_outputparm`.
 
-20. The struct :c:type:`v4l2_performance` and
+20. The struct ``v4l2_performance`` and
 ``VIDIOC_G_PERF`` ioctl were dropped. Except when using the
 :ref:`read/write I/O method `, which is limited anyway, this
 information is already available to applications.
@@ -882,7 +882,7 @@ V4L2 in Linux 2.6.15
 3. The ``VIDIOC_G_COMP`` and ``VIDIOC_S_COMP`` ioctl were renamed to
``VIDIOC_G_MPEGCOMP`` and ``VIDIOC_S_MPEGCOMP`` respectively. Their
argument was replaced by a struct
-   struct :c:type:`v4l2_mpeg_compression` pointer. (The
+   ``v4l2_mpeg_compression`` pointer. (The
``VIDIOC_G_MPEGCOMP`` and ``VIDIOC_S_MPEGCOMP`` ioctls where removed
in Linux 2.6.25.)
 
@@ -982,7 +982,7 @@ V4L2 in Linux 2.6.18
flag to skip unsupported controls with
:ref:`VIDIOC_QUERYCTRL`, new control types
``V4L2_CTRL_TYPE_INTEGER64`` and ``V4L2_CTRL_TYPE_CTRL_CLASS``
-   (:ref:`v4l2-ctrl-type`), and new control flags
+   (:c:type:`v4l2_ctrl_type`), and new control flags
``V4L2_CTRL_FLAG_READ_ONLY``, ``V4L2_CTRL_FLAG_UPDATE``,
``V4L2_CTRL_FLAG_INACTIVE`` and ``V4L2_CTRL_FLAG_SLIDER``
(:ref:`control-flags`). See :ref:`extended-controls` for details.
@@ -1127,8 +1127,8 @@ V4L2 in Linux 2.6.29
 1. The ``VIDIOC_G_CHIP_IDENT`` ioctl was renamed to
``VIDIOC_G_CHIP_IDENT_OLD`` and ``VIDIOC_DBG_G_CHIP_IDENT`` was
introduced in its place. The old struct
-   struct :c:type:`v4l2_chip_ident` was renamed to
-   struct :c:type:`v4l2_chip_ident_old`.
+   struct ``v4l2_chip_ident`` was renamed to
+   struct ``v4l2_chip_ident_old``.
 
 2. The pixel formats ``V4L2_PIX_FMT_VYUY``, ``V4L2_PIX_FMT_NV16`` and
``V4L2_PIX_FMT_NV61`` were added.
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.

[PATCH 10/47] [media] demux.h: fix a documentation warning

2016-09-08 Thread Mauro Carvalho Chehab
The kernel-doc parser didn't handle well the private:
tag. Rewrite it.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-core/demux.h | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-core/demux.h b/drivers/media/dvb-core/demux.h
index 0d9c53518be2..aeda2b64931c 100644
--- a/drivers/media/dvb-core/demux.h
+++ b/drivers/media/dvb-core/demux.h
@@ -582,10 +582,12 @@ struct dmx_demux {
 
int (*get_pes_pids)(struct dmx_demux *demux, u16 *pids);
 
+   /* private: */
+
/*
-* private: Only used at av7110, to read some data from firmware.
-*  As this was never documented, we have no clue about what's
-*  there, and its usage on other drivers aren't encouraged.
+* Only used at av7110, to read some data from firmware.
+* As this was never documented, we have no clue about what's
+* there, and its usage on other drivers aren't encouraged.
 */
int (*get_stc)(struct dmx_demux *demux, unsigned int num,
   u64 *stc, unsigned int *base);
-- 
2.7.4


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


[PATCH 17/47] [media] v4l2-ctrls.h: fix doc reference for prepare_ext_ctrls()

2016-09-08 Thread Mauro Carvalho Chehab
The prepare_ext_ctrls() function is actually internal to the
v4l2-ctrls.c implementation, so it doesn't have a declaration
for the kAPI header to reference it.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-ctrls.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index a63f37044f1c..ff2847705dac 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -239,7 +239,7 @@ struct v4l2_ctrl {
  * @next:  Single-link list node for the hash.
  * @ctrl:  The actual control information.
  * @helper:Pointer to helper struct. Used internally in
- * prepare_ext_ctrls().
+ * ``prepare_ext_ctrls`` function at ``v4l2-ctrl.c``.
  *
  * Each control handler has a list of these refs. The list_head is used to
  * keep a sorted-by-control-ID list of all controls, while the next pointer
-- 
2.7.4


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


[PATCH 46/47] [media] docs-rst: fix two wrong :name: tags

2016-09-08 Thread Mauro Carvalho Chehab
There's a typo there, causing 4 warnings:

  Documentation/media/uapi/rc/lirc-read.rst:26: WARNING: c:type reference 
target not found: name
  Documentation/media/uapi/rc/lirc-read.rst:26: WARNING: c:type reference 
target not found: lirc
  Documentation/media/uapi/v4l/func-poll.rst:25: WARNING: c:type reference 
target not found: name
  Documentation/media/uapi/v4l/func-poll.rst:25: WARNING: c:type reference 
target not found: v4l2

 Fix them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/rc/lirc-read.rst  | 2 +-
 Documentation/media/uapi/v4l/func-poll.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/media/uapi/rc/lirc-read.rst 
b/Documentation/media/uapi/rc/lirc-read.rst
index 62bd3d8c9c67..4c678f60e872 100644
--- a/Documentation/media/uapi/rc/lirc-read.rst
+++ b/Documentation/media/uapi/rc/lirc-read.rst
@@ -21,7 +21,7 @@ Synopsis
 
 
 .. c:function:: ssize_t read( int fd, void *buf, size_t count )
-:name lirc-read
+:name: lirc-read
 
 
 Arguments
diff --git a/Documentation/media/uapi/v4l/func-poll.rst 
b/Documentation/media/uapi/v4l/func-poll.rst
index 186cd61b6cd1..d0432dc09b05 100644
--- a/Documentation/media/uapi/v4l/func-poll.rst
+++ b/Documentation/media/uapi/v4l/func-poll.rst
@@ -21,7 +21,7 @@ Synopsis
 
 
 .. c:function:: int poll( struct pollfd *ufds, unsigned int nfds, int timeout )
-name: v4l2-poll
+:name: v4l2-poll
 
 Arguments
 =
-- 
2.7.4


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


[PATCH 26/47] [media] v4l2-subdev.h: fix a doc nitpick warning

2016-09-08 Thread Mauro Carvalho Chehab
One markup tag is wrong here.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-subdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 6e1d044e3ee8..2c1e328ccb1d 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -226,7 +226,7 @@ struct v4l2_subdev_core_ops {
  *
  * @g_tuner: callback for %VIDIOC_G_TUNER ioctl handler code.
  *
- * @s_tuner: callback for %VIDIOC_S_TUNER ioctl handler code. &vt->type must be
+ * @s_tuner: callback for %VIDIOC_S_TUNER ioctl handler code. @vt->type must be
  *  filled in. Normally done by video_ioctl2 or the
  *  bridge driver.
  *
-- 
2.7.4


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


[PATCH 31/47] [media] ca-get-slot-info.rst: document struct ca_slot_info

2016-09-08 Thread Mauro Carvalho Chehab
Add documentation for struct ca_slot_info and for the two
sets of define used by it, according with what's there at the
ca.h header.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/ca-get-slot-info.rst | 84 ++-
 1 file changed, 83 insertions(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/dvb/ca-get-slot-info.rst 
b/Documentation/media/uapi/dvb/ca-get-slot-info.rst
index fcecd80e30d4..4398aeb83eb7 100644
--- a/Documentation/media/uapi/dvb/ca-get-slot-info.rst
+++ b/Documentation/media/uapi/dvb/ca-get-slot-info.rst
@@ -26,7 +26,89 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() `.
 
 ``info``
-  Undocumented.
+  Pointer to struct c:type:`ca_slot_info`.
+
+.. _ca_slot_info_type:
+
+.. flat-table:: ca_slot_info types
+:header-rows:  1
+:stub-columns: 0
+
+-
+  - type
+  - name
+  - description
+-
+   - CA_CI
+   - 1
+   - CI high level interface
+
+-
+   - CA_CI_LINK
+   - 2
+   - CI link layer level interface
+
+-
+   - CA_CI_PHYS
+   - 4
+   - CI physical layer level interface
+
+-
+   - CA_DESCR
+   - 8
+   - built-in descrambler
+
+-
+   - CA_SC
+   - 128
+   - simple smart card interface
+
+.. _ca_slot_info_flag:
+
+.. flat-table:: ca_slot_info flags
+:header-rows:  1
+:stub-columns: 0
+
+-
+  - type
+  - name
+  - description
+
+-
+   - CA_CI_MODULE_PRESENT
+   - 1
+   - module (or card) inserted
+
+-
+   - CA_CI_MODULE_READY
+   - 2
+   -
+
+.. c:type:: ca_slot_info
+
+.. flat-table:: struct ca_slot_info
+:header-rows:  1
+:stub-columns: 0
+
+-
+  - type
+  - name
+  - description
+
+-
+   - int
+   - num
+   - slot number
+
+-
+   - int
+   - type
+   - CA interface this slot supports, as defined at 
:ref:`ca_slot_info_type`.
+
+-
+   - unsigned int
+   - flags
+   - flags as defined at :ref:`ca_slot_info_flag`.
 
 
 Description
-- 
2.7.4


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


[PATCH 33/47] [media] docs-rst: fix the remaining broken links for DVB CA API

2016-09-08 Thread Mauro Carvalho Chehab
Several links are broken, as they were using the typedef
name, instead of using the corresponding structs. Fix them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/ca-get-cap.rst| 4 ++--
 Documentation/media/uapi/dvb/ca-get-descr-info.rst | 2 +-
 Documentation/media/uapi/dvb/ca-get-msg.rst| 2 +-
 Documentation/media/uapi/dvb/ca-get-slot-info.rst  | 2 +-
 Documentation/media/uapi/dvb/ca-send-msg.rst   | 4 ++--
 Documentation/media/uapi/dvb/ca-set-descr.rst  | 6 +++---
 Documentation/media/uapi/dvb/ca-set-pid.rst| 2 +-
 7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/Documentation/media/uapi/dvb/ca-get-cap.rst 
b/Documentation/media/uapi/dvb/ca-get-cap.rst
index 77c57ac59535..fbf7e359cb8a 100644
--- a/Documentation/media/uapi/dvb/ca-get-cap.rst
+++ b/Documentation/media/uapi/dvb/ca-get-cap.rst
@@ -15,7 +15,7 @@ CA_GET_CAP
 Synopsis
 
 
-.. c:function:: int ioctl(fd, CA_GET_CAP, ca_caps_t *caps)
+.. c:function:: int ioctl(fd, CA_GET_CAP, struct ca_caps *caps)
 :name: CA_GET_CAP
 
 
@@ -26,7 +26,7 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() 
`.
 
 ``caps``
-  struct :c:type:`ca_caps` pointer
+  Pointer to struct :c:type:`ca_caps`.
 
 .. c:type:: struct ca_caps
 
diff --git a/Documentation/media/uapi/dvb/ca-get-descr-info.rst 
b/Documentation/media/uapi/dvb/ca-get-descr-info.rst
index b4a31940cec0..7bf327a3d0e3 100644
--- a/Documentation/media/uapi/dvb/ca-get-descr-info.rst
+++ b/Documentation/media/uapi/dvb/ca-get-descr-info.rst
@@ -15,7 +15,7 @@ CA_GET_DESCR_INFO
 Synopsis
 
 
-.. c:function:: int  ioctl(fd, CA_GET_DESCR_INFO, ca_descr_info_t *desc)
+.. c:function:: int  ioctl(fd, CA_GET_DESCR_INFO, struct ca_descr_info *desc)
 :name: CA_GET_DESCR_INFO
 
 Arguments
diff --git a/Documentation/media/uapi/dvb/ca-get-msg.rst 
b/Documentation/media/uapi/dvb/ca-get-msg.rst
index 03b2a602f02a..121588da3ef1 100644
--- a/Documentation/media/uapi/dvb/ca-get-msg.rst
+++ b/Documentation/media/uapi/dvb/ca-get-msg.rst
@@ -15,7 +15,7 @@ CA_GET_MSG
 Synopsis
 
 
-.. c:function:: int ioctl(fd, CA_GET_MSG, ca_msg_t *msg)
+.. c:function:: int ioctl(fd, CA_GET_MSG, struct ca_msg *msg)
 :name: CA_GET_MSG
 
 
diff --git a/Documentation/media/uapi/dvb/ca-get-slot-info.rst 
b/Documentation/media/uapi/dvb/ca-get-slot-info.rst
index 4398aeb83eb7..54e5dc78a2dc 100644
--- a/Documentation/media/uapi/dvb/ca-get-slot-info.rst
+++ b/Documentation/media/uapi/dvb/ca-get-slot-info.rst
@@ -15,7 +15,7 @@ CA_GET_SLOT_INFO
 Synopsis
 
 
-.. c:function:: int ioctl(fd, CA_GET_SLOT_INFO, ca_slot_info_t *info)
+.. c:function:: int ioctl(fd, CA_GET_SLOT_INFO, struct ca_slot_info *info)
 :name: CA_GET_SLOT_INFO
 
 
diff --git a/Documentation/media/uapi/dvb/ca-send-msg.rst 
b/Documentation/media/uapi/dvb/ca-send-msg.rst
index 0c42b10cf4f4..532ef5f9d6ac 100644
--- a/Documentation/media/uapi/dvb/ca-send-msg.rst
+++ b/Documentation/media/uapi/dvb/ca-send-msg.rst
@@ -15,7 +15,7 @@ CA_SEND_MSG
 Synopsis
 
 
-.. c:function:: int ioctl(fd, CA_SEND_MSG, ca_msg_t *msg)
+.. c:function:: int ioctl(fd, CA_SEND_MSG, struct ca_msg *msg)
 :name: CA_SEND_MSG
 
 
@@ -26,7 +26,7 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() `.
 
 ``msg``
-  Undocumented.
+  Pointer to struct :c:type:`ca_msg`.
 
 
 Description
diff --git a/Documentation/media/uapi/dvb/ca-set-descr.rst 
b/Documentation/media/uapi/dvb/ca-set-descr.rst
index 63dcc2b751ef..70f7b3cf12ad 100644
--- a/Documentation/media/uapi/dvb/ca-set-descr.rst
+++ b/Documentation/media/uapi/dvb/ca-set-descr.rst
@@ -15,8 +15,8 @@ CA_SET_DESCR
 Synopsis
 
 
-.. c:function:: int ioctl(fd, CA_SET_DESCR, ca_descr_t *desc)
-:name:
+.. c:function:: int ioctl(fd, CA_SET_DESCR, struct ca_descr *desc)
+:name: CA_SET_DESCR
 
 
 Arguments
@@ -26,7 +26,7 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() `.
 
 ``msg``
-  Undocumented.
+  Pointer to struct :c:type:`ca_descr`.
 
 
 Description
diff --git a/Documentation/media/uapi/dvb/ca-set-pid.rst 
b/Documentation/media/uapi/dvb/ca-set-pid.rst
index 06bdaf4afada..891c1c72ef24 100644
--- a/Documentation/media/uapi/dvb/ca-set-pid.rst
+++ b/Documentation/media/uapi/dvb/ca-set-pid.rst
@@ -15,7 +15,7 @@ CA_SET_PID
 Synopsis
 
 
-.. c:function:: int ioctl(fd, CA_SET_PID, ca_pid_t *pid)
+.. c:function:: int ioctl(fd, CA_SET_PID, struct ca_pid *pid)
 :name: CA_SET_PID
 
 
-- 
2.7.4


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


[PATCH 34/47] [media] fix broken references on dvb/video*rst

2016-09-08 Thread Mauro Carvalho Chehab
Trivially fix those broken references, by copying the structs
fron the header, just like other API documentation at the
DVB side.

This doesn't have the level of quality used at the V4L2 side
of the API, but, as this documents a deprecated API, used
only by av7110 driver, it doesn't make much sense to invest
time making it better.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/video-command.rst | 30 ++
 Documentation/media/uapi/dvb/video-get-event.rst   | 17 
 Documentation/media/uapi/dvb/video-get-navi.rst| 10 +++-
 Documentation/media/uapi/dvb/video-get-size.rst| 10 
 Documentation/media/uapi/dvb/video-get-status.rst  | 11 
 .../media/uapi/dvb/video-select-source.rst | 10 
 .../media/uapi/dvb/video-set-attributes.rst| 16 
 .../media/uapi/dvb/video-set-display-format.rst|  2 +-
 Documentation/media/uapi/dvb/video-set-format.rst  |  9 +++
 .../media/uapi/dvb/video-set-highlight.rst | 26 ++-
 .../media/uapi/dvb/video-set-spu-palette.rst   | 10 +++-
 Documentation/media/uapi/dvb/video-set-spu.rst | 11 +++-
 include/uapi/linux/dvb/video.h |  3 ++-
 13 files changed, 159 insertions(+), 6 deletions(-)

diff --git a/Documentation/media/uapi/dvb/video-command.rst 
b/Documentation/media/uapi/dvb/video-command.rst
index 4772562036f1..536d0fdd8399 100644
--- a/Documentation/media/uapi/dvb/video-command.rst
+++ b/Documentation/media/uapi/dvb/video-command.rst
@@ -59,6 +59,36 @@ subset of the ``v4l2_decoder_cmd`` struct, so refer to the
 :ref:`VIDIOC_DECODER_CMD` documentation for
 more information.
 
+.. c:type:: struct video_command
+
+.. code-block:: c
+
+   /* The structure must be zeroed before use by the application
+   This ensures it can be extended safely in the future. */
+   struct video_command {
+   __u32 cmd;
+   __u32 flags;
+   union {
+   struct {
+   __u64 pts;
+   } stop;
+
+   struct {
+   /* 0 or 1000 specifies normal speed,
+   1 specifies forward single stepping,
+   -1 specifies backward single stepping,
+   >1: playback at speed/1000 of the normal speed,
+   <-1: reverse playback at (-speed/1000) of the 
normal speed. */
+   __s32 speed;
+   __u32 format;
+   } play;
+
+   struct {
+   __u32 data[16];
+   } raw;
+   };
+   };
+
 
 Return Value
 
diff --git a/Documentation/media/uapi/dvb/video-get-event.rst 
b/Documentation/media/uapi/dvb/video-get-event.rst
index 8c0c622c380b..6ad14cdb894a 100644
--- a/Documentation/media/uapi/dvb/video-get-event.rst
+++ b/Documentation/media/uapi/dvb/video-get-event.rst
@@ -64,6 +64,23 @@ included in the exceptfds argument, and for poll(), POLLPRI 
should be
 specified as the wake-up condition. Read-only permissions are sufficient
 for this ioctl call.
 
+.. c:type:: video_event
+
+.. code-block:: c
+
+   struct video_event {
+   __s32 type;
+   #define VIDEO_EVENT_SIZE_CHANGED1
+   #define VIDEO_EVENT_FRAME_RATE_CHANGED  2
+   #define VIDEO_EVENT_DECODER_STOPPED 3
+   #define VIDEO_EVENT_VSYNC   4
+   __kernel_time_t timestamp;
+   union {
+   video_size_t size;
+   unsigned int frame_rate;/* in frames per 
1000sec */
+   unsigned char vsync_field;  /* 
unknown/odd/even/progressive */
+   } u;
+   };
 
 Return Value
 
diff --git a/Documentation/media/uapi/dvb/video-get-navi.rst 
b/Documentation/media/uapi/dvb/video-get-navi.rst
index b8de9ccf38c2..114a9ac48b9e 100644
--- a/Documentation/media/uapi/dvb/video-get-navi.rst
+++ b/Documentation/media/uapi/dvb/video-get-navi.rst
@@ -16,7 +16,7 @@ VIDEO_GET_NAVI
 Synopsis
 
 
-.. c:function:: int ioctl(fd, VIDEO_GET_NAVI , video_navi_pack_t *navipack)
+.. c:function:: int ioctl(fd, VIDEO_GET_NAVI , struct video_navi_pack 
*navipack)
 :name: VIDEO_GET_NAVI
 
 
@@ -54,6 +54,14 @@ This ioctl returns navigational information from the DVD 
stream. This is
 especially needed if an encoded stream has to be decoded by the
 hardware.
 
+.. c:type:: video_navi_pack
+
+.. code-block::c
+
+   typedef struct video_navi_pack {
+   int length;  /* 0 ... 1024 */
+   __u8 data[1024];
+   } video_navi_pack_t;
 
 Return Value
 
diff --git a/Documentation/media/uapi/dvb/video-get-size.rst 
b/Documentation/media/uapi/dvb/video-get-size.rst
index ce8b4c6b41a5..d077fe2

[PATCH 08/47] [media] demux.h: Fix a few documentation issues

2016-09-08 Thread Mauro Carvalho Chehab
demux.h was lacking documentation for the DMX_FE_ENTRY macro:
./drivers/media/dvb-core/demux.h:511: WARNING: c:func reference target 
not found: DMX_FE_ENTRY

While here, get rid of unused parameters and fix a few minor issues
at the header file.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-core/demux.h | 36 
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/drivers/media/dvb-core/demux.h b/drivers/media/dvb-core/demux.h
index 4b4c1da20f4b..0d9c53518be2 100644
--- a/drivers/media/dvb-core/demux.h
+++ b/drivers/media/dvb-core/demux.h
@@ -202,7 +202,7 @@ struct dmx_section_feed {
  *
  * This function callback prototype, provided by the client of the demux API,
  * is called from the demux code. The function is only called when filtering
- * on ae TS feed has been enabled using the start_filtering() function at
+ * on a TS feed has been enabled using the start_filtering\(\) function at
  * the &dmx_demux.
  * Any TS packets that match the filter settings are copied to a circular
  * buffer. The filtered TS packets are delivered to the client using this
@@ -243,8 +243,10 @@ struct dmx_section_feed {
  * will also be sent to the hardware MPEG decoder.
  *
  * Return:
- * 0, on success;
- * -EOVERFLOW, on buffer overflow.
+ *
+ * - 0, on success;
+ *
+ * - -EOVERFLOW, on buffer overflow.
  */
 typedef int (*dmx_ts_cb)(const u8 *buffer1,
 size_t buffer1_length,
@@ -293,9 +295,9 @@ typedef int (*dmx_section_cb)(const u8 *buffer1,
  size_t buffer2_len,
  struct dmx_section_filter *source);
 
-/*--*/
-/* DVB Front-End */
-/*--*/
+/*
+ * DVB Front-End
+ */
 
 /**
  * enum dmx_frontend_source - Used to identify the type of frontend
@@ -349,15 +351,15 @@ enum dmx_demux_caps {
 
 /*
  * Demux resource type identifier.
-*/
-
-/*
- * DMX_FE_ENTRY(): Casts elements in the list of registered
- * front-ends from the generic type struct list_head
- * to the type * struct dmx_frontend
- *.
-*/
+ */
 
+/**
+ * DMX_FE_ENTRY - Casts elements in the list of registered
+ *   front-ends from the generic type struct list_head
+ *   to the type * struct dmx_frontend
+ *
+ * @list: list of struct dmx_frontend
+ */
 #define DMX_FE_ENTRY(list) \
list_entry(list, struct dmx_frontend, connectivity_list)
 
@@ -551,7 +553,6 @@ enum dmx_demux_caps {
  * 0 on success;
  * -EINVAL on bad parameter.
  */
-
 struct dmx_demux {
enum dmx_demux_caps capabilities;
struct dmx_frontend *frontend;
@@ -581,11 +582,6 @@ struct dmx_demux {
 
int (*get_pes_pids)(struct dmx_demux *demux, u16 *pids);
 
-   /* private: Not used upstream and never documented */
-#if 0
-   int (*get_caps)(struct dmx_demux *demux, struct dmx_caps *caps);
-   int (*set_source)(struct dmx_demux *demux, const dmx_source_t *src);
-#endif
/*
 * private: Only used at av7110, to read some data from firmware.
 *  As this was never documented, we have no clue about what's
-- 
2.7.4


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


[PATCH 09/47] [media] mc-core.rst: Fix cross-references to the source

2016-09-08 Thread Mauro Carvalho Chehab
The cross-reference to "struct media_pad" was pointing to
a place that doesn't exist. Fix it, and adjust the second
reference on the same paragraph to use the same text.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/kapi/mc-core.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/media/kapi/mc-core.rst 
b/Documentation/media/kapi/mc-core.rst
index 569cfc4f01cd..fb839a6c1f46 100644
--- a/Documentation/media/kapi/mc-core.rst
+++ b/Documentation/media/kapi/mc-core.rst
@@ -85,8 +85,9 @@ a driver-specific structure.
 Pads are identified by their entity and their 0-based index in the pads
 array.
 
-Both information are stored in the :c:type:`struct media_pad`, making the
-:c:type:`media_pad` pointer the canonical way to store and pass link 
references.
+Both information are stored in the :c:type:`struct media_pad `,
+making the :c:type:`struct media_pad ` pointer the canonical way
+to store and pass link references.
 
 Pads have flags that describe the pad capabilities and state.
 
-- 
2.7.4


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


[PATCH 19/47] [media] v4l2-ctrls.h: Fix some c:type references

2016-09-08 Thread Mauro Carvalho Chehab
Now that the uAPI is using c:type, let's use it here too.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-ctrls.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index ff2847705dac..86702037cf5d 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -973,9 +973,9 @@ extern const struct v4l2_subscribed_event_ops 
v4l2_ctrl_sub_ev_ops;
  * v4l2_ctrl_replace - Function to be used as a callback to
  * &struct v4l2_subscribed_event_ops replace\(\)
  *
- * @old: pointer to :ref:`struct v4l2_event ` with the reported
+ * @old: pointer to struct &v4l2_event with the reported
  *  event;
- * @new: pointer to :ref:`struct v4l2_event ` with the modified
+ * @new: pointer to struct &v4l2_event with the modified
  *  event;
  */
 void v4l2_ctrl_replace(struct v4l2_event *old, const struct v4l2_event *new);
@@ -984,9 +984,9 @@ void v4l2_ctrl_replace(struct v4l2_event *old, const struct 
v4l2_event *new);
  * v4l2_ctrl_merge - Function to be used as a callback to
  * &struct v4l2_subscribed_event_ops merge(\)
  *
- * @old: pointer to :ref:`struct v4l2_event ` with the reported
+ * @old: pointer to struct &v4l2_event with the reported
  *  event;
- * @new: pointer to :ref:`struct v4l2_event ` with the merged
+ * @new: pointer to struct &v4l2_event with the merged
  *  event;
  */
 void v4l2_ctrl_merge(const struct v4l2_event *old, struct v4l2_event *new);
-- 
2.7.4


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


[PATCH 11/47] [media] docs-rst: improve the kAPI documentation for the mediactl

2016-09-08 Thread Mauro Carvalho Chehab
There are several issues on the documentation:
  - the media.h header were not properly referenced;
  - verbatim expressions were not properly marked as such;
  - struct member references were wrong;
  - some notes were not using the right markup;
  - a comment that were moved to the kernel-doc markup were
duplicated as a comment inside the struct media_entity;
  - some args were not pointing to the struct they're using;
  - macros weren't documented.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/media-device.h  | 115 
 include/media/media-devnode.h |   2 +-
 include/media/media-entity.h  | 237 --
 3 files changed, 231 insertions(+), 123 deletions(-)

diff --git a/include/media/media-device.h b/include/media/media-device.h
index 28195242386c..481dd6c672cb 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -53,7 +53,7 @@ struct media_entity_notify {
  * @dev:   Parent device
  * @devnode:   Media device node
  * @driver_name: Optional device driver name. If not set, calls to
- * %MEDIA_IOC_DEVICE_INFO will return dev->driver->name.
+ * %MEDIA_IOC_DEVICE_INFO will return ``dev->driver->name``.
  * This is needed for USB drivers for example, as otherwise
  * they'll all appear as if the driver name was "usb".
  * @model: Device model name
@@ -102,16 +102,18 @@ struct media_entity_notify {
  * sink entity  and deactivate the link between them. Drivers
  * should call this handler to release the source.
  *
- * Note: Bridge driver is expected to implement and set the
- * handler when media_device is registered or when
- * bridge driver finds the media_device during probe.
- * Bridge driver sets source_priv with information
- * necessary to run enable/disable source handlers.
- *
  * Use-case: find tuner entity connected to the decoder
  * entity and check if it is available, and activate the
- * the link between them from enable_source and deactivate
- * from disable_source.
+ * the link between them from @enable_source and deactivate
+ * from @disable_source.
+ *
+ * .. note::
+ *
+ *Bridge driver is expected to implement and set the
+ *handler when &media_device is registered or when
+ *bridge driver finds the media_device during probe.
+ *Bridge driver sets source_priv with information
+ *necessary to run @enable_source and @disable_source handlers.
  */
 struct media_device {
/* dev->driver_data points to this struct. */
@@ -168,7 +170,7 @@ struct usb_device;
  * @ent_enum: Entity enumeration to be initialised
  * @mdev: The related media device
  *
- * Returns zero on success or a negative error code.
+ * Return: zero on success or a negative error code.
  */
 static inline __must_check int media_entity_enum_init(
struct media_entity_enum *ent_enum, struct media_device *mdev)
@@ -211,36 +213,38 @@ void media_device_cleanup(struct media_device *mdev);
  *
  * Users, should, instead, call the media_device_register() macro.
  *
- * The caller is responsible for initializing the media_device structure before
- * registration. The following fields must be set:
+ * The caller is responsible for initializing the &media_device structure
+ * before registration. The following fields of &media_device must be set:
  *
- *  - dev must point to the parent device (usually a &pci_dev, &usb_interface 
or
- *&platform_device instance).
+ *  - &media_entity.dev must point to the parent device (usually a &pci_dev,
+ *&usb_interface or &platform_device instance).
  *
- *  - model must be filled with the device model name as a NUL-terminated UTF-8
- *string. The device/model revision must not be stored in this field.
+ *  - &media_entity.model must be filled with the device model name as a
+ *NUL-terminated UTF-8 string. The device/model revision must not be
+ *stored in this field.
  *
  * The following fields are optional:
  *
- *  - serial is a unique serial number stored as a NUL-terminated ASCII string.
- *The field is big enough to store a GUID in text form. If the hardware
- *doesn't provide a unique serial number this field must be left empty.
+ *  - &media_entity.serial is a unique serial number stored as a
+ *NUL-terminated ASCII string. The field is big enough to store a GUID
+ *in text form. If the hardware doesn't provide a unique serial number
+ *this field must be left empty.
  *
- *  - bus_info represents the location of the device in the system as a
- *NUL-terminated ASCII string. For PCI/PCIe devices bus_info must be set to
- *"PCI:" (or "PCIe:") followed by the value of pci_name(). For USB devices,
- *the usb_make_path() function must be used. This field is used by
- *applications to distinguish between otherwise identical devices that 
don't
- *provide a serial number.
+ *  - &media_entity.bus_info represents the location of the device in the
+ *syste

[PATCH 12/47] [media] conf_nitpick.py: ignore external functions used on mediactl

2016-09-08 Thread Mauro Carvalho Chehab
There are some functions/macros used by the mediactl documentation
that are alien to the media subsystem. Ignore them.

After this patch, the media core will only complain about this
static function:
Documentation/media/kapi/mc-core.rst:97: WARNING: c:func reference 
target not found: media_devnode_release

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/conf_nitpick.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/media/conf_nitpick.py 
b/Documentation/media/conf_nitpick.py
index 4de9533ce361..1c7928abace5 100644
--- a/Documentation/media/conf_nitpick.py
+++ b/Documentation/media/conf_nitpick.py
@@ -28,6 +28,7 @@ nitpick_ignore = [
 ("c:func", "i2c_new_device"),
 ("c:func", "ioctl"),
 ("c:func", "IS_ERR"),
+("c:func", "KERNEL_VERSION"),
 ("c:func", "mmap"),
 ("c:func", "open"),
 ("c:func", "pci_name"),
@@ -66,6 +67,7 @@ nitpick_ignore = [
 ("c:type", "off_t"),
 ("c:type", "pci_dev"),
 ("c:type", "pdvbdev"),
+("c:type", "platform_device"),
 ("c:type", "pollfd"),
 ("c:type", "poll_table_struct"),
 ("c:type", "s32"),
@@ -93,5 +95,6 @@ nitpick_ignore = [
 ("c:type", "union"),
 ("c:type", "__user"),
 ("c:type", "usb_device"),
+("c:type", "usb_interface"),
 ("c:type", "video_system_t"),
 ]
-- 
2.7.4


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


[PATCH 05/47] [media] dvb_ringbuffer.h: Document all functions

2016-09-08 Thread Mauro Carvalho Chehab
There are several functions there there weren't properly
documented. Add documentation for them.

While here, make checkpatch.pl happier.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-core/dvb_ringbuffer.h | 179 
 1 file changed, 134 insertions(+), 45 deletions(-)

diff --git a/drivers/media/dvb-core/dvb_ringbuffer.h 
b/drivers/media/dvb-core/dvb_ringbuffer.h
index 8af642399f1e..8209eb4db2aa 100644
--- a/drivers/media/dvb-core/dvb_ringbuffer.h
+++ b/drivers/media/dvb-core/dvb_ringbuffer.h
@@ -18,10 +18,6 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
 #ifndef _DVB_RINGBUFFER_H_
@@ -30,6 +26,18 @@
 #include 
 #include 
 
+/**
+ * struct dvb_ringbuffer - Describes a ring buffer used at DVB framework
+ *
+ * @data: Area were the ringbuffer data is written
+ * @size: size of the ringbuffer
+ * @pread: next position to read
+ * @pwrite: next position to write
+ * @error: used by ringbuffer clients to indicate that an error happened.
+ * @queue: Wait queue used by ringbuffer clients to indicate when buffer
+ * was filled
+ * @lock: Spinlock used to protect the ringbuffer
+ */
 struct dvb_ringbuffer {
u8   *data;
ssize_t   size;
@@ -43,7 +51,21 @@ struct dvb_ringbuffer {
 
 #define DVB_RINGBUFFER_PKTHDRSIZE 3
 
+/**
+ * dvb_ringbuffer_init - initialize ring buffer, lock and queue
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @data: pointer to the buffer where the data will be stored
+ * @len: bytes from ring buffer into @buf
+ */
+extern void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data,
+   size_t len);
 
+/**
+ * dvb_ringbuffer_empty - test whether buffer is empty
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ */
 /*
  * Notes:
  * --
@@ -72,69 +94,133 @@ struct dvb_ringbuffer {
  * Resetting the buffer counts as a read and write operation.
  * Two or more writers must be locked against each other.
  */
-
-/* initialize ring buffer, lock and queue */
-extern void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, 
size_t len);
-
-/* test whether buffer is empty */
 extern int dvb_ringbuffer_empty(struct dvb_ringbuffer *rbuf);
 
-/* return the number of free bytes in the buffer */
+/**
+ * dvb_ringbuffer_free - returns the number of free bytes in the buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ *
+ * Return: number of free bytes in the buffer
+ */
 extern ssize_t dvb_ringbuffer_free(struct dvb_ringbuffer *rbuf);
 
-/* return the number of bytes waiting in the buffer */
+/**
+ * dvb_ringbuffer_avail - returns the number of bytes waiting in the buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ *
+ * Return: number of bytes waiting in the buffer
+ */
 extern ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf);
 
-
-/*
- * Reset the read and write pointers to zero and flush the buffer
+/**
+ * dvb_ringbuffer_reset - resets the ringbuffer to initial state
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ *
+ * Resets the read and write pointers to zero and flush the buffer.
+ *
  * This counts as a read and write operation
  */
 extern void dvb_ringbuffer_reset(struct dvb_ringbuffer *rbuf);
 
 
-/* read routines & macros */
-/* -- */
-/* flush buffer */
+/*
+ * read routines & macros
+ */
+
+/**
+ * dvb_ringbuffer_flush - flush buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ */
 extern void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf);
 
-/* flush buffer protected by spinlock and wake-up waiting task(s) */
+/**
+ * dvb_ringbuffer_flush_spinlock_wakeup- flush buffer protected by spinlock
+ *  and wake-up waiting task(s)
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ */
 extern void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf);
 
-/* peek at byte @offs: in the buffer */
-#define DVB_RINGBUFFER_PEEK(rbuf,offs) \
-   (rbuf)->data[((rbuf)->pread+(offs))%(rbuf)->size]
+/* DVB_RINGBUFFER_PEEK - peek at byte @offs: in the buffer */
+#define DVB_RINGBUFFER_PEEK(rbuf, offs)\
+   (rbuf)->data[((rbuf)->pread + (offs)) % (rbuf)->size]
 
 /* advance read ptr by @num: bytes */
-#define DVB_RINGBUFFER_SKIP(rbuf,num)  \
-   (rbuf)->pread=((rbuf)->pread+(num))%(rbuf)->size
+#define DVB_RINGBUFFER_SKIP(rbuf, num) {\
+   (rbuf)->pread = ((rbuf)->pread + (num)) % (rbuf)->size;\
+}
 
-/*
- * read @len: bytes from ring buffer into @buf:
- * @usermem: specifies whether @buf: resides in user space
- * returns number of bytes transferred o

[PATCH 36/47] [media] docs-rst: fix cec bad cross-references

2016-09-08 Thread Mauro Carvalho Chehab
Fix some CEC cross references that are broken.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/cec.h.rst.exceptions  |  6 --
 Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst | 10 +-
 Documentation/media/uapi/cec/cec-ioc-receive.rst  |  9 +
 3 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/Documentation/media/cec.h.rst.exceptions 
b/Documentation/media/cec.h.rst.exceptions
index b79339433718..b1687532742f 100644
--- a/Documentation/media/cec.h.rst.exceptions
+++ b/Documentation/media/cec.h.rst.exceptions
@@ -1,12 +1,6 @@
 # Ignore header name
 ignore define _CEC_UAPI_H
 
-# Rename some symbols, to avoid namespace conflicts
-replace struct cec_event_state_change cec-event-state-change_s
-replace struct cec_event_lost_msgs cec-event-lost-msgs_s
-replace enum cec_mode_initiator cec-mode-initiator_e
-replace enum cec_mode_follower cec-mode-follower_e
-
 # define macros to ignore
 
 ignore define CEC_MAX_MSG_SIZE
diff --git a/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst 
b/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
index bd0756ff022e..6c314c2db73e 100644
--- a/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst
@@ -30,7 +30,7 @@ Arguments
 File descriptor returned by :c:func:`open() `.
 
 ``argp``
-Pointer to struct cec_log_addrs
+Pointer to struct :c:type:`cec_log_addrs`.
 
 Description
 ===
@@ -42,10 +42,10 @@ Description
 
 To query the current CEC logical addresses, applications call
 :ref:`ioctl CEC_ADAP_G_LOG_ADDRS ` with a pointer to a
-:c:type:`struct cec_log_addrs` where the driver stores the logical addresses.
+struct :c:type:`cec_log_addrs` where the driver stores the logical addresses.
 
 To set new logical addresses, applications fill in
-:c:type:`struct cec_log_addrs` and call :ref:`ioctl CEC_ADAP_S_LOG_ADDRS 
`
+struct :c:type:`cec_log_addrs` and call :ref:`ioctl CEC_ADAP_S_LOG_ADDRS 
`
 with a pointer to this struct. The :ref:`ioctl CEC_ADAP_S_LOG_ADDRS 
`
 is only available if ``CEC_CAP_LOG_ADDRS`` is set (the ``ENOTTY`` error code is
 returned otherwise). The :ref:`ioctl CEC_ADAP_S_LOG_ADDRS 
`
@@ -66,10 +66,10 @@ logical addresses are claimed or cleared.
 Attempting to call :ref:`ioctl CEC_ADAP_S_LOG_ADDRS ` 
when
 logical address types are already defined will return with error ``EBUSY``.
 
-.. tabularcolumns:: |p{1.0cm}|p{7.5cm}|p{8.0cm}|
-
 .. c:type:: cec_log_addrs
 
+.. tabularcolumns:: |p{1.0cm}|p{7.5cm}|p{8.0cm}|
+
 .. cssclass:: longtable
 
 .. flat-table:: struct cec_log_addrs
diff --git a/Documentation/media/uapi/cec/cec-ioc-receive.rst 
b/Documentation/media/uapi/cec/cec-ioc-receive.rst
index f015f1259b27..18620f81b7d9 100644
--- a/Documentation/media/uapi/cec/cec-ioc-receive.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-receive.rst
@@ -40,7 +40,8 @@ Description
and is currently only available as a staging kernel module.
 
 To receive a CEC message the application has to fill in the
-``timeout`` field of :c:type:`struct cec_msg` and pass it to :ref:`ioctl 
CEC_RECEIVE `.
+``timeout`` field of struct :c:type:`cec_msg` and pass it to
+:ref:`ioctl CEC_RECEIVE `.
 If the file descriptor is in non-blocking mode and there are no received
 messages pending, then it will return -1 and set errno to the ``EAGAIN``
 error code. If the file descriptor is in blocking mode and ``timeout``
@@ -54,9 +55,9 @@ A received message can be:
 2. the result of an earlier non-blocking transmit (the ``sequence`` field will
be non-zero).
 
-To send a CEC message the application has to fill in the
-:c:type:`struct cec_msg` and pass it to
-:ref:`ioctl CEC_TRANSMIT `. The :ref:`ioctl CEC_TRANSMIT 
` is only available if
+To send a CEC message the application has to fill in the struct
+:c:type:` cec_msg` and pass it to :ref:`ioctl CEC_TRANSMIT `.
+The :ref:`ioctl CEC_TRANSMIT ` is only available if
 ``CEC_CAP_TRANSMIT`` is set. If there is no more room in the transmit
 queue, then it will return -1 and set errno to the ``EBUSY`` error code.
 The transmit queue has enough room for 18 messages (about 1 second worth
-- 
2.7.4


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


[PATCH 47/47] [media] rc-map.h: fix a Sphinx warning

2016-09-08 Thread Mauro Carvalho Chehab
./include/media/rc-map.h:121: WARNING: Inline emphasis start-string 
without end-string.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/rc-map.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 173ad58fb61b..3c8edb34f84a 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -117,7 +117,7 @@ struct rc_map_table {
  * @scan: pointer to struct &rc_map_table
  * @size: Max number of entries
  * @len: Number of entries that are in use
- * @alloc: size of *scan, in bytes
+ * @alloc: size of \*scan, in bytes
  * @rc_type: type of the remote controller protocol, as defined at
  *  enum &rc_type
  * @name: name of the key map table
-- 
2.7.4


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


[PATCH 22/47] [media] v4l2-dev.rst: fix a broken c domain reference

2016-09-08 Thread Mauro Carvalho Chehab
The "struct" were inside the reference, causing it to break.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/kapi/v4l2-dev.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/media/kapi/v4l2-dev.rst 
b/Documentation/media/kapi/v4l2-dev.rst
index 5782be725334..0a3b4503a89f 100644
--- a/Documentation/media/kapi/v4l2-dev.rst
+++ b/Documentation/media/kapi/v4l2-dev.rst
@@ -56,7 +56,7 @@ You should also set these fields of :c:type:`video_device`:
   :c:type:`video_device`->vfl_dir fields are used to disable ops that do not
   match the type/dir combination. E.g. VBI ops are disabled for non-VBI nodes,
   and output ops  are disabled for a capture device. This makes it possible to
-  provide just one :c:type:`v4l2_ioctl_ops struct` for both vbi and
+  provide just one :c:type:`v4l2_ioctl_ops` struct for both vbi and
   video nodes.
 
 - :c:type:`video_device`->lock: leave to ``NULL`` if you want to do all the
-- 
2.7.4


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


[PATCH 41/47] [media] libv4l-introduction.rst: improve crossr-references

2016-09-08 Thread Mauro Carvalho Chehab
Use C cross-references to mention the V4L2 API calls on all
places it occurs inside this file.

While here, also mark constants as such.

Signed-off-by: Mauro Carvalho Chehab 
---
 .../media/uapi/v4l/libv4l-introduction.rst | 33 +-
 1 file changed, 20 insertions(+), 13 deletions(-)

diff --git a/Documentation/media/uapi/v4l/libv4l-introduction.rst 
b/Documentation/media/uapi/v4l/libv4l-introduction.rst
index 1c1278d17fa7..ccc3c4d2fc0f 100644
--- a/Documentation/media/uapi/v4l/libv4l-introduction.rst
+++ b/Documentation/media/uapi/v4l/libv4l-introduction.rst
@@ -113,43 +113,47 @@ Libv4l device control functions
 
 The common file operation methods are provided by libv4l.
 
-Those functions operate just like glibc
-open/close/dup/ioctl/read/mmap/munmap:
+Those functions operate just like the gcc function ``dup()`` and
+V4L2 functions
+:c:func:`open() `, :c:func:`close() `,
+:c:func:`ioctl() `, :c:func:`read() `,
+:c:func:`mmap() ` and :c:func:`munmap() `:
 
 .. c:function:: int v4l2_open(const char *file, int oflag, ...)
 
-   operates like the standard :ref:`open() ` function.
+   operates like the :c:func:`open() ` function.
 
 .. c:function:: int v4l2_close(int fd)
 
-   operates like the standard :ref:`close() ` function.
+   operates like the :c:func:`close() ` function.
 
 .. c:function:: int v4l2_dup(int fd)
 
-   operates like the standard dup() function, duplicating a file handler.
+   operates like the libc ``dup()`` function, duplicating a file handler.
 
 .. c:function:: int v4l2_ioctl (int fd, unsigned long int request, ...)
 
-   operates like the standard :ref:`ioctl() ` function.
+   operates like the :c:func:`ioctl() ` function.
 
 .. c:function:: int v4l2_read (int fd, void* buffer, size_t n)
 
-   operates like the standard :ref:`read() ` function.
+   operates like the :c:func:`read() ` function.
 
 .. c:function:: void v4l2_mmap(void *start, size_t length, int prot, int 
flags, int fd, int64_t offset);
 
-   operates like the standard :ref:`mmap() ` function.
+   operates like the :c:func:`munmap() ` function.
 
 .. c:function:: int v4l2_munmap(void *_start, size_t length);
-   operates like the standard :ref:`munmap() ` function.
+
+   operates like the :c:func:`munmap() ` function.
 
 Those functions provide additional control:
 
 .. c:function:: int v4l2_fd_open(int fd, int v4l2_flags)
 
opens an already opened fd for further use through v4l2lib and possibly
-   modify libv4l2's default behavior through the v4l2_flags argument.
-   Currently, v4l2_flags can be ``V4L2_DISABLE_CONVERSION``, to disable
+   modify libv4l2's default behavior through the ``v4l2_flags`` argument.
+   Currently, ``v4l2_flags`` can be ``V4L2_DISABLE_CONVERSION``, to disable
format conversion.
 
 .. c:function:: int v4l2_set_control(int fd, int cid, int value)
@@ -168,9 +172,12 @@ Those functions provide additional control:
 v4l1compat.so wrapper library
 =
 
-This library intercepts calls to open/close/ioctl/mmap/mmunmap
+This library intercepts calls to
+:c:func:`open() `, :c:func:`close() `,
+:c:func:`ioctl() `, :c:func:`mmap() ` and
+:c:func:`munmap() `
 operations and redirects them to the libv4l counterparts, by using
-LD_PRELOAD=/usr/lib/v4l1compat.so. It also emulates V4L1 calls via V4L2
+``LD_PRELOAD=/usr/lib/v4l1compat.so``. It also emulates V4L1 calls via V4L2
 API.
 
 It allows usage of binary legacy applications that still don't use
-- 
2.7.4


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


[PATCH 30/47] [media] ca-get-msg.rst: add a boilerplate for struct ca_msg

2016-09-08 Thread Mauro Carvalho Chehab
There are no descriptions at ca.h header for this struct.
Yet, as we want to get rid of the warnings, let's add a
boilerplate, with just the struct types and fields.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/ca-get-msg.rst | 33 -
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/dvb/ca-get-msg.rst 
b/Documentation/media/uapi/dvb/ca-get-msg.rst
index 880995230909..03b2a602f02a 100644
--- a/Documentation/media/uapi/dvb/ca-get-msg.rst
+++ b/Documentation/media/uapi/dvb/ca-get-msg.rst
@@ -26,7 +26,38 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() 
`.
 
 ``msg``
-  Undocumented.
+  Pointer to struct :c:type:`ca_msg`.
+
+
+.. c:type:: struct ca_msg
+
+.. flat-table:: struct ca_msg
+:header-rows:  1
+:stub-columns: 0
+
+-
+  - type
+  - name
+  - description
+-
+   - unsigned int
+   - index
+   -
+
+-
+   - unsigned int
+   - type
+   -
+
+-
+   - unsigned int
+   - length
+   -
+
+-
+   - unsigned char
+   - msg[256]
+   -
 
 
 Description
-- 
2.7.4


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


[PATCH 14/47] [media] v4l2-ctrls: document some extra data structures

2016-09-08 Thread Mauro Carvalho Chehab
The typedefs and a macro are not defined. While here, improve a
few bits on the documentation.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-ctrls.h | 51 +++---
 1 file changed, 44 insertions(+), 7 deletions(-)

diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 178a88d45aea..a63f37044f1c 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -93,6 +93,16 @@ struct v4l2_ctrl_type_ops {
union v4l2_ctrl_ptr ptr);
 };
 
+/**
+ * typedef v4l2_ctrl_notify_fnc - typedef for a notify argument with a function
+ * that should be called when a control value has changed.
+ *
+ * @ctrl: pointer to struct &v4l2_ctrl
+ * @priv: control private data
+ *
+ * This typedef definition is used as an argument to v4l2_ctrl_notify()
+ * and as an argument at struct &v4l2_ctrl_handler.
+ */
 typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv);
 
 /**
@@ -369,17 +379,38 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
v4l2_ctrl_type *type,
  * @key:   Used by the lock validator if CONFIG_LOCKDEP is set.
  * @name:  Used by the lock validator if CONFIG_LOCKDEP is set.
  *
- * Returns an error if the buckets could not be allocated. This error will
- * also be stored in @hdl->error.
+ * .. attention::
  *
- * Never use this call directly, always use the v4l2_ctrl_handler_init
- * macro that hides the @key and @name arguments.
+ *Never use this call directly, always use the v4l2_ctrl_handler_init()
+ *macro that hides the @key and @name arguments.
+ *
+ * Return: returns an error if the buckets could not be allocated. This
+ * error will also be stored in @hdl->error.
  */
 int v4l2_ctrl_handler_init_class(struct v4l2_ctrl_handler *hdl,
 unsigned int nr_of_controls_hint,
 struct lock_class_key *key, const char *name);
 
 #ifdef CONFIG_LOCKDEP
+
+/**
+ * v4l2_ctrl_handler_init -
+ *
+ * @hdl:   The control handler.
+ * @nr_of_controls_hint: A hint of how many controls this handler is
+ * expected to refer to. This is the total number, so including
+ * any inherited controls. It doesn't have to be precise, but if
+ * it is way off, then you either waste memory (too many buckets
+ * are allocated) or the control lookup becomes slower (not enough
+ * buckets are allocated, so there are more slow list lookups).
+ * It will always work, though.
+ *
+ * This helper function creates a static struct &lock_class_key and
+ * calls v4l2_ctrl_handler_init_class(), providing a proper name for the lock
+ * validador.
+ *
+ * Use this helper function to initialize a control handler.
+ */
 #define v4l2_ctrl_handler_init(hdl, nr_of_controls_hint)   \
 (  \
({  \
@@ -564,6 +595,13 @@ struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct 
v4l2_ctrl_handler *hdl,
 u32 id, u8 max, u8 def,
 const s64 *qmenu_int);
 
+/**
+ * typedef v4l2_ctrl_filter - Typedef to define the filter function to be
+ * used when adding a control handler.
+ *
+ * @ctrl: pointer to struct &v4l2_ctrl.
+ */
+
 typedef bool (*v4l2_ctrl_filter)(const struct v4l2_ctrl *ctrl);
 
 /**
@@ -635,8 +673,8 @@ void v4l2_ctrl_cluster(unsigned int ncontrols, struct 
v4l2_ctrl **controls);
  * be marked active, and any reads will just return the current value without
  * going through g_volatile_ctrl.
  *
- * In addition, this function will set the V4L2_CTRL_FLAG_UPDATE flag
- * on the autofoo control and V4L2_CTRL_FLAG_INACTIVE on the foo control(s)
+ * In addition, this function will set the %V4L2_CTRL_FLAG_UPDATE flag
+ * on the autofoo control and %V4L2_CTRL_FLAG_INACTIVE on the foo control(s)
  * if autofoo is in auto mode.
  */
 void v4l2_ctrl_auto_cluster(unsigned int ncontrols,
@@ -686,7 +724,6 @@ void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool 
active);
  */
 void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed);
 
-
 /**
  *__v4l2_ctrl_modify_range() - Unlocked variant of v4l2_ctrl_modify_range()
  *
-- 
2.7.4


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


[PATCH 04/47] [media] conf_nitpick.py: add external vars to ignore list

2016-09-08 Thread Mauro Carvalho Chehab
There a some other types and functions that aren't declared
inside the media document but are elsewhere. Add them to the
ignore list.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/conf_nitpick.py | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/Documentation/media/conf_nitpick.py 
b/Documentation/media/conf_nitpick.py
index 227deee68c88..4de9533ce361 100644
--- a/Documentation/media/conf_nitpick.py
+++ b/Documentation/media/conf_nitpick.py
@@ -21,8 +21,11 @@ nitpick_ignore = [
 ("c:func", "clock_gettime"),
 ("c:func", "close"),
 ("c:func", "container_of"),
+("c:func", "copy_from_user"),
+("c:func", "copy_to_user"),
 ("c:func", "determine_valid_ioctls"),
 ("c:func", "ERR_PTR"),
+("c:func", "i2c_new_device"),
 ("c:func", "ioctl"),
 ("c:func", "IS_ERR"),
 ("c:func", "mmap"),
@@ -37,6 +40,7 @@ nitpick_ignore = [
 ("c:func", "struct pollfd"),
 ("c:func", "usb_make_path"),
 ("c:func", "write"),
+
 ("c:type", "atomic_t"),
 ("c:type", "bool"),
 ("c:type", "boolean"),
@@ -72,10 +76,10 @@ nitpick_ignore = [
 ("c:type", "spi_device"),
 ("c:type", "spi_master"),
 ("c:type", "ssize_t"),
-("c:type", "struct fb_fix_screeninfo"),
-("c:type", "struct pollfd"),
-("c:type", "struct timeval"),
-("c:type", "struct video_capability"),
+("c:type", "fb_fix_screeninfo"),
+("c:type", "pollfd"),
+("c:type", "timeval"),
+("c:type", "video_capability"),
 ("c:type", "timeval"),
 ("c:type", "__u16"),
 ("c:type", "u16"),
@@ -87,6 +91,7 @@ nitpick_ignore = [
 ("c:type", "uint16_t"),
 ("c:type", "uint32_t"),
 ("c:type", "union"),
+("c:type", "__user"),
 ("c:type", "usb_device"),
 ("c:type", "video_system_t"),
 ]
-- 
2.7.4


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


[PATCH 18/47] [media] docs-rst: use C domain for enum references on uapi

2016-09-08 Thread Mauro Carvalho Chehab
Change the parse-headers.pl and the corresponding files to use
the C domain for enum references.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/hist-v4l2.rst   |  2 +-
 Documentation/media/uapi/v4l/subdev-formats.rst  |  2 +-
 Documentation/media/uapi/v4l/v4l2.rst|  2 +-
 Documentation/media/uapi/v4l/vidioc-dqevent.rst  |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-priority.rst   |  2 +-
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst| 14 +++---
 Documentation/media/uapi/v4l/vidioc-subdev-g-fmt.rst | 10 +-
 include/media/v4l2-dev.h | 12 ++--
 8 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/Documentation/media/uapi/v4l/hist-v4l2.rst 
b/Documentation/media/uapi/v4l/hist-v4l2.rst
index a84895968349..bd45431ed00e 100644
--- a/Documentation/media/uapi/v4l/hist-v4l2.rst
+++ b/Documentation/media/uapi/v4l/hist-v4l2.rst
@@ -1361,7 +1361,7 @@ V4L2 in Linux 3.19
:ref:`v4l2_quantization ` fields to struct
:c:type:`v4l2_pix_format`, struct
:c:type:`v4l2_pix_format_mplane` and
-   struct :ref:`v4l2_mbus_framefmt `.
+   struct :c:type:`v4l2_mbus_framefmt`.
 
 
 V4L2 in Linux 4.4
diff --git a/Documentation/media/uapi/v4l/subdev-formats.rst 
b/Documentation/media/uapi/v4l/subdev-formats.rst
index 52013b55ea80..f0d7754f1906 100644
--- a/Documentation/media/uapi/v4l/subdev-formats.rst
+++ b/Documentation/media/uapi/v4l/subdev-formats.rst
@@ -7,7 +7,7 @@ Media Bus Formats
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
-.. _v4l2-mbus-framefmt:
+.. c:type:: v4l2_mbus_framefmt
 
 .. flat-table:: struct v4l2_mbus_framefmt
 :header-rows:  0
diff --git a/Documentation/media/uapi/v4l/v4l2.rst 
b/Documentation/media/uapi/v4l/v4l2.rst
index 785d4cdd2f85..e020c57f98d4 100644
--- a/Documentation/media/uapi/v4l/v4l2.rst
+++ b/Documentation/media/uapi/v4l/v4l2.rst
@@ -116,7 +116,7 @@ Rewrote Colorspace chapter, added new enum
 :ref:`v4l2_quantization ` fields to struct
 :c:type:`v4l2_pix_format`, struct
 :c:type:`v4l2_pix_format_mplane` and struct
-:ref:`v4l2_mbus_framefmt `.
+:c:type:`v4l2_mbus_framefmt`.
 
 
 :revision: 3.17 / 2014-08-04 (*lp, hv*)
diff --git a/Documentation/media/uapi/v4l/vidioc-dqevent.rst 
b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
index cf0e98f5112f..3038f349049c 100644
--- a/Documentation/media/uapi/v4l/vidioc-dqevent.rst
+++ b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
@@ -356,7 +356,7 @@ call.
 
-
-  The type of the control. See enum
- :ref:`v4l2_ctrl_type `.
+ :c:type:`v4l2_ctrl_type`.
 
 -  .. row 3
 
diff --git a/Documentation/media/uapi/v4l/vidioc-g-priority.rst 
b/Documentation/media/uapi/v4l/vidioc-g-priority.rst
index d6a07c076837..cbd2a3cbb18e 100644
--- a/Documentation/media/uapi/v4l/vidioc-g-priority.rst
+++ b/Documentation/media/uapi/v4l/vidioc-g-priority.rst
@@ -44,7 +44,7 @@ an enum v4l2_priority variable and call 
:ref:`VIDIOC_S_PRIORITY ` how
+ control. See enum :c:type:`v4l2_ctrl_type` how
  the minimum value is to be used for each possible control type.
  Note that this a signed 32-bit value.
 
@@ -153,7 +153,7 @@ See also the examples in :ref:`control`.
-  ``maximum``
 
-  Maximum value, inclusive. This field gives an upper bound for the
- control. See enum :ref:`v4l2_ctrl_type ` how
+ control. See enum :c:type:`v4l2_ctrl_type` how
  the maximum value is to be used for each possible control type.
  Note that this a signed 32-bit value.
 
@@ -164,7 +164,7 @@ See also the examples in :ref:`control`.
-  ``step``
 
-  This field gives a step size for the control. See enum
- :ref:`v4l2_ctrl_type ` how the step value is
+ :c:type:`v4l2_ctrl_type` how the step value is
  to be used for each possible control type. Note that this an
  unsigned 32-bit value.
 
@@ -269,7 +269,7 @@ See also the examples in :ref:`control`.
-  ``minimum``
 
-  Minimum value, inclusive. This field gives a lower bound for the
- control. See enum :ref:`v4l2_ctrl_type ` how
+ control. See enum :c:type:`v4l2_ctrl_type` how
  the minimum value is to be used for each possible control type.
  Note that this a signed 64-bit value.
 
@@ -280,7 +280,7 @@ See also the examples in :ref:`control`.
-  ``maximum``
 
-  Maximum value, inclusive. This field gives an upper bound for the
- control. See enum :ref:`v4l2_ctrl_type ` how
+ control. See enum :c:type:`v4l2_ctrl_type` how
  the maximum value is to be used for each possible control type.
  Note that this a signed 64-bit value.
 
@@ -291,7 +291,7 @@ See also the examples in :ref:`control`.
-  ``step``
 
-  This field gives a step size for the control. See enum
- :ref:`v4l2_ctrl_type ` how the step value is
+ :c:type:`v4l2_ctrl_type` how the 

[PATCH 23/47] [media] v4l2-device.h: fix some doc tags

2016-09-08 Thread Mauro Carvalho Chehab
Fix some minor issues at the documentation tags on this file,
adding cross-references where needed, and fixing some broken
ones.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-device.h | 54 ++---
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h
index a9d6aa41790e..781cbfd168f0 100644
--- a/include/media/v4l2-device.h
+++ b/include/media/v4l2-device.h
@@ -39,7 +39,7 @@ struct v4l2_ctrl_handler;
  * if this struct is embedded into a larger struct.
  * @name: unique device name, by default the driver name + bus ID
  * @notify: notify callback called by some sub-devices.
- * @ctrl_handler: The control handler. May be NULL.
+ * @ctrl_handler: The control handler. May be %NULL.
  * @prio: Device's priority state
  * @ref: Keep track of the references to this struct.
  * @release: Release function that is called when the ref count
@@ -53,8 +53,8 @@ struct v4l2_ctrl_handler;
  *
  * .. note::
  *
- *#) dev->driver_data points to this struct.
- *#) dev might be NULL if there is no parent device
+ *#) @dev->driver_data points to this struct.
+ *#) @dev might be %NULL if there is no parent device
  */
 
 struct v4l2_device {
@@ -76,10 +76,10 @@ struct v4l2_device {
 /**
  * v4l2_device_get - gets a V4L2 device reference
  *
- * @v4l2_dev: pointer to struct v4l2_device
+ * @v4l2_dev: pointer to struct &v4l2_device
  *
  * This is an ancillary routine meant to increment the usage for the
- * struct v4l2_device pointed by @v4l2_dev.
+ * struct &v4l2_device pointed by @v4l2_dev.
  */
 static inline void v4l2_device_get(struct v4l2_device *v4l2_dev)
 {
@@ -89,23 +89,23 @@ static inline void v4l2_device_get(struct v4l2_device 
*v4l2_dev)
 /**
  * v4l2_device_put - putss a V4L2 device reference
  *
- * @v4l2_dev: pointer to struct v4l2_device
+ * @v4l2_dev: pointer to struct &v4l2_device
  *
  * This is an ancillary routine meant to decrement the usage for the
- * struct v4l2_device pointed by @v4l2_dev.
+ * struct &v4l2_device pointed by @v4l2_dev.
  */
 int v4l2_device_put(struct v4l2_device *v4l2_dev);
 
 /**
- * v4l2_device_register -Initialize v4l2_dev and make dev->driver_data
- * point to v4l2_dev.
+ * v4l2_device_register - Initialize v4l2_dev and make @dev->driver_data
+ * point to @v4l2_dev.
  *
- * @dev: pointer to struct device
- * @v4l2_dev: pointer to struct v4l2_device
+ * @dev: pointer to struct &device
+ * @v4l2_dev: pointer to struct &v4l2_device
  *
  * .. note::
- * dev may be NULL in rare cases (ISA devices).
- * In such case the caller must fill in the v4l2_dev->name field
+ * @dev may be %NULL in rare cases (ISA devices).
+ * In such case the caller must fill in the @v4l2_dev->name field
  * before calling this function.
  */
 int __must_check v4l2_device_register(struct device *dev,
@@ -113,14 +113,14 @@ int __must_check v4l2_device_register(struct device *dev,
 
 /**
  * v4l2_device_set_name - Optional function to initialize the
- * name field of struct v4l2_device
+ * name field of struct &v4l2_device
  *
- * @v4l2_dev: pointer to struct v4l2_device
+ * @v4l2_dev: pointer to struct &v4l2_device
  * @basename: base name for the device name
  * @instance: pointer to a static atomic_t var with the instance usage for
  * the device driver.
  *
- * v4l2_device_set_name() initializes the name field of struct v4l2_device
+ * v4l2_device_set_name() initializes the name field of struct &v4l2_device
  * using the driver name and a driver-global atomic_t instance.
  *
  * This function will increment the instance counter and returns the
@@ -132,7 +132,7 @@ int __must_check v4l2_device_register(struct device *dev,
  *
  *   ...
  *
- *   instance = v4l2_device_set_name(&v4l2_dev, "foo", &drv_instance);
+ *   instance = v4l2_device_set_name(&\ v4l2_dev, "foo", &\ drv_instance);
  *
  * The first time this is called the name field will be set to foo0 and
  * this function returns 0. If the name ends with a digit (e.g. cx18),
@@ -147,16 +147,16 @@ int v4l2_device_set_name(struct v4l2_device *v4l2_dev, 
const char *basename,
  * @v4l2_dev: pointer to struct v4l2_device
  *
  * Should be called when the USB parent disconnects.
- * Since the parent disappears, this ensures that v4l2_dev doesn't have
+ * Since the parent disappears, this ensures that @v4l2_dev doesn't have
  * an invalid parent pointer.
  *
- * .. note:: This function sets v4l2_dev->dev to NULL.
+ * .. note:: This function sets @v4l2_dev->dev to NULL.
  */
 void v4l2_device_disconnect(struct v4l2_device *v4l2_dev);
 
 /**
  *  v4l2_device_unregister - Unregister all sub-devices and any other
- *  resources related to v4l2_dev.
+ *  resources related to @v4l2_dev.
  *
  * @v4l2_dev: pointer to struct v4l2_device
  */
@@ -165,8 +165,8 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev);
 /**
  * v4l2_device_register_subdev - Registers a subdev with 

[PATCH 21/47] [media] v4l2-ioctl.h: document the remaining functions

2016-09-08 Thread Mauro Carvalho Chehab
There are several undocumented functions here; document them.

While here, make checkpatch.pl happy.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/conf_nitpick.py |   1 +
 include/media/v4l2-ioctl.h  | 502 +---
 2 files changed, 301 insertions(+), 202 deletions(-)

diff --git a/Documentation/media/conf_nitpick.py 
b/Documentation/media/conf_nitpick.py
index 1c7928abace5..1f3ef3ded2d4 100644
--- a/Documentation/media/conf_nitpick.py
+++ b/Documentation/media/conf_nitpick.py
@@ -96,5 +96,6 @@ nitpick_ignore = [
 ("c:type", "__user"),
 ("c:type", "usb_device"),
 ("c:type", "usb_interface"),
+("c:type", "v4l2_std_id"),
 ("c:type", "video_system_t"),
 ]
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 8b1d19bc9b0e..574ff2ae94be 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -287,273 +287,286 @@ struct v4l2_ioctl_ops {
/* ioctl callbacks */
 
/* VIDIOC_QUERYCAP handler */
-   int (*vidioc_querycap)(struct file *file, void *fh, struct 
v4l2_capability *cap);
+   int (*vidioc_querycap)(struct file *file, void *fh,
+  struct v4l2_capability *cap);
 
/* VIDIOC_ENUM_FMT handlers */
-   int (*vidioc_enum_fmt_vid_cap) (struct file *file, void *fh,
-   struct v4l2_fmtdesc *f);
-   int (*vidioc_enum_fmt_vid_overlay) (struct file *file, void *fh,
-   struct v4l2_fmtdesc *f);
-   int (*vidioc_enum_fmt_vid_out) (struct file *file, void *fh,
-   struct v4l2_fmtdesc *f);
+   int (*vidioc_enum_fmt_vid_cap)(struct file *file, void *fh,
+  struct v4l2_fmtdesc *f);
+   int (*vidioc_enum_fmt_vid_overlay)(struct file *file, void *fh,
+  struct v4l2_fmtdesc *f);
+   int (*vidioc_enum_fmt_vid_out)(struct file *file, void *fh,
+  struct v4l2_fmtdesc *f);
int (*vidioc_enum_fmt_vid_cap_mplane)(struct file *file, void *fh,
  struct v4l2_fmtdesc *f);
int (*vidioc_enum_fmt_vid_out_mplane)(struct file *file, void *fh,
  struct v4l2_fmtdesc *f);
-   int (*vidioc_enum_fmt_sdr_cap) (struct file *file, void *fh,
-   struct v4l2_fmtdesc *f);
-   int (*vidioc_enum_fmt_sdr_out) (struct file *file, void *fh,
-   struct v4l2_fmtdesc *f);
+   int (*vidioc_enum_fmt_sdr_cap)(struct file *file, void *fh,
+  struct v4l2_fmtdesc *f);
+   int (*vidioc_enum_fmt_sdr_out)(struct file *file, void *fh,
+  struct v4l2_fmtdesc *f);
 
/* VIDIOC_G_FMT handlers */
-   int (*vidioc_g_fmt_vid_cap)(struct file *file, void *fh,
-   struct v4l2_format *f);
+   int (*vidioc_g_fmt_vid_cap)(struct file *file, void *fh,
+   struct v4l2_format *f);
int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *fh,
struct v4l2_format *f);
-   int (*vidioc_g_fmt_vid_out)(struct file *file, void *fh,
-   struct v4l2_format *f);
+   int (*vidioc_g_fmt_vid_out)(struct file *file, void *fh,
+   struct v4l2_format *f);
int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *fh,
-   struct v4l2_format *f);
-   int (*vidioc_g_fmt_vbi_cap)(struct file *file, void *fh,
-   struct v4l2_format *f);
-   int (*vidioc_g_fmt_vbi_out)(struct file *file, void *fh,
-   struct v4l2_format *f);
+   struct v4l2_format *f);
+   int (*vidioc_g_fmt_vbi_cap)(struct file *file, void *fh,
+   struct v4l2_format *f);
+   int (*vidioc_g_fmt_vbi_out)(struct file *file, void *fh,
+   struct v4l2_format *f);
int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *fh,
-   struct v4l2_format *f);
+  struct v4l2_format *f);
int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *fh,
-   struct v4l2_format *f);
+  struct v4l2_format *f);
int (*vidioc_g_fmt_vid_cap_mplane)(struct file *file, void *fh,
   struct v4l2_format *f);
int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *fh,
   

[PATCH 01/47] kernel-doc: ignore arguments on macro definitions

2016-09-08 Thread Mauro Carvalho Chehab
A macro definition is mapped via .. c:function:: at the
ReST markup when using the following kernel-doc tag:

/**
 * DMX_FE_ENTRY - Casts elements in the list of registered
 *   front-ends from the generic type struct list_head
 *   to the type * struct dmx_frontend
 *
 * @list: list of struct dmx_frontend
 */
 #define DMX_FE_ENTRY(list) \
list_entry(list, struct dmx_frontend, connectivity_list)

However, unlike a function description, the arguments of a macro
doesn't contain the data type.

This causes warnings when enabling Sphinx on nitkpick mode,
like this one:
./drivers/media/dvb-core/demux.h:358: WARNING: c:type reference target 
not found: list

That happens because kernel-doc output for the above is:

.. c:function:: DMX_FE_ENTRY ( list)

   Casts elements in the list of registered front-ends from the generic 
type struct list_head to the type * struct dmx_frontend

**Parameters**

``list``
  list of struct dmx_frontend

As the type is blank, Sphinx would think that ``list`` is a type,
and will try to add a cross reference for it, using their internal
representation for c:type:`list`.

However, ``list`` is not a type. So, that would cause either the
above warning, or if a ``list`` type exists, it would create
a reference to the wrong place at the doc.

To avoid that, let's ommit macro arguments from c:function::
declaration. As each argument will appear below the Parameters,
the type of the argument can be described there, if needed.

Signed-off-by: Mauro Carvalho Chehab 
---
 scripts/kernel-doc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 93721f3c91bf..3db6e6ac83f1 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1857,14 +1857,15 @@ sub output_function_rst(%) {
if ($count ne 0) {
print ", ";
}
-   $count++;
$type = $args{'parametertypes'}{$parameter};
 
if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
# pointer-to-function
print $1 . $parameter . ") (" . $2;
-   } else {
+   $count++;
+   } elsif ($type ne "") {
print $type . " " . $parameter;
+   $count++;
}
 }
 if ($args{'typedef'}) {
-- 
2.7.4


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


[PATCH 29/47] [media] ca-get-descr-info.rst: add doc for for struct ca_descr_info

2016-09-08 Thread Mauro Carvalho Chehab
The documentation follows what's there at the ca.h header.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/ca-get-descr-info.rst | 23 +-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/dvb/ca-get-descr-info.rst 
b/Documentation/media/uapi/dvb/ca-get-descr-info.rst
index b007f10b4910..b4a31940cec0 100644
--- a/Documentation/media/uapi/dvb/ca-get-descr-info.rst
+++ b/Documentation/media/uapi/dvb/ca-get-descr-info.rst
@@ -25,7 +25,28 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() 
`.
 
 ``desc``
-  Undocumented.
+  Pointer to struct :c:type:`ca_descr_info`.
+
+.. c:type:: struct ca_descr_info
+
+.. flat-table:: struct ca_descr_info
+:header-rows:  1
+:stub-columns: 0
+
+-
+  - type
+  - name
+  - description
+
+-
+  - unsigned int
+  - num
+  - number of available descramblers (keys)
+-
+  - unsigned int
+  - type
+  - type of supported scrambling system. Valid values are:
+   ``CA_ECD``, ``CA_NDS`` and ``CA_DSS``.
 
 
 Description
-- 
2.7.4


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


[PATCH 28/47] [media] ca-get-cap.rst: add a table for struct ca_caps

2016-09-08 Thread Mauro Carvalho Chehab
Add a flat-table describing struct ca_caps, as found at
the source file.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/ca-get-cap.rst | 29 -
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/dvb/ca-get-cap.rst 
b/Documentation/media/uapi/dvb/ca-get-cap.rst
index 3486805b62a9..77c57ac59535 100644
--- a/Documentation/media/uapi/dvb/ca-get-cap.rst
+++ b/Documentation/media/uapi/dvb/ca-get-cap.rst
@@ -26,7 +26,34 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() 
`.
 
 ``caps``
-  Undocumented.
+  struct :c:type:`ca_caps` pointer
+
+.. c:type:: struct ca_caps
+
+.. flat-table:: struct ca_caps
+:header-rows:  1
+:stub-columns: 0
+
+-
+  - type
+  - name
+  - description
+-
+  -unsigned int
+  - slot_num
+  - total number of CA card and module slots
+-
+  - unsigned int
+  - slot_type
+  - bitmask with all supported slot types
+-
+  - unsigned int
+  - descr_num
+  - total number of descrambler slots (keys)
+-
+  - unsigned int
+  - descr_type
+  - bit mask with all supported descr types
 
 
 Description
-- 
2.7.4


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


[PATCH 24/47] [media] v4l2-dv-timings.h: let kernel-doc parte the typedef argument

2016-09-08 Thread Mauro Carvalho Chehab
Now that scripts/kernel-doc was fixed to parse the typedef
argument used here, let it produce documentation.

Signed-off-by: Mauro Carvalho Chehab 
---
 include/media/v4l2-dv-timings.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/media/v4l2-dv-timings.h b/include/media/v4l2-dv-timings.h
index 65caadf13eec..0a7d9e1fc8c8 100644
--- a/include/media/v4l2-dv-timings.h
+++ b/include/media/v4l2-dv-timings.h
@@ -28,8 +28,8 @@
  */
 extern const struct v4l2_dv_timings v4l2_dv_timings_presets[];
 
-/*
- * v4l2_check_dv_timings_fnc - timings check callback
+/**
+ * typedef v4l2_check_dv_timings_fnc - timings check callback
  *
  * @t: the v4l2_dv_timings struct.
  * @handle: a handle from the driver.
-- 
2.7.4


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


[PATCH 44/47] [media] dev-sliced-vbi.rst: fix reference for v4l2_mpeg_vbi_ITV0

2016-09-08 Thread Mauro Carvalho Chehab
The struct v4l2_mpeg_vbi_ITV0 is identical to struct v4l2_mpeg_vbi_itv0,
except by its size, and it is documented at the same place at the
book.

Fix cross reference for it.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/dev-sliced-vbi.rst | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/media/uapi/v4l/dev-sliced-vbi.rst 
b/Documentation/media/uapi/v4l/dev-sliced-vbi.rst
index 7f159c3d4942..019cac7e90e4 100644
--- a/Documentation/media/uapi/v4l/dev-sliced-vbi.rst
+++ b/Documentation/media/uapi/v4l/dev-sliced-vbi.rst
@@ -672,8 +672,10 @@ Magic Constants for struct v4l2_mpeg_vbi_fmt_ivtv magic 
field
 
 .. c:type:: v4l2_mpeg_vbi_itv0
 
-struct v4l2_mpeg_vbi_itv0
--
+.. c:type:: v4l2_mpeg_vbi_ITV0
+
+structs v4l2_mpeg_vbi_itv0 and v4l2_mpeg_vbi_ITV0
+-
 
 .. tabularcolumns:: |p{4.4cm}|p{2.4cm}|p{10.7cm}|
 
-- 
2.7.4


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


[PATCH 02/47] docs-rst: parse-headers.pl: make debug a command line option

2016-09-08 Thread Mauro Carvalho Chehab
Add a parser for the --debug option, in order to allow
seeing what the parser is doing.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/sphinx/parse-headers.pl | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index 74089b0da798..531c710fc73f 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -2,12 +2,18 @@
 use strict;
 use Text::Tabs;
 
-# Uncomment if debug is needed
-#use Data::Dumper;
-
-# change to 1 to generate some debug prints
 my $debug = 0;
 
+while ($ARGV[0] =~ m/^-(.*)/) {
+   my $cmd = shift @ARGV;
+   if ($cmd eq "--debug") {
+   require Data::Dumper;
+   $debug = 1;
+   next;
+   }
+   die "argument $cmd unknown";
+}
+
 if (scalar @ARGV < 2 || scalar @ARGV > 3) {
die "Usage:\n\t$0   []\n";
 }
-- 
2.7.4


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


[PATCH 16/47] [media] diff-v4l.rst: Fix V4L version 1 references

2016-09-08 Thread Mauro Carvalho Chehab
The V4L version 1 structures had long gone from the Linux Kernel.
It doesn't make sense to use cross-references for them, as they
won't be found.

So, get rid of them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/diff-v4l.rst | 38 +++
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/Documentation/media/uapi/v4l/diff-v4l.rst 
b/Documentation/media/uapi/v4l/diff-v4l.rst
index 93794e015e7c..0419e2051759 100644
--- a/Documentation/media/uapi/v4l/diff-v4l.rst
+++ b/Documentation/media/uapi/v4l/diff-v4l.rst
@@ -87,7 +87,7 @@ Querying Capabilities
 The V4L ``VIDIOCGCAP`` ioctl is equivalent to V4L2's
 :ref:`VIDIOC_QUERYCAP`.
 
-The ``name`` field in struct :c:type:`struct video_capability` became
+The ``name`` field in struct ``video_capability`` became
 ``card`` in struct :c:type:`v4l2_capability`, ``type``
 was replaced by ``capabilities``. Note V4L2 does not distinguish between
 device types like this, better think of basic video input, video output
@@ -264,7 +264,7 @@ Video Sources
 =
 
 V4L provides the ``VIDIOCGCHAN`` and ``VIDIOCSCHAN`` ioctl using struct
-:c:type:`struct video_channel` to enumerate the video inputs of a V4L
+``video_channel`` to enumerate the video inputs of a V4L
 device. The equivalent V4L2 ioctls are
 :ref:`VIDIOC_ENUMINPUT`,
 :ref:`VIDIOC_G_INPUT ` and
@@ -283,7 +283,7 @@ video input types were renamed as follows:
 
 -  .. row 1
 
-   -  struct :c:type:`struct video_channel` ``type``
+   -  struct ``video_channel`` ``type``
 
-  struct :c:type:`v4l2_input` ``type``
 
@@ -328,7 +328,7 @@ Tuning
 ==
 
 The V4L ``VIDIOCGTUNER`` and ``VIDIOCSTUNER`` ioctl and struct
-:c:type:`struct video_tuner` can be used to enumerate the tuners of a
+``video_tuner`` can be used to enumerate the tuners of a
 V4L TV or radio device. The equivalent V4L2 ioctls are
 :ref:`VIDIOC_G_TUNER ` and
 :ref:`VIDIOC_S_TUNER ` using struct
@@ -374,7 +374,7 @@ Image Properties
 
 
 V4L2 has no equivalent of the ``VIDIOCGPICT`` and ``VIDIOCSPICT`` ioctl
-and struct :c:type:`struct video_picture`. The following fields where
+and struct ``video_picture``. The following fields where
 replaced by V4L2 controls accessible with the
 :ref:`VIDIOC_QUERYCTRL`,
 :ref:`VIDIOC_G_CTRL ` and
@@ -389,7 +389,7 @@ replaced by V4L2 controls accessible with the
 
 -  .. row 1
 
-   -  struct :c:type:`struct video_picture`
+   -  struct ``video_picture``
 
-  V4L2 Control ID
 
@@ -445,7 +445,7 @@ into the struct :c:type:`v4l2_pix_format`:
 
 -  .. row 1
 
-   -  struct :c:type:`struct video_picture` ``palette``
+   -  struct ``video_picture`` ``palette``
 
-  struct :c:type:`v4l2_pix_format` ``pixfmt``
 
@@ -554,7 +554,7 @@ Audio
 =
 
 The ``VIDIOCGAUDIO`` and ``VIDIOCSAUDIO`` ioctl and struct
-:c:type:`struct video_audio` are used to enumerate the audio inputs
+``video_audio`` are used to enumerate the audio inputs
 of a V4L device. The equivalent V4L2 ioctls are
 :ref:`VIDIOC_G_AUDIO ` and
 :ref:`VIDIOC_S_AUDIO ` using struct
@@ -591,7 +591,7 @@ The following fields where replaced by V4L2 controls 
accessible with the
 
 -  .. row 1
 
-   -  struct :c:type:`struct video_audio`
+   -  struct ``video_audio``
 
-  V4L2 Control ID
 
@@ -629,7 +629,7 @@ and ``VIDEO_AUDIO_MUTE`` flags where replaced by the boolean
 ``V4L2_CID_AUDIO_MUTE`` control.
 
 All V4L2 controls have a ``step`` attribute replacing the struct
-:c:type:`struct video_audio` ``step`` field. The V4L audio controls
+``video_audio`` ``step`` field. The V4L audio controls
 are assumed to range from 0 to 65535 with no particular reset value. The
 V4L2 API permits arbitrary limits and defaults which can be queried with
 the :ref:`VIDIOC_QUERYCTRL` ioctl. For general
@@ -642,7 +642,7 @@ Frame Buffer Overlay
 The V4L2 ioctls equivalent to ``VIDIOCGFBUF`` and ``VIDIOCSFBUF`` are
 :ref:`VIDIOC_G_FBUF ` and
 :ref:`VIDIOC_S_FBUF `. The ``base`` field of struct
-:c:type:`struct video_buffer` remained unchanged, except V4L2 defines
+``video_buffer`` remained unchanged, except V4L2 defines
 a flag to indicate non-destructive overlays instead of a ``NULL``
 pointer. All other fields moved into the struct
 :c:type:`v4l2_pix_format` ``fmt`` substructure of
@@ -659,13 +659,13 @@ of the ``fmt`` union is used, a struct
 :c:type:`v4l2_window`.
 
 The ``x``, ``y``, ``width`` and ``height`` fields of struct
-:c:type:`struct video_window` moved into struct
+``video_window`` moved into struct
 :c:type:`v4l2_rect` substructure ``w`` of struct
-:c:type:`struct v4l2_window`. The ``chromakey``, ``clips``, and
+:c:type:`v4l2_window`. The ``chromakey``, ``clips``, and
 ``clipcount`` fields remained unchanged. Struct
-:c:type:`struct video_clip` was renamed to struct
+``video_clip`` was renamed to struct
 :c:type:`v4l2_clip`, also containing a struct
-:c:type:`struct v4l2_rect`, but the semantics are still the same.
+:c:t

[PATCH 37/47] [media] docs-rst: simplify c:type: cross references

2016-09-08 Thread Mauro Carvalho Chehab
Instead of using c:type:`struct foo `, use:
struct c:type:`foo`

This patch was generated via this shell script:

for i in `find Documentation/media -type f`; do perl -ne 'if 
(m/\:c\:type\:\`struct\s+(\S+)\s*\<(\S+)\>\`/) { $s=$1; $r=$2; if ($s eq $r) { 
s/\:c\:type\:\`struct\s+(\S+)\s*\<(\S+)\>\`/struct :c:type:`$2`/; 
s/struct\s+struct/struct/;  s/(struct\s+\:c\:type\:\`\S+\`)\s+structure/$1/;  
}} print $_' <$i >a && mv a $i; done

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/kapi/mc-core.rst   | 24 +++---
 Documentation/media/uapi/dvb/dvbproperty.rst   |  2 +-
 Documentation/media/uapi/v4l/buffer.rst| 12 +--
 Documentation/media/uapi/v4l/dev-osd.rst   |  2 +-
 Documentation/media/uapi/v4l/dev-overlay.rst   |  2 +-
 Documentation/media/uapi/v4l/dev-sliced-vbi.rst|  6 +++---
 Documentation/media/uapi/v4l/extended-controls.rst |  2 +-
 Documentation/media/uapi/v4l/pixfmt-002.rst|  4 ++--
 Documentation/media/uapi/v4l/pixfmt-003.rst|  6 +++---
 Documentation/media/uapi/v4l/pixfmt.rst|  4 ++--
 .../media/uapi/v4l/vidioc-create-bufs.rst  |  2 +-
 Documentation/media/uapi/v4l/vidioc-enumstd.rst|  2 +-
 Documentation/media/uapi/v4l/vidioc-g-audio.rst|  2 +-
 Documentation/media/uapi/v4l/vidioc-g-audioout.rst |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-crop.rst |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-ctrl.rst |  4 ++--
 Documentation/media/uapi/v4l/vidioc-g-fbuf.rst |  4 ++--
 Documentation/media/uapi/v4l/vidioc-g-fmt.rst  |  4 ++--
 Documentation/media/uapi/v4l/vidioc-g-parm.rst |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-std.rst  |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst|  2 +-
 .../media/uapi/v4l/vidioc-prepare-buf.rst  |  2 +-
 Documentation/media/uapi/v4l/vidioc-qbuf.rst   |  4 ++--
 Documentation/media/uapi/v4l/vidioc-querybuf.rst   |  2 +-
 Documentation/media/uapi/v4l/vidioc-reqbufs.rst|  2 +-
 25 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/Documentation/media/kapi/mc-core.rst 
b/Documentation/media/kapi/mc-core.rst
index fb839a6c1f46..1a738e5f6056 100644
--- a/Documentation/media/kapi/mc-core.rst
+++ b/Documentation/media/kapi/mc-core.rst
@@ -34,7 +34,7 @@ pad to a sink pad.
 Media device
 
 
-A media device is represented by a :c:type:`struct media_device `
+A media device is represented by a struct :c:type:`media_device`
 instance, defined in ``include/media/media-device.h``.
 Allocation of the structure is handled by the media device driver, usually by
 embedding the :c:type:`media_device` instance in a larger driver-specific
@@ -47,7 +47,7 @@ and unregistered by calling 
:c:func:`media_device_unregister()`.
 Entities
 
 
-Entities are represented by a :c:type:`struct media_entity `
+Entities are represented by a struct :c:type:`media_entity`
 instance, defined in ``include/media/media-entity.h``. The structure is usually
 embedded into a higher-level structure, such as
 :c:type:`v4l2_subdev` or :c:type:`video_device`
@@ -65,10 +65,10 @@ Interfaces
 ^^
 
 Interfaces are represented by a
-:c:type:`struct media_interface ` instance, defined in
+struct :c:type:`media_interface` instance, defined in
 ``include/media/media-entity.h``. Currently, only one type of interface is
 defined: a device node. Such interfaces are represented by a
-:c:type:`struct media_intf_devnode `.
+struct :c:type:`media_intf_devnode`.
 
 Drivers initialize and create device node interfaces by calling
 :c:func:`media_devnode_create()`
@@ -77,7 +77,7 @@ and remove them by calling:
 
 Pads
 
-Pads are represented by a :c:type:`struct media_pad ` instance,
+Pads are represented by a struct :c:type:`media_pad` instance,
 defined in ``include/media/media-entity.h``. Each entity stores its pads in
 a pads array managed by the entity driver. Drivers usually embed the array in
 a driver-specific structure.
@@ -85,8 +85,8 @@ a driver-specific structure.
 Pads are identified by their entity and their 0-based index in the pads
 array.
 
-Both information are stored in the :c:type:`struct media_pad `,
-making the :c:type:`struct media_pad ` pointer the canonical way
+Both information are stored in the struct :c:type:`media_pad`,
+making the struct :c:type:`media_pad` pointer the canonical way
 to store and pass link references.
 
 Pads have flags that describe the pad capabilities and state.
@@ -102,7 +102,7 @@ Pads have flags that describe the pad capabilities and 
state.
 Links
 ^
 
-Links are represented by a :c:type:`struct media_link ` instance,
+Links are represented by a struct :c:type:`media_link` instance,
 defined in ``include/media/media-entity.h``. There are two types of links:
 
 **1. pad to pad links**:
@@ -185,7 +185,7 @@ Use count and power handling
 
 Due to the wide differences between drivers regarding power management
 needs, the media controller does 

[PATCH 39/47] [media] fix clock_gettime cross-references

2016-09-08 Thread Mauro Carvalho Chehab
Fix those warnings:

Documentation/media/uapi/cec/cec-ioc-dqevent.rst:124: WARNING: c:func 
reference target not found: clock_gettime(2)

By replacing it with the right function name, using this shell script:

for i in `find Documentation/media -type f`; do sed 
's,clock_gettime(2),clock_gettime,' <$i >a && mv a $i; done

Please notice that this will make the nitpick mode to shut up
complaining about that, becasue clock_gettime is on its exclude list,
but the cross reference will be undefined until someone documents
this function at the core documentation.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst | 2 +-
 Documentation/media/uapi/cec/cec-ioc-receive.rst | 4 ++--
 Documentation/media/uapi/v4l/buffer.rst  | 4 ++--
 Documentation/media/uapi/v4l/vidioc-dqevent.rst  | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst 
b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
index 06b79361254c..060c455380ce 100644
--- a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
@@ -122,7 +122,7 @@ it is guaranteed that the state did change in between the 
two events.
-  :cspan:`1` Timestamp of the event in ns.
 
  The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To 
access
- the same clock from userspace use :c:func:`clock_gettime(2)`.
+ the same clock from userspace use :c:func:`clock_gettime`.
 
 -  .. row 2
 
diff --git a/Documentation/media/uapi/cec/cec-ioc-receive.rst 
b/Documentation/media/uapi/cec/cec-ioc-receive.rst
index 18620f81b7d9..d585b1bba6ac 100644
--- a/Documentation/media/uapi/cec/cec-ioc-receive.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-receive.rst
@@ -95,7 +95,7 @@ result.
 
-  Timestamp in ns of when the last byte of the message was transmitted.
  The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To 
access
- the same clock from userspace use :c:func:`clock_gettime(2)`.
+ the same clock from userspace use :c:func:`clock_gettime`.
 
 -  .. row 2
 
@@ -105,7 +105,7 @@ result.
 
-  Timestamp in ns of when the last byte of the message was received.
  The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To 
access
- the same clock from userspace use :c:func:`clock_gettime(2)`.
+ the same clock from userspace use :c:func:`clock_gettime`.
 
 -  .. row 3
 
diff --git a/Documentation/media/uapi/v4l/buffer.rst 
b/Documentation/media/uapi/v4l/buffer.rst
index 7d2d81a771b1..e71a458712d3 100644
--- a/Documentation/media/uapi/v4l/buffer.rst
+++ b/Documentation/media/uapi/v4l/buffer.rst
@@ -712,7 +712,7 @@ Buffer Flags
  clock). Monotonic clock has been favoured in embedded systems
  whereas most of the drivers use the realtime clock. Either kinds
  of timestamps are available in user space via
- :c:func:`clock_gettime(2)` using clock IDs ``CLOCK_MONOTONIC``
+ :c:func:`clock_gettime` using clock IDs ``CLOCK_MONOTONIC``
  and ``CLOCK_REALTIME``, respectively.
 
 -  .. _`V4L2-BUF-FLAG-TIMESTAMP-MONOTONIC`:
@@ -723,7 +723,7 @@ Buffer Flags
 
-  The buffer timestamp has been taken from the ``CLOCK_MONOTONIC``
  clock. To access the same clock outside V4L2, use
- :c:func:`clock_gettime(2)`.
+ :c:func:`clock_gettime`.
 
 -  .. _`V4L2-BUF-FLAG-TIMESTAMP-COPY`:
 
diff --git a/Documentation/media/uapi/v4l/vidioc-dqevent.rst 
b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
index 3038f349049c..1e435ab674a2 100644
--- a/Documentation/media/uapi/v4l/vidioc-dqevent.rst
+++ b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
@@ -152,7 +152,7 @@ call.
-
-  Event timestamp. The timestamp has been taken from the
  ``CLOCK_MONOTONIC`` clock. To access the same clock outside V4L2,
- use :c:func:`clock_gettime(2)`.
+ use :c:func:`clock_gettime`.
 
 -  .. row 12
 
-- 
2.7.4


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


[PATCH 07/47] [media] dvb_ringbuffer.h: document the define macros

2016-09-08 Thread Mauro Carvalho Chehab
There are a few define macros not documented, because the ReST
output was causing more warnings.

Now that this got fixed, document them. While here, fix the
remaining coding style issues.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-core/dvb_ringbuffer.h | 27 +++
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/drivers/media/dvb-core/dvb_ringbuffer.h 
b/drivers/media/dvb-core/dvb_ringbuffer.h
index f64bd86fe5fd..eae3f091b6a0 100644
--- a/drivers/media/dvb-core/dvb_ringbuffer.h
+++ b/drivers/media/dvb-core/dvb_ringbuffer.h
@@ -97,7 +97,6 @@ extern ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer 
*rbuf);
  */
 extern void dvb_ringbuffer_reset(struct dvb_ringbuffer *rbuf);
 
-
 /*
  * read routines & macros
  */
@@ -117,11 +116,21 @@ extern void dvb_ringbuffer_flush(struct dvb_ringbuffer 
*rbuf);
  */
 extern void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf);
 
-/* DVB_RINGBUFFER_PEEK - peek at byte @offs: in the buffer */
+/**
+ * DVB_RINGBUFFER_PEEK - peek at byte @offs in the buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @offs: offset inside the ringbuffer
+ */
 #define DVB_RINGBUFFER_PEEK(rbuf, offs)\
-   (rbuf)->data[((rbuf)->pread + (offs)) % (rbuf)->size]
+   ((rbuf)->data[((rbuf)->pread + (offs)) % (rbuf)->size])
 
-/* advance read ptr by @num: bytes */
+/**
+ * DVB_RINGBUFFER_SKIP - advance read ptr by @num bytes
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @num: number of bytes to advance
+ */
 #define DVB_RINGBUFFER_SKIP(rbuf, num) {\
(rbuf)->pread = ((rbuf)->pread + (num)) % (rbuf)->size;\
 }
@@ -155,12 +164,16 @@ extern ssize_t dvb_ringbuffer_read_user(struct 
dvb_ringbuffer *rbuf,
 extern void dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf,
   u8 *buf, size_t len);
 
-
 /*
  * write routines & macros
  */
 
-/* write single byte to ring buffer */
+/**
+ * DVB_RINGBUFFER_WRITE_BYTE - write single byte to ring buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @byte: byte to write
+ */
 #define DVB_RINGBUFFER_WRITE_BYTE(rbuf, byte)  \
{ (rbuf)->data[(rbuf)->pwrite] = (byte); \
(rbuf)->pwrite = ((rbuf)->pwrite + 1) % (rbuf)->size; }
@@ -194,7 +207,6 @@ extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer 
*rbuf, const u8 *buf,
 extern ssize_t dvb_ringbuffer_write_user(struct dvb_ringbuffer *rbuf,
 const u8 __user *buf, size_t len);
 
-
 /**
  * dvb_ringbuffer_pkt_write - Write a packet into the ringbuffer.
  *
@@ -265,5 +277,4 @@ extern void dvb_ringbuffer_pkt_dispose(struct 
dvb_ringbuffer *rbuf, size_t idx);
 extern ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf,
   size_t idx, size_t *pktlen);
 
-
 #endif /* _DVB_RINGBUFFER_H_ */
-- 
2.7.4


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


[PATCH 06/47] [media] dtv-core.rst: move DTV ringbuffer notes to kAPI doc

2016-09-08 Thread Mauro Carvalho Chehab
Instead of keeping those notes at the file on a non-structured
way, move them to dtv-core.rst, using the proper ReST tags.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/kapi/dtv-core.rst   | 38 +++--
 drivers/media/dvb-core/dvb_ringbuffer.h | 28 
 2 files changed, 36 insertions(+), 30 deletions(-)

diff --git a/Documentation/media/kapi/dtv-core.rst 
b/Documentation/media/kapi/dtv-core.rst
index 41df9f144fcb..a3c4642eabfc 100644
--- a/Documentation/media/kapi/dtv-core.rst
+++ b/Documentation/media/kapi/dtv-core.rst
@@ -6,8 +6,6 @@ Digital TV Common functions
 
 .. kernel-doc:: drivers/media/dvb-core/dvb_math.h
 
-.. kernel-doc:: drivers/media/dvb-core/dvb_ringbuffer.h
-
 .. kernel-doc:: drivers/media/dvb-core/dvbdev.h
 
 
@@ -18,6 +16,42 @@ Digital TV Common functions
 .. kernel-doc:: drivers/media/dvb-core/dvbdev.h
:export: drivers/media/dvb-core/dvbdev.c
 
+Digital TV Ring buffer
+--
+
+Those routines implement ring buffers used to handle digital TV data and
+copy it from/to userspace.
+
+.. note::
+
+  1) For performance reasons read and write routines don't check buffer sizes
+ and/or number of bytes free/available. This has to be done before these
+ routines are called. For example:
+
+   .. code-block:: c
+
+/* write @buflen: bytes */
+free = dvb_ringbuffer_free(rbuf);
+if (free >= buflen)
+count = dvb_ringbuffer_write(rbuf, buffer, buflen);
+else
+/* do something */
+
+/* read min. 1000, max. @bufsize: bytes */
+avail = dvb_ringbuffer_avail(rbuf);
+if (avail >= 1000)
+count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize));
+else
+/* do something */
+
+  2) If there is exactly one reader and one writer, there is no need
+ to lock read or write operations.
+ Two or more readers must be locked against each other.
+ Flushing the buffer counts as a read operation.
+ Resetting the buffer counts as a read and write operation.
+ Two or more writers must be locked against each other.
+
+.. kernel-doc:: drivers/media/dvb-core/dvb_ringbuffer.h
 
 
 Digital TV Frontend kABI
diff --git a/drivers/media/dvb-core/dvb_ringbuffer.h 
b/drivers/media/dvb-core/dvb_ringbuffer.h
index 8209eb4db2aa..f64bd86fe5fd 100644
--- a/drivers/media/dvb-core/dvb_ringbuffer.h
+++ b/drivers/media/dvb-core/dvb_ringbuffer.h
@@ -66,34 +66,6 @@ extern void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, 
void *data,
  *
  * @rbuf: pointer to struct dvb_ringbuffer
  */
-/*
- * Notes:
- * --
- * (1) For performance reasons read and write routines don't check buffer sizes
- * and/or number of bytes free/available. This has to be done before these
- * routines are called. For example:
- *
- * *** write @buflen: bytes ***
- * free = dvb_ringbuffer_free(rbuf);
- * if (free >= buflen)
- * count = dvb_ringbuffer_write(rbuf, buffer, buflen);
- * else
- * ...
- *
- * *** read min. 1000, max. @bufsize: bytes ***
- * avail = dvb_ringbuffer_avail(rbuf);
- * if (avail >= 1000)
- * count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize));
- * else
- * ...
- *
- * (2) If there is exactly one reader and one writer, there is no need
- * to lock read or write operations.
- * Two or more readers must be locked against each other.
- * Flushing the buffer counts as a read operation.
- * Resetting the buffer counts as a read and write operation.
- * Two or more writers must be locked against each other.
- */
 extern int dvb_ringbuffer_empty(struct dvb_ringbuffer *rbuf);
 
 /**
-- 
2.7.4


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


[PATCH 32/47] [media] ca-set-pid.rst: document struct ca_pid

2016-09-08 Thread Mauro Carvalho Chehab
Add a table describing the fields on this struct, based
on ca.h header.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/ca-set-pid.rst | 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/dvb/ca-set-pid.rst 
b/Documentation/media/uapi/dvb/ca-set-pid.rst
index 8e13ad9595d3..06bdaf4afada 100644
--- a/Documentation/media/uapi/dvb/ca-set-pid.rst
+++ b/Documentation/media/uapi/dvb/ca-set-pid.rst
@@ -26,7 +26,24 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() 
`.
 
 ``pid``
-  Undocumented.
+  Pointer to struct :c:type:`ca_pid`.
+
+.. c:type:: ca_pid
+
+.. flat-table:: struct ca_pid
+:header-rows:  1
+:stub-columns: 0
+
+-
+   - unsigned int
+   - pid
+   - Program ID
+
+-
+   - int
+   - index
+   - PID index. Use -1 to disable.
+
 
 
 Description
-- 
2.7.4


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


[PATCH 43/47] [media] docs-rst: fix cross-references for videodev2.h

2016-09-08 Thread Mauro Carvalho Chehab
There are several broken references there, due to the conversion to
C domain. Fix them using this shell script and manually adjust what's
broken:

# funcs is a file with the broken functions/references
for i in $(cat funcs|sort|uniq|perl -ne 'print "$1\n" if (m/(\S+)$/)'); 
do
i=${i//-/_}
echo $i
j=${i//_/-}
for k in $(git grep -l "_$j:" Documentation/); do
sed s,\_$j\:,"c\:type\:\: $i", <$k >a && mv a $k
done
for k in $(git grep -l "$j" Documentation/media/*.exceptions); 
do
sed s,$j,":c\:type\:\`$i\`", <$k >a && mv a $k
done
for k in $(git grep -l "$j" Documentation/); do
sed "s,:ref:\`$i <$j>\`,:c:type:\`$i\`," <$k >a && mv a 
$k
sed "s,:ref:\`$j\`,:c:type:\`$i\`," <$k >a && mv a $k
sed -E "s,:ref:\`(.*)<$j>\`,:c:type:\`\1<$i>\`," <$k >a 
&& mv a $k
done
for k in $(git grep -l "<$j>" include/media); do
sed -E "s,:ref:\`(.*)<$j>\`,enum \&$i," <$k >a && mv a 
$k
done
done

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/v4l/buffer.rst|  14 +-
 Documentation/media/uapi/v4l/field-order.rst   |   4 +-
 Documentation/media/uapi/v4l/hist-v4l2.rst |  30 +--
 Documentation/media/uapi/v4l/pixfmt-002.rst|  10 +-
 Documentation/media/uapi/v4l/pixfmt-003.rst|  10 +-
 Documentation/media/uapi/v4l/pixfmt-006.rst|  16 +-
 Documentation/media/uapi/v4l/planar-apis.rst   |   2 +-
 Documentation/media/uapi/v4l/subdev-formats.rst|  10 +-
 Documentation/media/uapi/v4l/tuner.rst |   4 +-
 Documentation/media/uapi/v4l/v4l2.rst  |   4 +-
 .../media/uapi/v4l/vidioc-create-bufs.rst  |   2 +-
 Documentation/media/uapi/v4l/vidioc-cropcap.rst|   2 +-
 .../media/uapi/v4l/vidioc-dbg-g-register.rst   |   2 +-
 Documentation/media/uapi/v4l/vidioc-dqevent.rst|   2 +-
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst   |   2 +-
 .../media/uapi/v4l/vidioc-enum-frameintervals.rst  |   2 +-
 .../media/uapi/v4l/vidioc-enum-framesizes.rst  |   2 +-
 .../media/uapi/v4l/vidioc-enum-freq-bands.rst  |   2 +-
 Documentation/media/uapi/v4l/vidioc-expbuf.rst |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-crop.rst |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-edid.rst |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-fbuf.rst |   4 +-
 Documentation/media/uapi/v4l/vidioc-g-fmt.rst  |   2 +-
 .../media/uapi/v4l/vidioc-g-frequency.rst  |   2 +-
 .../media/uapi/v4l/vidioc-g-modulator.rst  |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-parm.rst |   2 +-
 .../media/uapi/v4l/vidioc-g-selection.rst  |   2 +-
 .../media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst|   4 +-
 Documentation/media/uapi/v4l/vidioc-querycap.rst   |   2 +-
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst  |   4 +-
 Documentation/media/uapi/v4l/vidioc-reqbufs.rst|   4 +-
 .../media/uapi/v4l/vidioc-s-hw-freq-seek.rst   |   2 +-
 .../uapi/v4l/vidioc-subdev-enum-frame-interval.rst |   7 +-
 .../uapi/v4l/vidioc-subdev-enum-frame-size.rst |   6 +-
 .../uapi/v4l/vidioc-subdev-enum-mbus-code.rst  |   6 +-
 .../media/uapi/v4l/vidioc-subdev-g-crop.rst|   8 +-
 .../media/uapi/v4l/vidioc-subdev-g-fmt.rst |   2 +-
 .../uapi/v4l/vidioc-subdev-g-frame-interval.rst|   8 +-
 .../media/uapi/v4l/vidioc-subdev-g-selection.rst   |   4 +-
 Documentation/media/videodev2.h.rst.exceptions | 204 ++---
 41 files changed, 201 insertions(+), 202 deletions(-)

diff --git a/Documentation/media/uapi/v4l/buffer.rst 
b/Documentation/media/uapi/v4l/buffer.rst
index e71a458712d3..21893ee1384a 100644
--- a/Documentation/media/uapi/v4l/buffer.rst
+++ b/Documentation/media/uapi/v4l/buffer.rst
@@ -74,7 +74,7 @@ struct v4l2_buffer
-  Type of the buffer, same as struct
  :c:type:`v4l2_format` ``type`` or struct
  :c:type:`v4l2_requestbuffers` ``type``, set
- by the application. See :ref:`v4l2-buf-type`
+ by the application. See :c:type:`v4l2_buf_type`
 
 -  .. row 3
 
@@ -110,7 +110,7 @@ struct v4l2_buffer
 
-
-  Indicates the field order of the image in the buffer, see
- :ref:`v4l2-field`. This field is not used when the buffer
+ :c:type:`v4l2_field`. This field is not used when the buffer
  contains VBI data. Drivers must set it when ``type`` refers to a
  capture stream, applications when it refers to an output stream.
 
@@ -142,7 +142,7 @@ struct v4l2_buffer
-  When ``type`` is ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` and the
  ``V4L2_BUF_FLAG_TIMECODE`` flag is set in ``flags``, this
  str

[PATCH 20/47] [media] cec-ioc-dqevent.rst: fix some undefined references

2016-09-08 Thread Mauro Carvalho Chehab
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: 
cec_event_state_change
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: 
cec_event_state_change
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: 
cec_event_lost_msgs
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: 
cec_event_lost_msgs
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: 
cec_event_state_change
Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: 
cec_event_lost_msgs

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst 
b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
index 10228eb0fd4a..06b79361254c 100644
--- a/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
+++ b/Documentation/media/uapi/cec/cec-ioc-dqevent.rst
@@ -51,7 +51,7 @@ it is guaranteed that the state did change in between the two 
events.
 
 .. tabularcolumns:: |p{1.2cm}|p{2.9cm}|p{13.4cm}|
 
-.. _cec-event-state-change_s:
+.. c:type:: cec_event_state_change
 
 .. flat-table:: struct cec_event_state_change
 :header-rows:  0
@@ -78,7 +78,7 @@ it is guaranteed that the state did change in between the two 
events.
 
 .. tabularcolumns:: |p{1.0cm}|p{2.0cm}|p{14.5cm}|
 
-.. _cec-event-lost-msgs_s:
+.. c:type:: cec_event_lost_msgs
 
 .. flat-table:: struct cec_event_lost_msgs
 :header-rows:  0
-- 
2.7.4


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


[PATCH 35/47] [media] docs-rst: fix dmx bad cross-references

2016-09-08 Thread Mauro Carvalho Chehab
Some structs are pointed via the typedef. As we replaced
those references, fix them.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/dvb/dmx-get-caps.rst   | 5 ++---
 Documentation/media/uapi/dvb/dmx-set-source.rst | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Documentation/media/uapi/dvb/dmx-get-caps.rst 
b/Documentation/media/uapi/dvb/dmx-get-caps.rst
index aaf084a245fd..145fb520d779 100644
--- a/Documentation/media/uapi/dvb/dmx-get-caps.rst
+++ b/Documentation/media/uapi/dvb/dmx-get-caps.rst
@@ -15,7 +15,7 @@ DMX_GET_CAPS
 Synopsis
 
 
-.. c:function:: int ioctl(fd, DMX_GET_CAPS, dmx_caps_t *caps)
+.. c:function:: int ioctl(fd, DMX_GET_CAPS, struct dmx_caps *caps)
 :name: DMX_GET_CAPS
 
 Arguments
@@ -25,7 +25,7 @@ Arguments
 File descriptor returned by :c:func:`open() `.
 
 ``caps``
-Undocumented.
+Pointer to struct :c:type:`dmx_caps`
 
 
 Description
@@ -33,7 +33,6 @@ Description
 
 .. note:: This ioctl is undocumented. Documentation is welcome.
 
-
 Return Value
 
 
diff --git a/Documentation/media/uapi/dvb/dmx-set-source.rst 
b/Documentation/media/uapi/dvb/dmx-set-source.rst
index a232fd6e5f52..ac7f77b25e06 100644
--- a/Documentation/media/uapi/dvb/dmx-set-source.rst
+++ b/Documentation/media/uapi/dvb/dmx-set-source.rst
@@ -15,7 +15,7 @@ DMX_SET_SOURCE
 Synopsis
 
 
-.. c:function:: int ioctl(fd, DMX_SET_SOURCE, dmx_source_t *src)
+.. c:function:: int ioctl(fd, DMX_SET_SOURCE, struct dmx_source *src)
 :name: DMX_SET_SOURCE
 
 
-- 
2.7.4


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


[PATCH 27/47] [media] docs-rst exceptions: use C domain references for DVB headers

2016-09-08 Thread Mauro Carvalho Chehab
Now that we moved away from the :ref: type of references,
we need to update the exceptions lists.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/audio.h.rst.exceptions |  6 +-
 Documentation/media/ca.h.rst.exceptions| 32 
 Documentation/media/dmx.h.rst.exceptions   | 85 +++---
 Documentation/media/frontend.h.rst.exceptions  |  8 +-
 Documentation/media/intro.rst  |  2 +-
 Documentation/media/net.h.rst.exceptions   |  4 +-
 .../uapi/dvb/audio-bilingual-channel-select.rst|  2 +-
 .../media/uapi/dvb/audio-channel-select.rst|  2 +-
 .../media/uapi/dvb/audio-select-source.rst |  2 +-
 .../media/uapi/dvb/audio-set-attributes.rst|  2 +-
 Documentation/media/uapi/dvb/audio-set-karaoke.rst |  2 +-
 Documentation/media/uapi/dvb/audio-set-mixer.rst   |  2 +-
 Documentation/media/uapi/dvb/audio_data_types.rst  | 31 +---
 Documentation/media/uapi/dvb/dmx_types.rst | 39 --
 Documentation/media/uapi/dvb/fe-bandwidth-t.rst|  5 +-
 .../media/uapi/dvb/fe-diseqc-recv-slave-reply.rst  |  3 -
 .../media/uapi/dvb/fe-diseqc-send-burst.rst|  9 +--
 .../media/uapi/dvb/fe-diseqc-send-master-cmd.rst   |  4 +-
 Documentation/media/uapi/dvb/fe-get-info.rst   | 11 +--
 Documentation/media/uapi/dvb/fe-read-status.rst|  8 +-
 Documentation/media/uapi/dvb/fe-set-tone.rst   |  9 +--
 Documentation/media/uapi/dvb/fe-set-voltage.rst|  4 +-
 Documentation/media/uapi/dvb/fe-type-t.rst |  4 +-
 .../media/uapi/dvb/fe_property_parameters.rst  | 69 ++
 Documentation/media/uapi/dvb/net-add-if.rst|  6 --
 Documentation/media/video.h.rst.exceptions | 20 ++---
 26 files changed, 144 insertions(+), 227 deletions(-)

diff --git a/Documentation/media/audio.h.rst.exceptions 
b/Documentation/media/audio.h.rst.exceptions
index 8330edcd906d..f40f3cbfe4c9 100644
--- a/Documentation/media/audio.h.rst.exceptions
+++ b/Documentation/media/audio.h.rst.exceptions
@@ -2,7 +2,7 @@
 ignore define _DVBAUDIO_H_
 
 # Typedef pointing to structs
-replace typedef audio_karaoke_t audio-karaoke
+replace typedef audio_karaoke_t :c:type:`audio_karaoke`
 
 # Undocumented audio caps, as this is a deprecated API anyway
 ignore define AUDIO_CAP_DTS
@@ -16,5 +16,5 @@ ignore define AUDIO_CAP_SDDS
 ignore define AUDIO_CAP_AC3
 
 # some typedefs should point to struct/enums
-replace typedef audio_mixer_t audio-mixer
-replace typedef audio_status_t audio-status
+replace typedef audio_mixer_t :c:type:`audio_mixer`
+replace typedef audio_status_t :c:type:`audio_status`
diff --git a/Documentation/media/ca.h.rst.exceptions 
b/Documentation/media/ca.h.rst.exceptions
index 09c13be67527..d7c9fed8c004 100644
--- a/Documentation/media/ca.h.rst.exceptions
+++ b/Documentation/media/ca.h.rst.exceptions
@@ -2,23 +2,23 @@
 ignore define _DVBCA_H_
 
 # struct ca_slot_info defines
-replace define CA_CI ca-slot-info
-replace define CA_CI_LINK ca-slot-info
-replace define CA_CI_PHYS ca-slot-info
-replace define CA_DESCR ca-slot-info
-replace define CA_SC ca-slot-info
-replace define CA_CI_MODULE_PRESENT ca-slot-info
-replace define CA_CI_MODULE_READY ca-slot-info
+replace define CA_CI :c:type:`ca_slot_info`
+replace define CA_CI_LINK :c:type:`ca_slot_info`
+replace define CA_CI_PHYS :c:type:`ca_slot_info`
+replace define CA_DESCR :c:type:`ca_slot_info`
+replace define CA_SC :c:type:`ca_slot_info`
+replace define CA_CI_MODULE_PRESENT :c:type:`ca_slot_info`
+replace define CA_CI_MODULE_READY :c:type:`ca_slot_info`
 
 # struct ca_descr_info defines
-replace define CA_ECD ca-descr-info
-replace define CA_NDS ca-descr-info
-replace define CA_DSS ca-descr-info
+replace define CA_ECD :c:type:`ca_descr_info`
+replace define CA_NDS :c:type:`ca_descr_info`
+replace define CA_DSS :c:type:`ca_descr_info`
 
 # some typedefs should point to struct/enums
-replace typedef ca_pid_t ca-pid
-replace typedef ca_slot_info_t ca-slot-info
-replace typedef ca_descr_info_t ca-descr-info
-replace typedef ca_caps_t ca-caps
-replace typedef ca_msg_t ca-msg
-replace typedef ca_descr_t ca-descr
+replace typedef ca_pid_t :c:type:`ca_pid`
+replace typedef ca_slot_info_t :c:type:`ca_slot_info`
+replace typedef ca_descr_info_t :c:type:`ca_descr_info`
+replace typedef ca_caps_t :c:type:`ca_caps`
+replace typedef ca_msg_t :c:type:`ca_msg`
+replace typedef ca_descr_t :c:type:`ca_descr`
diff --git a/Documentation/media/dmx.h.rst.exceptions 
b/Documentation/media/dmx.h.rst.exceptions
index 8200653839d2..2fdb458564ba 100644
--- a/Documentation/media/dmx.h.rst.exceptions
+++ b/Documentation/media/dmx.h.rst.exceptions
@@ -4,29 +4,29 @@ ignore define _UAPI_DVBDMX_H_
 # Ignore limit constants
 ignore define DMX_FILTER_SIZE
 
-# dmx-pes-type-t enum symbols
-replace enum dmx_ts_pes dmx-pes-type-t
-replace symbol DMX_PES_AUDIO0 dmx-pes-type-t
-replace symbol DMX_PES_VIDEO0 dmx-pes-type-t
-replace symbol DMX_PES_TELETEXT0 dmx-pes-ty

[PATCH 03/47] docs-rst: parse-headers.pl: use the C domain for cross-references

2016-09-08 Thread Mauro Carvalho Chehab
Instead of keep using the normal reference, move to the C
domain ones. Using C domains everywhere will allow
cross-references between kAPI and uAPI docs.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/sphinx/parse-headers.pl | 113 ++
 1 file changed, 59 insertions(+), 54 deletions(-)

diff --git a/Documentation/sphinx/parse-headers.pl 
b/Documentation/sphinx/parse-headers.pl
index 531c710fc73f..db0186a7618f 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -57,7 +57,7 @@ while () {
$n =~ tr/A-Z/a-z/;
$n =~ tr/_/-/;
 
-   $enum_symbols{$s} = $n;
+   $enum_symbols{$s} =  "\\ :ref:`$s <$n>`\\ ";
 
$is_enum = 0 if ($is_enum && m/\}/);
next;
@@ -69,7 +69,7 @@ while () {
my $n = $1;
$n =~ tr/A-Z/a-z/;
 
-   $ioctls{$s} = $n;
+   $ioctls{$s} = "\\ :ref:`$s <$n>`\\ ";
next;
}
 
@@ -79,17 +79,15 @@ while () {
$n =~ tr/A-Z/a-z/;
$n =~ tr/_/-/;
 
-   $defines{$s} = $n;
+   $defines{$s} = "\\ :ref:`$s <$n>`\\ ";
next;
}
 
-   if ($ln =~ m/^\s*typedef\s+.*\s+([_\w][\w\d_]+);/) {
-   my $s = $1;
-   my $n = $1;
-   $n =~ tr/A-Z/a-z/;
-   $n =~ tr/_/-/;
+   if ($ln =~ m/^\s*typedef\s+([_\w][\w\d_]+)\s+(.*)\s+([_\w][\w\d_]+);/) {
+   my $s = $2;
+   my $n = $3;
 
-   $typedefs{$s} = $n;
+   $typedefs{$n} = "\\ :c:type:`$n <$s>`\\ ";
next;
}
if ($ln =~ m/^\s*enum\s+([_\w][\w\d_]+)\s+\{/
@@ -97,11 +95,8 @@ while () {
|| $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)\s+\{/
|| $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)$/) {
my $s = $1;
-   my $n = $1;
-   $n =~ tr/A-Z/a-z/;
-   $n =~ tr/_/-/;
 
-   $enums{$s} = $n;
+   $enums{$s} =  "enum :c:type:`$s`\\ ";
 
$is_enum = $1;
next;
@@ -112,11 +107,8 @@ while () {
|| $ln =~ m/^\s*typedef\s*struct\s+([[_\w][\w\d_]+)$/
) {
my $s = $1;
-   my $n = $1;
-   $n =~ tr/A-Z/a-z/;
-   $n =~ tr/_/-/;
 
-   $structs{$s} = $n;
+   $structs{$s} = "struct :c:type:`$s`\\ ";
next;
}
 }
@@ -129,12 +121,9 @@ close IN;
 my @matches = ($data =~ m/typedef\s+struct\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,
   $data =~ m/typedef\s+enum\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,);
 foreach my $m (@matches) {
-   my $s = $m;
-   my $n = $m;
-   $n =~ tr/A-Z/a-z/;
-   $n =~ tr/_/-/;
+   my $s = $m;
 
-   $typedefs{$s} = $n;
+   $typedefs{$s} = "\\ :c:type:`$s`\\ ";
next;
 }
 
@@ -142,6 +131,15 @@ foreach my $m (@matches) {
 # Handle exceptions, if any
 #
 
+my %def_reftype = (
+   "ioctl"   => ":ref",
+   "define"  => ":ref",
+   "symbol"  => ":ref",
+   "typedef" => ":c:type",
+   "enum"=> ":c:type",
+   "struct"  => ":c:type",
+);
+
 if ($file_exceptions) {
open IN, $file_exceptions or die "Can't read $file_exceptions";
while () {
@@ -175,29 +173,49 @@ if ($file_exceptions) {
}
 
# Parsers to replace a symbol
+   my ($type, $old, $new, $reftype);
 
-   if (m/^replace\s+ioctl\s+(\S+)\s+(\S+)/) {
-   $ioctls{$1} = $2 if (exists($ioctls{$1}));
+   if (m/^replace\s+(\S+)\s+(\S+)\s+(\S+)/) {
+   $type = $1;
+   $old = $2;
+   $new = $3;
+   } else {
+   die "Can't parse $file_exceptions: $_";
+   }
+
+   if ($new =~ m/^\:c\:(data|func|macro|type)\:\`(.+)\`/) {
+   $reftype = ":c:$1";
+   $new = $2;
+   } elsif ($new =~ m/\:ref\:\`(.+)\`/) {
+   $reftype = ":ref";
+   $new = $1;
+   } else {
+   $reftype = $def_reftype{$type};
+   }
+   $new = "$reftype:`$old <$new>`";
+
+   if ($type eq "ioctl") {
+   $ioctls{$old} = $new if (exists($ioctls{$old}));
next;
}
-   if (m/^replace\s+define\s+(\S+)\s+(\S+)/) {
-   $defines{$1} = $2 if (exists($defines{$1}));
+   if ($type eq "define") {
+   $defines{$old} = $new if (exists($defines{$old}));
next;
}
-   if (m/^replace\s+typedef\s+(\S+)\s+(\S+)/) {
-   $typedefs{$1} = $2 if (exists(

[PATCH 25/47] [media] v4l2-subdev.rst: get rid of legacy functions

2016-09-08 Thread Mauro Carvalho Chehab
There are two warnings that are due to functions that has long
gone:

Documentation/media/kapi/v4l2-subdev.rst:417: WARNING: c:func reference 
target not found: v4l2_i2c_new_subdev_cfg
Documentation/media/kapi/v4l2-subdev.rst:436: WARNING: c:func reference 
target not found: v4l2_i2c_new_probed_subdev

Update the documentation to remove those.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/kapi/v4l2-subdev.rst | 21 +
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/Documentation/media/kapi/v4l2-subdev.rst 
b/Documentation/media/kapi/v4l2-subdev.rst
index fcecce01a35c..e1f0b726e438 100644
--- a/Documentation/media/kapi/v4l2-subdev.rst
+++ b/Documentation/media/kapi/v4l2-subdev.rst
@@ -412,19 +412,7 @@ later date. It differs between i2c drivers and as such can 
be confusing.
 To see which chip variants are supported you can look in the i2c driver code
 for the i2c_device_id table. This lists all the possibilities.
 
-There are two more helper functions:
-
-:c:func:`v4l2_i2c_new_subdev_cfg`: this function adds new irq and
-platform_data arguments and has both 'addr' and 'probed_addrs' arguments:
-if addr is not 0 then that will be used (non-probing variant), otherwise the
-probed_addrs are probed.
-
-For example: this will probe for address 0x10:
-
-.. code-block:: c
-
-   struct v4l2_subdev *sd = v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter,
- "module_foo", "chipid", 0, NULL, 0, I2C_ADDRS(0x10));
+There are one more helper function:
 
 :c:func:`v4l2_i2c_new_subdev_board` uses an :c:type:`i2c_board_info` struct
 which is passed to the i2c driver and replaces the irq, platform_data and addr
@@ -433,9 +421,10 @@ arguments.
 If the subdev supports the s_config core ops, then that op is called with
 the irq and platform_data arguments after the subdev was setup.
 
-The older :c:func:`v4l2_i2c_new_subdev` and
-:c:func:`v4l2_i2c_new_probed_subdev` functions will call ``s_config`` as
-well, but with irq set to 0 and platform_data set to ``NULL``.
+The :c:func:`v4l2_i2c_new_subdev` function will call
+:c:func:`v4l2_i2c_new_subdev_board`, internally filling a
+:c:type:`i2c_board_info` structure using the ``client_type`` and the
+``addr`` to fill it.
 
 V4L2 sub-device functions and data structures
 -
-- 
2.7.4


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


[PATCH 00/47] Fix most of Sphinx warnings in nitpick mode

2016-09-08 Thread Mauro Carvalho Chehab
Before this patch series, there is ~400 warnings when building docs in nitpick 
mode.
That means ~400 broken links.

This patch series move the C references to use Sphinx C domain, instead of 
using :ref:, add more documentation to some V4L2 headers and fix several broken
links. After this series, only 21 errors remain, and they all seem to be due to 
the
lack of documentation that should be there:


 make cleandocs; make DOCBOOKS="" SPHINXOPTS="-j5" SPHINXDIRS=media 
SPHINX_CONF="conf_nitpick.py" htmldocs

./include/media/media-entity.h:1053: warning: No description found for 
parameter '...'
/devel/v4l/patchwork/Documentation/media/kapi/mc-core.rst:97: WARNING: c:func 
reference target not found: media_devnode_release
/devel/v4l/patchwork/Documentation/media/kapi/v4l2-dev.rst:166: WARNING: c:func 
reference target not found: vb2_ops_wait_prepare
/devel/v4l/patchwork/Documentation/media/kapi/v4l2-dev.rst:166: WARNING: c:func 
reference target not found: vb2_ops_wait_finish
/devel/v4l/patchwork/Documentation/media/kapi/v4l2-fh.rst:56: WARNING: c:type 
reference target not found: v4l2_m2m_ctx
./include/media/v4l2-flash-led-class.h:103: WARNING: c:type reference target 
not found: v4l2_flash_ops
./include/media/v4l2-mem2mem.h:25: WARNING: c:func reference target not found: 
v4l2_m2m_job_finish
./include/media/v4l2-mem2mem.h:36: WARNING: c:func reference target not found: 
v4l2_m2m_job_finish
./include/media/v4l2-mem2mem.h:168: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-mem2mem.h:180: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-mem2mem.h:194: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-mem2mem.h:205: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-mem2mem.h:216: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-mem2mem.h:227: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-mem2mem.h:240: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-mem2mem.h:251: WARNING: c:type reference target not found: 
v4l2_m2m_ctx
./include/media/v4l2-subdev.h:424: WARNING: c:type reference target not found: 
v4l2_sliced_vbi_line
./include/media/v4l2-subdev.h:768: WARNING: c:type reference target not found: 
v4l2_dev
./include/media/videobuf2-core.h:349: WARNING: c:func reference target not 
found: vb2_wait_for_all_buffers
./include/media/videobuf2-core.h:355: WARNING: c:func reference target not 
found: vb2_buffer_done
./include/media/videobuf2-core.h:442: WARNING: c:func reference target not 
found: start_streaming
./include/media/videobuf2-core.h:592: WARNING: c:type reference target not 
found: vb2_thread_fnc

So, it seems to fix the issue of identifying the documentation gaps via nitpick 
mode.

Please notice that the first patch were already submitted, and Markus proposed 
to
fix it via the C domain override extension.

Yet, as it reduces 20 bogus warnings, I'm keeping in this series for the ones
that may want to test this patchset.

As usual, I'm placing those patches on my development tree:

https://git.linuxtv.org//mchehab/experimental.git/log/?h=docs-next

git//linuxtv.org/mchehab/experimental.git docs-next

Jon,

Please notice that patches 2 and 3 touches at 
Documentation/sphinx/parse-headers.pl.

If it is ok for you, I intend to merge those patches (except for patch 1)
on my tree, including the two patches that touch at the parse-headers.pl
script, as, currently, the only user for it is media. I'm also OK if you prefer
to merge patches 2 and 3 on your tree instead.

Regards,
Mauro

Mauro Carvalho Chehab (47):
  kernel-doc: ignore arguments on macro definitions
  docs-rst: parse-headers.pl: make debug a command line option
  docs-rst: parse-headers.pl: use the C domain for cross-references
  [media] conf_nitpick.py: add external vars to ignore list
  [media] dvb_ringbuffer.h: Document all functions
  [media] dtv-core.rst: move DTV ringbuffer notes to kAPI doc
  [media] dvb_ringbuffer.h: document the define macros
  [media] demux.h: Fix a few documentation issues
  [media] mc-core.rst: Fix cross-references to the source
  [media] demux.h: fix a documentation warning
  [media] docs-rst: improve the kAPI documentation for the mediactl
  [media] conf_nitpick.py: ignore external functions used on mediactl
  [media] rc-map.h: document structs/enums on it
  [media] v4l2-ctrls: document some extra data structures
  [media] docs-rst: convert uAPI structs to C domain
  [media] diff-v4l.rst: Fix V4L version 1 references
  [media] v4l2-ctrls.h: fix doc reference for prepare_ext_ctrls()
  [media] docs-rst: use C domain for enum references on uapi
  [media] v4l2-ctrls.h: Fix some c:type references
  [media] cec-ioc-dqevent.rst: fix some undefined references
  [media] v4l2-ioctl.h: document the remaining functions
  [media] v4l2-dev.rst: fix a broken c domain reference
  [media] v4l2-device.h: fix some do

[PATCH 38/47] [media] docs-rst: fix some broken struct references

2016-09-08 Thread Mauro Carvalho Chehab
The :c:type: references point to the structure name, and not to
struct foo.

Fixed via this shell script:

for i in `find Documentation/media -type f`; do perl -ne 'if 
(s/\:c\:type\:\`struct\s*(\S+)\`/struct :c:type:`$1`/) { 
s/struct\s+struct/struct/;  s/(struct\s+\:c\:type\:\`\S+\`)\s+structure/$1/;  } 
print $_' <$i >a && mv a $i; done

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/uapi/cec/cec-func-poll.rst |  2 +-
 Documentation/media/uapi/v4l/buffer.rst|  2 +-
 Documentation/media/uapi/v4l/dev-osd.rst   |  4 +--
 Documentation/media/uapi/v4l/hist-v4l2.rst | 34 +-
 4 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/Documentation/media/uapi/cec/cec-func-poll.rst 
b/Documentation/media/uapi/cec/cec-func-poll.rst
index 5bacb7c6f33b..cfb73e6027a5 100644
--- a/Documentation/media/uapi/cec/cec-func-poll.rst
+++ b/Documentation/media/uapi/cec/cec-func-poll.rst
@@ -49,7 +49,7 @@ events.
 
 On success :c:func:`poll()` returns the number of file descriptors
 that have been selected (that is, file descriptors for which the
-``revents`` field of the respective :c:type:`struct pollfd` structure
+``revents`` field of the respective struct :c:type:`pollfd`
 is non-zero). CEC devices set the ``POLLIN`` and ``POLLRDNORM`` flags in
 the ``revents`` field if there are messages in the receive queue. If the
 transmit queue has room for new messages, the ``POLLOUT`` and
diff --git a/Documentation/media/uapi/v4l/buffer.rst 
b/Documentation/media/uapi/v4l/buffer.rst
index 7b64a1986d66..7d2d81a771b1 100644
--- a/Documentation/media/uapi/v4l/buffer.rst
+++ b/Documentation/media/uapi/v4l/buffer.rst
@@ -825,7 +825,7 @@ Timecodes
 
 The struct :c:type:`v4l2_timecode` structure is designed to hold a
 :ref:`smpte12m` or similar timecode. (struct
-:c:type:`struct timeval` timestamps are stored in struct
+struct :c:type:`timeval` timestamps are stored in struct
 :c:type:`v4l2_buffer` field ``timestamp``.)
 
 
diff --git a/Documentation/media/uapi/v4l/dev-osd.rst 
b/Documentation/media/uapi/v4l/dev-osd.rst
index 0b246c31b6a3..71da85ed7e4b 100644
--- a/Documentation/media/uapi/v4l/dev-osd.rst
+++ b/Documentation/media/uapi/v4l/dev-osd.rst
@@ -44,8 +44,8 @@ other information, the physical address of the framebuffer in 
the
 ``base`` field of struct :c:type:`v4l2_framebuffer`.
 The framebuffer device ioctl ``FBIOGET_FSCREENINFO`` returns the same
 address in the ``smem_start`` field of struct
-:c:type:`struct fb_fix_screeninfo`. The ``FBIOGET_FSCREENINFO``
-ioctl and struct :c:type:`struct fb_fix_screeninfo` are defined in
+struct :c:type:`fb_fix_screeninfo`. The ``FBIOGET_FSCREENINFO``
+ioctl and struct :c:type:`fb_fix_screeninfo` are defined in
 the ``linux/fb.h`` header file.
 
 The width and height of the framebuffer depends on the current video
diff --git a/Documentation/media/uapi/v4l/hist-v4l2.rst 
b/Documentation/media/uapi/v4l/hist-v4l2.rst
index bd45431ed00e..b18fb7e6c39a 100644
--- a/Documentation/media/uapi/v4l/hist-v4l2.rst
+++ b/Documentation/media/uapi/v4l/hist-v4l2.rst
@@ -37,7 +37,7 @@ transmission arguments.
 enumerable.
 
 1998-10-02: The ``id`` field was removed from struct
-:c:type:`struct video_standard` and the color subcarrier fields were
+struct :c:type:`video_standard` and the color subcarrier fields were
 renamed. The :ref:`VIDIOC_QUERYSTD` ioctl was
 renamed to :ref:`VIDIOC_ENUMSTD`,
 :ref:`VIDIOC_G_INPUT ` to
@@ -151,7 +151,7 @@ common Linux driver API conventions.
This change obsoletes the following ioctls: ``VIDIOC_S_INFMT``,
``VIDIOC_G_INFMT``, ``VIDIOC_S_OUTFMT``, ``VIDIOC_G_OUTFMT``,
``VIDIOC_S_VBIFMT`` and ``VIDIOC_G_VBIFMT``. The image format
-   structure :c:type:`struct v4l2_format` was renamed to struct
+   structure struct :c:type:`v4l2_format` was renamed to struct
:c:type:`v4l2_pix_format`, while struct
:c:type:`v4l2_format` is now the envelopping structure
for all format negotiations.
@@ -254,7 +254,7 @@ multiple tuners into account.)
 2000-09-18: ``V4L2_BUF_TYPE_VBI`` was added. This may *break
 compatibility* as the :ref:`VIDIOC_G_FMT ` and
 :ref:`VIDIOC_S_FMT ` ioctls may fail now if the struct
-:c:type:`struct v4l2_fmt` ``type`` field does not contain
+struct :c:type:`v4l2_fmt` ``type`` field does not contain
 ``V4L2_BUF_TYPE_VBI``. In the documentation of the struct
 :c:type:`v4l2_vbi_format` ``offset`` field the
 ambiguous phrase "rising edge" was changed to "leading edge".
@@ -415,7 +415,7 @@ This unnamed version was finally merged into Linux 2.5.46.
 originally needed to distguish between variations of standards, were
 removed.
 
-Struct :c:type:`struct v4l2_enumstd` ceased to be.
+Struct struct :c:type:`v4l2_enumstd` ceased to be.
 :ref:`VIDIOC_ENUMSTD` now takes a pointer to a
 struct :c:type:`v4l2_standard` directly. The
 information which standards are supported by a particular video
@@ -636,7 +636,7 @@ This unnamed version was finally merged into Linux 

Re: [PATCH 00/47] Fix most of Sphinx warnings in nitpick mode

2016-09-08 Thread Jonathan Corbet
On Thu,  8 Sep 2016 09:03:22 -0300
Mauro Carvalho Chehab  wrote:

> Please notice that patches 2 and 3 touches at 
> Documentation/sphinx/parse-headers.pl.
> 
> If it is ok for you, I intend to merge those patches (except for patch 1)
> on my tree, including the two patches that touch at the parse-headers.pl
> script, as, currently, the only user for it is media. I'm also OK if you 
> prefer
> to merge patches 2 and 3 on your tree instead.

Go ahead and keep them with the rest.

Acked-by: Jonathan Corbet 

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


Re: [PATCH 22/47] [media] v4l2-dev.rst: fix a broken c domain reference

2016-09-08 Thread Laurent Pinchart
Hi Mauro,

Thank you for the patch.

On Thursday 08 Sep 2016 09:03:44 Mauro Carvalho Chehab wrote:
> The "struct" were inside the reference, causing it to break.
> 
> Signed-off-by: Mauro Carvalho Chehab 

Acked-by: Laurent Pinchart 

> ---
>  Documentation/media/kapi/v4l2-dev.rst | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/media/kapi/v4l2-dev.rst
> b/Documentation/media/kapi/v4l2-dev.rst index 5782be725334..0a3b4503a89f
> 100644
> --- a/Documentation/media/kapi/v4l2-dev.rst
> +++ b/Documentation/media/kapi/v4l2-dev.rst
> 
> @@ -56,7 +56,7 @@ You should also set these fields of 
:c:type:`video_device`:
>:c:type:`video_device`->vfl_dir fields are used to disable ops that do
>:not
> 
>match the type/dir combination. E.g. VBI ops are disabled for non-VBI
> nodes, and output ops  are disabled for a capture device. This makes it
> possible to -  provide just one :c:type:`v4l2_ioctl_ops struct` for both
> vbi and +  provide just one :c:type:`v4l2_ioctl_ops` struct for both vbi
> and video nodes.
> 
>  - :c:type:`video_device`->lock: leave to ``NULL`` if you want to do all the

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH v6 2/4] drm: Add API for capturing frame CRCs

2016-09-08 Thread Emil Velikov
Hi Tomeu,

A couple of small nitpicks and a rather nasty looking bug, related to
your earlier question.

On 7 September 2016 at 11:27, Tomeu Vizoso  wrote:

> +static ssize_t crc_control_write(struct file *file, const char __user *ubuf,
> +size_t len, loff_t *offp)
> +{

> +   if (source[len] == '\n')
> +   source[len] = '\0';
> +
Considering the bug below, I'm considering if there's a case were we
don't want to explicitly set the terminating byte ?


> +/*
> + * 1 frame field of 10 chars plus a number of CRC fields of 10 chars each, 
> space
> + * separated, with a newline at the end and null-terminated.
> + */
NULL-terminated what the things that was missing, explaining the
maths. Yet note the code sort of contradicts it.

TL;DR: above we conditionally NULL terminate the data, yet (below) we
feed garbage (always) instead of \0 byte.

> +#define LINE_LEN(values_cnt)   (10 + 11 * values_cnt + 1 + 1)
> +#define MAX_LINE_LEN   (LINE_LEN(DRM_MAX_CRC_NR))
> +
> +static ssize_t crtc_crc_read(struct file *filep, char __user *user_buf,
> +size_t count, loff_t *pos)
> +{
> +   struct drm_crtc *crtc = filep->f_inode->i_private;
> +   struct drm_crtc_crc *crc = &crtc->crc;
> +   struct drm_crtc_crc_entry *entry;
> +   char buf[MAX_LINE_LEN];
Here buf is filled with garbage...


> +   if (entry->has_frame_counter)
> +   sprintf(buf, "0x%08x", entry->frame);
> +   else
> +   sprintf(buf, "XX");
> +
> +   for (i = 0; i < crc->values_cnt; i++)
> +   sprintf(buf + 10 + i * 11, " 0x%08x", entry->crcs[i]);
> +   sprintf(buf + 10 + crc->values_cnt * 11, "\n");
> +
... and now all the data is in, incl. the \n byte.

> +   if (copy_to_user(user_buf, buf, LINE_LEN(crc->values_cnt)))
And here we copy the whole thing incl. the 'should be \0 but is
actually garbage' byte.

This doesn't look good :-\

> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c

> @@ -221,6 +222,14 @@ static int drm_minor_register(struct drm_device *dev, 
> unsigned int type)
> return ret;
> }
>
> +   if (type == DRM_MINOR_PRIMARY) {
> +   drm_for_each_crtc(crtc, dev) {
> +   ret = drm_debugfs_crtc_add(crtc);
> +   if (ret)
> +   DRM_ERROR("DRM: Failed to initialize CRC 
> debugfs.\n");
> +   }
> +   }
> +
Minor: We're missing teardown in the error path.


> --- /dev/null
> +++ b/include/drm/drm_debugfs_crc.h

> +static inline int drm_debugfs_crtc_crc_add(struct drm_crtc *crtc)
Minor: The function is internal only and used only when
defined(CONFIG_DEBUG_FS). Thus it should stay in
drivers/gpu/drm/foo.h.

Rule of thumb: include/drm defines the API used by the drivers, while
drivers/gpu/drm/foo_internal.h the internal API between the core DRM
modules.


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


Re: [RFC PATCH v2 07/20] x86: Provide general kernel support for memory encryption

2016-09-08 Thread Tom Lendacky
On 09/07/2016 10:55 AM, Borislav Petkov wrote:
> On Wed, Sep 07, 2016 at 09:30:54AM -0500, Tom Lendacky wrote:
>> _PAGE_ENC is #defined as sme_me_mask and sme_me_mask has already been
>> set (or not set) at this point - so it will be the mask if SME is
>> active or 0 if SME is not active.
> 
> Yeah, I remember :-)
> 
>> sme_early_init() is merely propagating the mask to other structures.
>> Since early_pmd_flags is mainly used in this file (one line in
>> head_64.S is the other place) I felt it best to modify it here. But it
>> can always be moved if you feel that is best.
> 
> Hmm, so would it work then if you stick it in early_pmd_flags'
> definition like you do with the other masks? I.e.,
> 
> pmdval_t early_pmd_flags = __PAGE_KERNEL_LARGE | _PAGE_ENC & ~(_PAGE_GLOBAL | 
> _PAGE_NX);

When does this value get initialized?  Since _PAGE_ENC is #defined to
sme_me_mask, which is not set until the boot process begins, I'm afraid
we'd end up using the initial value of sme_me_mask, which is zero.  Do
I have that right?

Thanks,
Tom

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


Re: [Intel-gfx] [PATCH v6 0/4] New debugfs API for capturing CRC of frames

2016-09-08 Thread Emil Velikov
On 7 September 2016 at 11:27, Tomeu Vizoso  wrote:
> Hi,
>
> this series basically takes the facility for continuously capturing CRCs
> of frames from the i915 driver and into the DRM core.
>
> The idea is that test suites such as IGT use this information to check
> that frames that are exected to be identical, also have identical CRC
> values.
>
> Other drivers for hardware that can provide frame CRCs (including eDP
> panels that support self-refresh) can easily implement the new callback
> and provide userspace with the CRC values.
>
> Thanks,
>
> Tomeu
>
> Tomeu Vizoso (4):
>   drm/i915/debugfs: Move out pipe CRC code
>   drm: Add API for capturing frame CRCs
>   drm/i915: Use new CRC debugfs API
>   drm/i915: Put "cooked" vlank counters in frame CRC lines
>
Thanks for the nice work and addressing my suggestions Tomeu. I think
I've spotted a bug in 2/4, plus there's a couple of trivial nitpicks
in 2/4 and 3/4 - either of which can be fixed as a follow up (if I
haven't lost it of course).

With the bug trivially fixed the series is:
Reviewed-by: Emil Velikov 

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


Re: [RFC PATCH v2 07/20] x86: Provide general kernel support for memory encryption

2016-09-08 Thread Borislav Petkov
On Thu, Sep 08, 2016 at 08:26:27AM -0500, Tom Lendacky wrote:
> When does this value get initialized?  Since _PAGE_ENC is #defined to
> sme_me_mask, which is not set until the boot process begins, I'm afraid
> we'd end up using the initial value of sme_me_mask, which is zero.  Do
> I have that right?

Hmm, but then that would hold true for all the other defines where you
OR-in _PAGE_ENC, no?

In any case, the preprocessed source looks like this:

pmdval_t early_pmd_flags = (((pteval_t)(1)) << 0) | (((pteval_t)(1)) << 1) 
| (((pteval_t)(1)) << 6) | (((pteval_t)(1)) << 5) | (((pteval_t)(1)) << 8)) | 
(((pteval_t)(1)) << 63)) | (((pteval_t)(1)) << 7)) | sme_me_mask) & 
~pteval_t)(1)) << 8) | (((pteval_t)(1)) << 63));

but the problem is later, when building:

arch/x86/kernel/head64.c:39:28: error: initializer element is not constant
 pmdval_t early_pmd_flags = (__PAGE_KERNEL_LARGE | _PAGE_ENC) & ~(_PAGE_GLOBAL 
| _PAGE_NX);
^
scripts/Makefile.build:153: recipe for target 'arch/x86/kernel/head64.s' failed

so I guess not. :-\

Ok, then at least please put the early_pmd_flags init after
sme_early_init() along with a small comment explaning what happens.

Thanks.

-- 
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" 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] docs-rst: ignore arguments on macro definitions

2016-09-08 Thread Markus Heiser

Am 08.09.2016 um 13:40 schrieb Mauro Carvalho Chehab :

> Hi Jon/Markus,
> 
> Em Mon, 29 Aug 2016 16:12:39 +0200
> Markus Heiser  escreveu:
> 
>> Am 29.08.2016 um 15:13 schrieb Mauro Carvalho Chehab 
>> :
>> 
>>> A macro definition is mapped via .. c:function:: at the
>>> ReST markup when using the following kernel-doc tag:
>>> 
>>> /**
>>>  * DMX_FE_ENTRY - Casts elements in the list of registered
>>>  *   front-ends from the generic type struct list_head
>>>  *   to the type * struct dmx_frontend
>>>  *
>>>  * @list: list of struct dmx_frontend
>>>  */
>>>  #define DMX_FE_ENTRY(list) \
>>> list_entry(list, struct dmx_frontend, connectivity_list)
>>> 
>>> However, unlike a function description, the arguments of a macro
>>> doesn't contain the data type.
>>> 
>>> This causes warnings when enabling Sphinx on nitkpick mode,
>>> like this one:
>>> ./drivers/media/dvb-core/demux.h:358: WARNING: c:type reference target 
>>> not found: list  
>> 
>> I think this is a drawback of sphinx's C-domain, using function
>> definition for macros also. From the function documentation
>> 
>> """This is also used to describe function-like preprocessor
>>macros. The names of the arguments should be given so
>>they may be used in the description."""
>> 
>> I think about to fix the nitpick message for macros (aka function
>> directive) in the C-domain extension (we already have).
>> 
>> But for this, I need a rule to distinguish between macros
>> and functions ... is the uppercase of the macro name a good
>> rule to suppress the nitpick message? Any other suggestions?
> 
> What's the status of the C domain patches meant to fix this issue?
> 
> I managed to fix most warnings on media documents on nitpick mode.
> With this patch applied, there are only 21 warnings (and all are
> due to the lack of function or struct documentation). I'm about
> to patchbomb such fixup series.
> 
> Yet, without  this patch, and latest docs-next, there are 20 extra
> bogus warnings, due to function parameters:
> 
> ./drivers/media/dvb-core/dvb_ringbuffer.h:121: WARNING: c:type reference 
> target not found: rbuf
> ./drivers/media/dvb-core/dvb_ringbuffer.h:121: WARNING: c:type reference 
> target not found: offs
> ./drivers/media/dvb-core/dvb_ringbuffer.h:130: WARNING: c:type reference 
> target not found: rbuf
> ./drivers/media/dvb-core/dvb_ringbuffer.h:130: WARNING: c:type reference 
> target not found: num
> ./drivers/media/dvb-core/dvb_ringbuffer.h:173: WARNING: c:type reference 
> target not found: rbuf
> ./drivers/media/dvb-core/dvb_ringbuffer.h:173: WARNING: c:type reference 
> target not found: byte
> ./drivers/media/dvb-core/demux.h:358: WARNING: c:type reference target not 
> found: list
> ./include/media/media-device.h:263: WARNING: c:type reference target not 
> found: mdev
> ./include/media/media-device.h:495: WARNING: c:type reference target not 
> found: mdev
> ./include/media/media-device.h:495: WARNING: c:type reference target not 
> found: udev
> ./include/media/media-device.h:495: WARNING: c:type reference target not 
> found: name
> ./include/media/media-entity.h:527: WARNING: c:type reference target not 
> found: gobj
> ./include/media/media-entity.h:536: WARNING: c:type reference target not 
> found: gobj
> ./include/media/media-entity.h:545: WARNING: c:type reference target not 
> found: gobj
> ./include/media/media-entity.h:554: WARNING: c:type reference target not 
> found: gobj
> ./include/media/media-entity.h:563: WARNING: c:type reference target not 
> found: intf
> ./include/media/media-entity.h:1041: WARNING: c:type reference target not 
> found: entity
> ./include/media/media-entity.h:1041: WARNING: c:type reference target not 
> found: operation
> ./include/media/v4l2-ctrls.h:397: WARNING: c:type reference target not found: 
> hdl
> ./include/media/v4l2-ctrls.h:397: WARNING: c:type reference target not found: 
> nr_of_controls_hint
> 
> So, it would be great if we could either merge this patch or the ones that
> Markus did (assuming they're ready for merge).

I fixed the remarks of Jon and resend v2 yesterday ...

https://www.mail-archive.com/linux-media@vger.kernel.org/msg102259.html

sorry, I'am currently in a hurry, may do you like to test the
patch, to see if we get rid of those 20 extra bogus warnings?

Thanks!

-- Markus --


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


[PATCH v7 0/4] New debugfs API for capturing CRC of frames

2016-09-08 Thread Tomeu Vizoso
Hi,

this series basically takes the facility for continuously capturing CRCs
of frames from the i915 driver and into the DRM core.

The idea is that test suites such as IGT use this information to check
that frames that are exected to be identical, also have identical CRC
values.

Other drivers for hardware that can provide frame CRCs (including eDP
panels that support self-refresh) can easily implement the new callback
and provide userspace with the CRC values.

Thanks,

Tomeu

Tomeu Vizoso (4):
  drm/i915/debugfs: Move out pipe CRC code
  drm: Add API for capturing frame CRCs
  drm/i915: Use new CRC debugfs API
  drm/i915: Put "cooked" vlank counters in frame CRC lines

 Documentation/gpu/drm-uapi.rst|6 +
 drivers/gpu/drm/Makefile  |3 +-
 drivers/gpu/drm/drm_crtc.c|   29 +-
 drivers/gpu/drm/drm_debugfs.c |   34 +-
 drivers/gpu/drm/drm_debugfs_crc.c |  351 
 drivers/gpu/drm/drm_drv.c |   15 +
 drivers/gpu/drm/drm_internal.h|   16 +
 drivers/gpu/drm/i915/Makefile |2 +-
 drivers/gpu/drm/i915/i915_debugfs.c   |  886 +---
 drivers/gpu/drm/i915/i915_drv.c   |2 +-
 drivers/gpu/drm/i915/i915_drv.h   |3 +-
 drivers/gpu/drm/i915/i915_irq.c   |   83 ++-
 drivers/gpu/drm/i915/intel_display.c  |1 +
 drivers/gpu/drm/i915/intel_drv.h  |7 +
 drivers/gpu/drm/i915/intel_pipe_crc.c | 1014 +
 include/drm/drm_crtc.h|   41 ++
 include/drm/drm_debugfs_crc.h |   73 +++
 17 files changed, 1652 insertions(+), 914 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_debugfs_crc.c
 create mode 100644 drivers/gpu/drm/i915/intel_pipe_crc.c
 create mode 100644 include/drm/drm_debugfs_crc.h

-- 
2.7.4

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


Re: [PATCH v6 2/4] drm: Add API for capturing frame CRCs

2016-09-08 Thread Tomeu Vizoso
On 8 September 2016 at 15:24, Emil Velikov  wrote:
> Hi Tomeu,
>
> A couple of small nitpicks and a rather nasty looking bug, related to
> your earlier question.
>
> On 7 September 2016 at 11:27, Tomeu Vizoso  wrote:
>
>> +static ssize_t crc_control_write(struct file *file, const char __user *ubuf,
>> +size_t len, loff_t *offp)
>> +{
>
>> +   if (source[len] == '\n')
>> +   source[len] = '\0';
>> +
> Considering the bug below, I'm considering if there's a case were we
> don't want to explicitly set the terminating byte ?
>
>
>> +/*
>> + * 1 frame field of 10 chars plus a number of CRC fields of 10 chars each, 
>> space
>> + * separated, with a newline at the end and null-terminated.
>> + */
> NULL-terminated what the things that was missing, explaining the
> maths. Yet note the code sort of contradicts it.
>
> TL;DR: above we conditionally NULL terminate the data, yet (below) we
> feed garbage (always) instead of \0 byte.
>
>> +#define LINE_LEN(values_cnt)   (10 + 11 * values_cnt + 1 + 1)
>> +#define MAX_LINE_LEN   (LINE_LEN(DRM_MAX_CRC_NR))
>> +
>> +static ssize_t crtc_crc_read(struct file *filep, char __user *user_buf,
>> +size_t count, loff_t *pos)
>> +{
>> +   struct drm_crtc *crtc = filep->f_inode->i_private;
>> +   struct drm_crtc_crc *crc = &crtc->crc;
>> +   struct drm_crtc_crc_entry *entry;
>> +   char buf[MAX_LINE_LEN];
> Here buf is filled with garbage...
>
>
>> +   if (entry->has_frame_counter)
>> +   sprintf(buf, "0x%08x", entry->frame);
>> +   else
>> +   sprintf(buf, "XX");
>> +
>> +   for (i = 0; i < crc->values_cnt; i++)
>> +   sprintf(buf + 10 + i * 11, " 0x%08x", entry->crcs[i]);
>> +   sprintf(buf + 10 + crc->values_cnt * 11, "\n");
>> +
> ... and now all the data is in, incl. the \n byte.
>
>> +   if (copy_to_user(user_buf, buf, LINE_LEN(crc->values_cnt)))
> And here we copy the whole thing incl. the 'should be \0 but is
> actually garbage' byte.

As discussed offline, sprintf does terminate the string for us, so I
think this is fine.

> This doesn't look good :-\
>
>> --- a/drivers/gpu/drm/drm_drv.c
>> +++ b/drivers/gpu/drm/drm_drv.c
>
>> @@ -221,6 +222,14 @@ static int drm_minor_register(struct drm_device *dev, 
>> unsigned int type)
>> return ret;
>> }
>>
>> +   if (type == DRM_MINOR_PRIMARY) {
>> +   drm_for_each_crtc(crtc, dev) {
>> +   ret = drm_debugfs_crtc_add(crtc);
>> +   if (ret)
>> +   DRM_ERROR("DRM: Failed to initialize CRC 
>> debugfs.\n");
>> +   }
>> +   }
>> +
> Minor: We're missing teardown in the error path.

Isn't drm_debugfs_cleanup taking care of it?

>
>> --- /dev/null
>> +++ b/include/drm/drm_debugfs_crc.h
>
>> +static inline int drm_debugfs_crtc_crc_add(struct drm_crtc *crtc)
> Minor: The function is internal only and used only when
> defined(CONFIG_DEBUG_FS). Thus it should stay in
> drivers/gpu/drm/foo.h.
>
> Rule of thumb: include/drm defines the API used by the drivers, while
> drivers/gpu/drm/foo_internal.h the internal API between the core DRM
> modules.

Good one.

Thanks!

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


Re: [PATCH 03/47] docs-rst: parse-headers.pl: use the C domain for cross-references

2016-09-08 Thread Markus Heiser
Hi 

BTW: porting parse-headers to python / get rid of media/Makefile

* https://www.mail-archive.com/linux-media@vger.kernel.org/msg101261.html

I think last relevant comment was from you Mauro:

* https://www.mail-archive.com/linux-media@vger.kernel.org/msg101426.html

should we continue this task? If yes what are the next steps, where can I help?

-- Markus --



Am 08.09.2016 um 14:03 schrieb Mauro Carvalho Chehab :

> Instead of keep using the normal reference, move to the C
> domain ones. Using C domains everywhere will allow
> cross-references between kAPI and uAPI docs.
> 
> Signed-off-by: Mauro Carvalho Chehab 
> ---
> Documentation/sphinx/parse-headers.pl | 113 ++
> 1 file changed, 59 insertions(+), 54 deletions(-)
> 
> diff --git a/Documentation/sphinx/parse-headers.pl 
> b/Documentation/sphinx/parse-headers.pl
> index 531c710fc73f..db0186a7618f 100755
> --- a/Documentation/sphinx/parse-headers.pl
> +++ b/Documentation/sphinx/parse-headers.pl
> @@ -57,7 +57,7 @@ while () {
>   $n =~ tr/A-Z/a-z/;
>   $n =~ tr/_/-/;
> 
> - $enum_symbols{$s} = $n;
> + $enum_symbols{$s} =  "\\ :ref:`$s <$n>`\\ ";
> 
>   $is_enum = 0 if ($is_enum && m/\}/);
>   next;
> @@ -69,7 +69,7 @@ while () {
>   my $n = $1;
>   $n =~ tr/A-Z/a-z/;
> 
> - $ioctls{$s} = $n;
> + $ioctls{$s} = "\\ :ref:`$s <$n>`\\ ";
>   next;
>   }
> 
> @@ -79,17 +79,15 @@ while () {
>   $n =~ tr/A-Z/a-z/;
>   $n =~ tr/_/-/;
> 
> - $defines{$s} = $n;
> + $defines{$s} = "\\ :ref:`$s <$n>`\\ ";
>   next;
>   }
> 
> - if ($ln =~ m/^\s*typedef\s+.*\s+([_\w][\w\d_]+);/) {
> - my $s = $1;
> - my $n = $1;
> - $n =~ tr/A-Z/a-z/;
> - $n =~ tr/_/-/;
> + if ($ln =~ m/^\s*typedef\s+([_\w][\w\d_]+)\s+(.*)\s+([_\w][\w\d_]+);/) {
> + my $s = $2;
> + my $n = $3;
> 
> - $typedefs{$s} = $n;
> + $typedefs{$n} = "\\ :c:type:`$n <$s>`\\ ";
>   next;
>   }
>   if ($ln =~ m/^\s*enum\s+([_\w][\w\d_]+)\s+\{/
> @@ -97,11 +95,8 @@ while () {
>   || $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)\s+\{/
>   || $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)$/) {
>   my $s = $1;
> - my $n = $1;
> - $n =~ tr/A-Z/a-z/;
> - $n =~ tr/_/-/;
> 
> - $enums{$s} = $n;
> + $enums{$s} =  "enum :c:type:`$s`\\ ";
> 
>   $is_enum = $1;
>   next;
> @@ -112,11 +107,8 @@ while () {
>   || $ln =~ m/^\s*typedef\s*struct\s+([[_\w][\w\d_]+)$/
>   ) {
>   my $s = $1;
> - my $n = $1;
> - $n =~ tr/A-Z/a-z/;
> - $n =~ tr/_/-/;
> 
> - $structs{$s} = $n;
> + $structs{$s} = "struct :c:type:`$s`\\ ";
>   next;
>   }
> }
> @@ -129,12 +121,9 @@ close IN;
> my @matches = ($data =~ m/typedef\s+struct\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,
>  $data =~ m/typedef\s+enum\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,);
> foreach my $m (@matches) {
> - my $s = $m;
> - my $n = $m;
> - $n =~ tr/A-Z/a-z/;
> - $n =~ tr/_/-/;
> + my $s = $m;
> 
> - $typedefs{$s} = $n;
> + $typedefs{$s} = "\\ :c:type:`$s`\\ ";
>   next;
> }
> 
> @@ -142,6 +131,15 @@ foreach my $m (@matches) {
> # Handle exceptions, if any
> #
> 
> +my %def_reftype = (
> + "ioctl"   => ":ref",
> + "define"  => ":ref",
> + "symbol"  => ":ref",
> + "typedef" => ":c:type",
> + "enum"=> ":c:type",
> + "struct"  => ":c:type",
> +);
> +
> if ($file_exceptions) {
>   open IN, $file_exceptions or die "Can't read $file_exceptions";
>   while () {
> @@ -175,29 +173,49 @@ if ($file_exceptions) {
>   }
> 
>   # Parsers to replace a symbol
> + my ($type, $old, $new, $reftype);
> 
> - if (m/^replace\s+ioctl\s+(\S+)\s+(\S+)/) {
> - $ioctls{$1} = $2 if (exists($ioctls{$1}));
> + if (m/^replace\s+(\S+)\s+(\S+)\s+(\S+)/) {
> + $type = $1;
> + $old = $2;
> + $new = $3;
> + } else {
> + die "Can't parse $file_exceptions: $_";
> + }
> +
> + if ($new =~ m/^\:c\:(data|func|macro|type)\:\`(.+)\`/) {
> + $reftype = ":c:$1";
> + $new = $2;
> + } elsif ($new =~ m/\:ref\:\`(.+)\`/) {
> + $reftype = ":ref";
> + $new = $1;
> + } else {
> + $reftype = $def_reftype{$type};
> + }
> + $new = "$reftype:`$old <$new>`";
> +
> + if ($type eq "ioctl") {
> + $ioctl

[PATCH v7 2/4] drm: Add API for capturing frame CRCs

2016-09-08 Thread Tomeu Vizoso
Adds files and directories to debugfs for controlling and reading frame
CRCs, per CRTC:

dri/0/crtc-0/crc
dri/0/crtc-0/crc/control
dri/0/crtc-0/crc/data

Drivers can implement the set_crc_source callback() in drm_crtc_funcs to
start and stop generating frame CRCs and can add entries to the output
by calling drm_crtc_add_crc_entry.

v2:
- Lots of good fixes suggested by Thierry.
- Added documentation.
- Changed the debugfs layout.
- Moved to allocate the entries circular queue once when frame
  generation gets enabled for the first time.
v3:
- Use the control file just to select the source, and start and stop
  capture when the data file is opened and closed, respectively.
- Make variable the number of CRC values per entry, per source.
- Allocate entries queue each time we start capturing as now there
  isn't a fixed number of CRC values per entry.
- Store the frame counter in the data file as a 8-digit hex number.
- For sources that cannot provide useful frame numbers, place
   in the frame field.

v4:
- Build only if CONFIG_DEBUG_FS is enabled.
- Use memdup_user_nul.
- Consolidate calculation of the size of an entry in a helper.
- Add 0x prefix to hex numbers in the data file.
- Remove unnecessary snprintf and strlen usage in read callback.

v5:
- Made the crcs array in drm_crtc_crc_entry fixed-size
- Lots of other smaller improvements suggested by Emil Velikov

v7:
- Move definition of drm_debugfs_crtc_crc_add to drm_internal.h

Signed-off-by: Tomeu Vizoso 
Reviewed-by: Emil Velikov 
---

 Documentation/gpu/drm-uapi.rst|   6 +
 drivers/gpu/drm/Makefile  |   3 +-
 drivers/gpu/drm/drm_crtc.c|  29 +++-
 drivers/gpu/drm/drm_debugfs.c |  34 +++-
 drivers/gpu/drm/drm_debugfs_crc.c | 351 ++
 drivers/gpu/drm/drm_drv.c |  15 ++
 drivers/gpu/drm/drm_internal.h|  16 ++
 include/drm/drm_crtc.h|  41 +
 include/drm/drm_debugfs_crc.h |  73 
 9 files changed, 565 insertions(+), 3 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_debugfs_crc.c
 create mode 100644 include/drm/drm_debugfs_crc.h

diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.rst
index 12b47c30fe2e..4d5f61b6c0f2 100644
--- a/Documentation/gpu/drm-uapi.rst
+++ b/Documentation/gpu/drm-uapi.rst
@@ -179,3 +179,9 @@ interfaces. Especially since all hardware-acceleration 
interfaces to
 userspace are driver specific for efficiency and other reasons these
 interfaces can be rather substantial. Hence every driver has its own
 chapter.
+
+Testing and validation
+==
+
+.. kernel-doc:: drivers/gpu/drm/drm_debugfs_crc.c
+   :doc: CRC ABI
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 4054c94a2301..9c99b051ce87 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -9,7 +9,7 @@ drm-y   :=  drm_auth.o drm_bufs.o drm_cache.o \
drm_scatter.o drm_pci.o \
drm_platform.o drm_sysfs.o drm_hashtab.o drm_mm.o \
drm_crtc.o drm_fourcc.o drm_modes.o drm_edid.o \
-   drm_info.o drm_debugfs.o drm_encoder_slave.o \
+   drm_info.o drm_encoder_slave.o \
drm_trace_points.o drm_global.o drm_prime.o \
drm_rect.o drm_vma_manager.o drm_flip_work.o \
drm_modeset_lock.o drm_atomic.o drm_bridge.o \
@@ -21,6 +21,7 @@ drm-$(CONFIG_PCI) += ati_pcigart.o
 drm-$(CONFIG_DRM_PANEL) += drm_panel.o
 drm-$(CONFIG_OF) += drm_of.o
 drm-$(CONFIG_AGP) += drm_agpsupport.o
+drm-$(CONFIG_DEBUG_FS) += drm_debugfs.o drm_debugfs_crc.o
 
 drm_kms_helper-y := drm_crtc_helper.o drm_dp_helper.o drm_probe_helper.o \
drm_plane_helper.o drm_dp_mst_topology.o drm_atomic_helper.o \
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 7f2510524f09..17cc6891dfbb 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -40,7 +40,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include "drm_crtc_internal.h"
 #include "drm_internal.h"
@@ -309,6 +309,25 @@ static void drm_crtc_unregister_all(struct drm_device *dev)
}
 }
 
+static int drm_crtc_crc_init(struct drm_crtc *crtc)
+{
+#ifdef CONFIG_DEBUG_FS
+   spin_lock_init(&crtc->crc.lock);
+   init_waitqueue_head(&crtc->crc.wq);
+   crtc->crc.source = kstrdup("auto", GFP_KERNEL);
+   if (!crtc->crc.source)
+   return -ENOMEM;
+#endif
+   return 0;
+}
+
+static void drm_crtc_crc_fini(struct drm_crtc *crtc)
+{
+#ifdef CONFIG_DEBUG_FS
+   kfree(crtc->crc.source);
+#endif
+}
+
 /**
  * drm_crtc_init_with_planes - Initialise a new CRTC object with
  *specified primary and cursor planes.
@@ -374,6 +393,12 @@ int drm_crtc_init_with_planes(struct drm_device *dev, 
struct drm_crtc *crtc,
if (cursor)
cursor->possible_crtcs = 1 << drm_crtc_index(crtc);
 

Re: [PATCH v3 2/3] hwmon: xgene: Add hwmon driver

2016-09-08 Thread Guenter Roeck

On 09/08/2016 01:15 AM, Arnd Bergmann wrote:

On Wednesday, September 7, 2016 3:27:54 PM CEST Guenter Roeck wrote:

On Wed, Sep 07, 2016 at 11:41:44PM +0200, Arnd Bergmann wrote:

On Thursday, July 21, 2016 1:55:56 PM CEST Hoan Tran wrote:

+   ctx->comm_base_addr = cppc_ss->base_address;
+   if (ctx->comm_base_addr) {
+   ctx->pcc_comm_addr =
+   acpi_os_ioremap(ctx->comm_base_addr,
+   cppc_ss->length);



This causes the arm64 allmodconfig build to fail now, according to
kernelci:

  1  ERROR: "memblock_is_memory" [drivers/hwmon/xgene-hwmon.ko] undefined!


How do you even get there ? arm64:allmodconfig fails for me in -next with

drivers/pwm/pwm-berlin.c: In function ‘berlin_pwm_suspend’:
drivers/pwm/pwm-berlin.c:245:35: error: ‘struct berlin_pwm_chip’ has no member 
named ‘chips’


That was fixed in yesterday's linux-next.



Maybe, but now I get

Building arm:allmodconfig ... failed
--
Error log:
crypto/crypto_engine.c: In function 'crypto_transfer_hash_request':
crypto/crypto_engine.c:234:3: error: implicit declaration of function 
'queue_kthread_work'

Building arm64:allmodconfig ... failed
--
Error log:
arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c: In function 
‘kvm_timer_hyp_init’:
arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c:457:1: warning: label 
‘out_free’ defined but not used

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" 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 2/3] hwmon: xgene: Add hwmon driver

2016-09-08 Thread Arnd Bergmann
On Thursday, September 8, 2016 7:55:44 AM CEST Guenter Roeck wrote:
> Maybe, but now I get
> 
> Building arm:allmodconfig ... failed
> --
> Error log:
> crypto/crypto_engine.c: In function 'crypto_transfer_hash_request':
> crypto/crypto_engine.c:234:3: error: implicit declaration of function 
> 'queue_kthread_work'
> 
> Building arm64:allmodconfig ... failed
> --
> Error log:
> arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c: In function 
> ‘kvm_timer_hyp_init’:
> arch/arm64/kvm/../../../virt/kvm/arm/arch_timer.c:457:1: warning: label 
> ‘out_free’ defined but not used

Right, I sent fixes for both. I think we had a clean build yesterday,
probably tomorrow those will both be fixed.

The time between -rc5 and -rc7 seems to be the worst for build testing ;-)

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


Re: [PATCH v6 2/4] drm: Add API for capturing frame CRCs

2016-09-08 Thread Emil Velikov
On 8 September 2016 at 15:49, Tomeu Vizoso  wrote:
> On 8 September 2016 at 15:24, Emil Velikov  wrote:
>> Hi Tomeu,
>>
>> A couple of small nitpicks and a rather nasty looking bug, related to
>> your earlier question.
>>
>> On 7 September 2016 at 11:27, Tomeu Vizoso  
>> wrote:
>>
>>> +static ssize_t crc_control_write(struct file *file, const char __user 
>>> *ubuf,
>>> +size_t len, loff_t *offp)
>>> +{
>>
>>> +   if (source[len] == '\n')
>>> +   source[len] = '\0';
>>> +
>> Considering the bug below, I'm considering if there's a case were we
>> don't want to explicitly set the terminating byte ?
>>
>>
>>> +/*
>>> + * 1 frame field of 10 chars plus a number of CRC fields of 10 chars each, 
>>> space
>>> + * separated, with a newline at the end and null-terminated.
>>> + */
>> NULL-terminated what the things that was missing, explaining the
>> maths. Yet note the code sort of contradicts it.
>>
>> TL;DR: above we conditionally NULL terminate the data, yet (below) we
>> feed garbage (always) instead of \0 byte.
>>
>>> +#define LINE_LEN(values_cnt)   (10 + 11 * values_cnt + 1 + 1)
>>> +#define MAX_LINE_LEN   (LINE_LEN(DRM_MAX_CRC_NR))
>>> +
>>> +static ssize_t crtc_crc_read(struct file *filep, char __user *user_buf,
>>> +size_t count, loff_t *pos)
>>> +{
>>> +   struct drm_crtc *crtc = filep->f_inode->i_private;
>>> +   struct drm_crtc_crc *crc = &crtc->crc;
>>> +   struct drm_crtc_crc_entry *entry;
>>> +   char buf[MAX_LINE_LEN];
>> Here buf is filled with garbage...
>>
>>
>>> +   if (entry->has_frame_counter)
>>> +   sprintf(buf, "0x%08x", entry->frame);
>>> +   else
>>> +   sprintf(buf, "XX");
>>> +
>>> +   for (i = 0; i < crc->values_cnt; i++)
>>> +   sprintf(buf + 10 + i * 11, " 0x%08x", entry->crcs[i]);
>>> +   sprintf(buf + 10 + crc->values_cnt * 11, "\n");
>>> +
>> ... and now all the data is in, incl. the \n byte.
>>
>>> +   if (copy_to_user(user_buf, buf, LINE_LEN(crc->values_cnt)))
>> And here we copy the whole thing incl. the 'should be \0 but is
>> actually garbage' byte.
>
> As discussed offline, sprintf does terminate the string for us, so I
> think this is fine.
>
Forget I said anything /me hides in shame

>> This doesn't look good :-\
>>
>>> --- a/drivers/gpu/drm/drm_drv.c
>>> +++ b/drivers/gpu/drm/drm_drv.c
>>
>>> @@ -221,6 +222,14 @@ static int drm_minor_register(struct drm_device *dev, 
>>> unsigned int type)
>>> return ret;
>>> }
>>>
>>> +   if (type == DRM_MINOR_PRIMARY) {
>>> +   drm_for_each_crtc(crtc, dev) {
>>> +   ret = drm_debugfs_crtc_add(crtc);
>>> +   if (ret)
>>> +   DRM_ERROR("DRM: Failed to initialize CRC 
>>> debugfs.\n");
>>> +   }
>>> +   }
>>> +
>> Minor: We're missing teardown in the error path.
>
> Isn't drm_debugfs_cleanup taking care of it?
>
Maybe ? It goes through the debugfs_list and pulls down individual
files. Yet most/all of drm users of debugfs_create_dir explicitly
cleanup after themselves via debugfs_remove_recursive() so I'd play
along.

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


[PATCH V5] leds: trigger: Introduce a USB port trigger

2016-09-08 Thread Rafał Miłecki
From: Rafał Miłecki 

This commit adds a new trigger responsible for turning on LED when USB
device gets connected to the selected USB port. This can can useful for
various home routers that have USB port(s) and a proper LED telling user
a device is connected.

The trigger gets its documentation file but basically it just requires
enabling it and selecting USB ports (e.g. echo 1 > ports/usb1-1).

There was a long discussion on design of this driver. Its current state
is a result of picking them most adjustable solution as others couldn't
handle all cases.

1) It wasn't possible for the driver to register separated trigger for
   each USB port. Some physical USB ports are handled by more than one
   controller and so by more than one USB port. E.g. USB 2.0 physical
   port may be handled by OHCI's port and EHCI's port.
   It's also not possible to assign more than 1 trigger to a single LED
   and implementing such feature would be tricky due to syncing triggers
   and sysfs conflicts with old triggers.

2) Another idea was to register trigger per USB hub. This wouldn't allow
   handling devices with multiple USB LEDs and controllers (hubs)
   controlling more than 1 physical port. It's common for hubs to have
   few ports and each may have its own LED.

This final trigger is highly flexible. It allows selecting any USB ports
for any LED. It was also modified (compared to the initial version) to
allow choosing ports rather than having user /guess/ proper names. It
was successfully tested on SmartRG SR400ac which has 3 USB LEDs,
2 physical ports and 3 controllers.

Another planned feature is support for LED reacting to the USB activity.
This can be implemented with another sysfs file for setting mode. The
default mode wouldn't change so there won't be ABI breakage and such
feature can be safely implemented later.

There was also an idea of supporting other devices (PCI, SDIO, etc.) but
as this driver already contains some USB specific code (and will get
more) these should be probably separated drivers (triggers).

Signed-off-by: Rafał Miłecki 
---
V2: Trying to add DT support, idea postponed as it will take more time
to discuss the bindings.
V3: Fix typos in commit and Documentation (thanks Jacek!)
Use "ports" sysfs file for adding and removing USB ports (thx Jacek)
Check if there is USB device connected after adding new USB port
Fix memory leak or two
V3.5: Fix e-mail address (thanks Matthias)
  Simplify conditions in usbport_trig_notify (thx Matthias)
  Make "ports" a subdirectory with file per port, to match one value
  per file sysfs rule (thanks Greg)
  As "ports" couldn't be used for adding and removing ports anymore,
  there are now "new_port" and "remove_port". Having them makes this
  API also common with e.g. pci and usb buses.
V4: Add Documentation/ABI/testing/sysfs-class-led-trigger-usbport and
reference it in Documentation/leds/ledtrig-usbport.txt to avoid doc
duplication.
V5: Update commit message to explain driver design & Documentation
Avoid specifying ports manually and dummy files (chmod )
Don't use kobject_create_and_add but a struct attribute_group
Fix typo, improve comments, update Date
---
 .../ABI/testing/sysfs-class-led-trigger-usbport|  11 +
 Documentation/leds/ledtrig-usbport.txt |  41 +++
 drivers/leds/trigger/Kconfig   |   8 +
 drivers/leds/trigger/Makefile  |   1 +
 drivers/leds/trigger/ledtrig-usbport.c | 316 +
 5 files changed, 377 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-class-led-trigger-usbport
 create mode 100644 Documentation/leds/ledtrig-usbport.txt
 create mode 100644 drivers/leds/trigger/ledtrig-usbport.c

diff --git a/Documentation/ABI/testing/sysfs-class-led-trigger-usbport 
b/Documentation/ABI/testing/sysfs-class-led-trigger-usbport
new file mode 100644
index 000..a9b7e92
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-led-trigger-usbport
@@ -0,0 +1,11 @@
+What:  /sys/class/leds//ports/
+Date:  September 2016
+KernelVersion: 4.9
+Contact:   linux-l...@vger.kernel.org
+Description:
+   Every dir entry represents a single USB port that can be
+   selected for the USB port trigger. Selecting ports makes trigger
+   observing them for any connected devices and lighting on LED if
+   there are any.
+   Echoing "1" value selects USB port. Echoing "0" unselects it.
+   Current state can be also read.
diff --git a/Documentation/leds/ledtrig-usbport.txt 
b/Documentation/leds/ledtrig-usbport.txt
new file mode 100644
index 000..69f54bf
--- /dev/null
+++ b/Documentation/leds/ledtrig-usbport.txt
@@ -0,0 +1,41 @@
+USB port LED trigger
+
+
+This LED trigger can be used for signalling to the user a presence of USB 
device
+in a given port. It simply turns on LED when device appears 

Re: Ping: [PATCH v15 00/13] support "task_isolation" mode

2016-09-08 Thread Francis Giraldeau
On 2016-09-07 05:11 PM, Francis Giraldeau wrote:
> The syscall test fails on x86:
> $ sudo ./isolation
> [...]
> test_syscall: FAIL (0x100)
> test_syscall (SIGUSR1): FAIL (0x100)

The fix is indeed very simple:

diff --git a/arch/x86/include/asm/thread_info.h 
b/arch/x86/include/asm/thread_info.h
index 7255367..449e2b5 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -139,7 +139,7 @@ struct thread_info {
 #define _TIF_WORK_SYSCALL_ENTRY\
(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU | _TIF_SYSCALL_AUDIT |   \
 _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT |   \
-_TIF_NOHZ)
+_TIF_NOHZ | _TIF_TASK_ISOLATION)
 
 /* work to do on any return to user space */
 #define _TIF_ALLWORK_MASK  \


I updated the branch accordingly:

https://github.com/giraldeau/linux/commit/057761af7bde087fa10aa42554a13a7b69071938

Thanks,

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


Re: Source and Make files under Documentation directory

2016-09-08 Thread Shuah Khan
On 09/08/2016 02:17 AM, Jonathan Corbet wrote:
> On Wed, 7 Sep 2016 18:11:59 -0600
> Shuah Khan  wrote:
> 
>> I noticed there are several source files and Makefiles under the
>> Documentation directory. Some of them look very much like tests.
>>
>> If they are indeed tests, maybe it is worth while to move them to
>> selftests? If you think this topic needs larger audience, I could
>> send in a KS topic for discussion. If we can identify useful tests,
>> I can volunteer to get them into selftests
> 
> Moving runnable code out of Documentation/ into tests/ or tools/ as
> appropriate has been a long-term goal, and some progress has been made.
> I don't really think we need a KS session for it, I don't think
> there's really any disagreement here; it's just a matter of getting the
> work done.  If you see something that would be better placed elsewhere and
> have the time, just send a patch making the change.
> 
> Thanks,
> 
> jon
> 


Hi Jon,

Sounds good. I didn't think it needs a discussion either, just
wanted to confirm. Thanks for clearing this up.

I started looking at the tests and will start sending patches
in the next couple of weeks. I can take them through seltftests
with your Ack, if that is okay with you.


thanks,
-- Shuah
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 06/15] [media] conf_nitpick.py: ignore an opaque struct from v4l2-mem2mem.h

2016-09-08 Thread Mauro Carvalho Chehab
The v4l2_m2m_dev is opaque: its meaning is only known by
v4l2-mem2mem.c. Ignore it on nitpick mode.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/conf_nitpick.py | 4 
 1 file changed, 4 insertions(+)

diff --git a/Documentation/media/conf_nitpick.py 
b/Documentation/media/conf_nitpick.py
index 1f3ef3ded2d4..f71bb947eb15 100644
--- a/Documentation/media/conf_nitpick.py
+++ b/Documentation/media/conf_nitpick.py
@@ -98,4 +98,8 @@ nitpick_ignore = [
 ("c:type", "usb_interface"),
 ("c:type", "v4l2_std_id"),
 ("c:type", "video_system_t"),
+
+# Opaque structures
+
+("c:type", "v4l2_m2m_dev"),
 ]
-- 
2.7.4


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


[PATCH 10/15] [media] conf_nitpick.py: ignore C domain data used on vb2

2016-09-08 Thread Mauro Carvalho Chehab
Ignore external C domain structs and functions used by VB2
header.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/media/conf_nitpick.py | 4 
 1 file changed, 4 insertions(+)

diff --git a/Documentation/media/conf_nitpick.py 
b/Documentation/media/conf_nitpick.py
index f71bb947eb15..480d548af670 100644
--- a/Documentation/media/conf_nitpick.py
+++ b/Documentation/media/conf_nitpick.py
@@ -40,6 +40,8 @@ nitpick_ignore = [
 ("c:func", "struct fd_set"),
 ("c:func", "struct pollfd"),
 ("c:func", "usb_make_path"),
+("c:func", "wait_finish"),
+("c:func", "wait_prepare"),
 ("c:func", "write"),
 
 ("c:type", "atomic_t"),
@@ -67,6 +69,7 @@ nitpick_ignore = [
 ("c:type", "off_t"),
 ("c:type", "pci_dev"),
 ("c:type", "pdvbdev"),
+("c:type", "poll_table"),
 ("c:type", "platform_device"),
 ("c:type", "pollfd"),
 ("c:type", "poll_table_struct"),
@@ -98,6 +101,7 @@ nitpick_ignore = [
 ("c:type", "usb_interface"),
 ("c:type", "v4l2_std_id"),
 ("c:type", "video_system_t"),
+("c:type", "vm_area_struct"),
 
 # Opaque structures
 
-- 
2.7.4


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


Re: [PATCH] cpufreq-stats: Minor documentation fix

2016-09-08 Thread Rafael J. Wysocki

On 9/8/2016 1:20 PM, Viresh Kumar wrote:

On 08-09-16, 12:39, Jean Delvare wrote:

The cpufreq-stats code can no longer be built as a module, so it now
appears with square brackets in menuconfig.

Signed-off-by: Jean Delvare 
Fixes: 1aefc75b2449 ("cpufreq: stats: Make the stats code non-modular")
Cc: Rafael J. Wysocki 
Cc: Viresh Kumar 
---
  Documentation/cpu-freq/cpufreq-stats.txt |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-4.8-rc5.orig/Documentation/cpu-freq/cpufreq-stats.txt 2016-09-04 
23:31:46.0 +0200
+++ linux-4.8-rc5/Documentation/cpu-freq/cpufreq-stats.txt  2016-09-08 
11:34:34.805606601 +0200
@@ -103,7 +103,7 @@ Config Main Menu
Power management options (ACPI, APM)  --->
CPU Frequency scaling  --->
[*] CPU Frequency scaling
-   <*>   CPU frequency translation statistics
+   [*]   CPU frequency translation statistics
[*] CPU frequency translation statistics details

Acked-by: Viresh Kumar 

Applied, but please CC PM material to linux-pm too.  That makes it much 
easier to handle.



Thanks,

Rafael


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


[PATCH v1] Documentation/filesystems: Fixed typo

2016-09-08 Thread robert . foss
From: Robert Foss 

Fixed a -> an typo.

Signed-off-by: Robert Foss 
Acked-by: Kees Cook 

---
 Documentation/filesystems/proc.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/filesystems/proc.txt 
b/Documentation/filesystems/proc.txt
index 68080ad..fcc1ac0 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -145,7 +145,7 @@ Table 1-1: Process specific entries in /proc
symbol the task is blocked in - or "0" if not blocked.
  pagemap   Page table
  stack Report full stack trace, enable via CONFIG_STACKTRACE
- smaps a extension based on maps, showing the memory consumption of
+ smaps an extension based on maps, showing the memory consumption of
each mapping and flags associated with it
  numa_maps an extension based on maps, showing the memory locality and
binding policy as well as mem usage (in pages) of each mapping.
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" 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 2/3] hwmon: xgene: Add hwmon driver

2016-09-08 Thread AKASHI Takahiro
On Thu, Sep 08, 2016 at 11:47:59AM +0100, James Morse wrote:
> Hi,
> 
> On 08/09/16 09:14, Arnd Bergmann wrote:
> > On Wednesday, September 7, 2016 3:37:05 PM CEST Guenter Roeck wrote:
> >> On Wed, Sep 07, 2016 at 11:41:44PM +0200, Arnd Bergmann wrote:
> >>> On Thursday, July 21, 2016 1:55:56 PM CEST Hoan Tran wrote:
>  +   ctx->comm_base_addr = cppc_ss->base_address;
>  +   if (ctx->comm_base_addr) {
>  +   ctx->pcc_comm_addr =
>  +   
>  acpi_os_ioremap(ctx->comm_base_addr,
>  +   cppc_ss->length);
> 
> >>>
> >>> This causes the arm64 allmodconfig build to fail now, according to
> >>> kernelci:
> >>>
> >>>   1  ERROR: "memblock_is_memory" [drivers/hwmon/xgene-hwmon.ko] 
> >>> undefined!
> >>>
> >>> Should this perhaps call ioremap() or memremap() instead?
> >>>
> >> Hmmm ... almost sounds to me like blaming the messenger. e7cd190385d1 
> >> ("arm64:
> >> mark reserved memblock regions explicitly in iomem") starts using a 
> >> function
> >> in acpi_os_ioremap() which is not exported. On top of that, 
> >> memblock_is_memory()
> >> is declared as __init_memblock, which makes me really uncomfortable.
> >> If acpi_os_ioremap() must not be used by modules, and possibly only during
> >> early (?) initialization, maybe its declaration should state those 
> >> limitations ?
> > 
> > Ah, I didn't notice that. I guess both patches were correct individually and
> > got added to linux-next around the same time but caused allmodconfig to 
> > blow up
> > when used together.
> > 
> > Adding everyone who was involved in the memblock patch to Cc here, maybe one
> > of them has an idea what the correct fix is. There are only two other 
> > drivers
> > using acpi_os_ioremap() and one of them is x86-specific, so it's still 
> > likely
> > that drivers are not actually supposed to use this symbol. Making
> > acpi_os_ioremap() an exported function in arm64 would also work.
> 
> You could use acpi_os_map_iomem()/acpi_os_unmap_iomem() from acpi/acpi_io.h.
> If there isn't an existing mapping these end up in acpi_os_ioremap(), and are
> already EXPORT_SYMBOL_GPL().

acpi_os_ioremap() is re-defined in arm64/include/asm/acpi.h.

The problem is that, as memblock_is_memory() is declared as __init,
we cannot build any drivers which call acpi_os_ioremap() as modules.

As far as this specific issue is concerned, if we make a change like:

===8<===
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -207,7 +207,7 @@ static void __init request_standard_resources(void)
res = alloc_bootmem_low(sizeof(*res));
if (memblock_is_nomap(region)) {
res->name  = "reserved";
-   res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+   res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
} else {
res->name  = "System RAM";
res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
===>8===

and revert the following hunk from the commit:

===8<===
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -12,7 +12,7 @@
 #ifndef _ASM_ACPI_H
 #define _ASM_ACPI_H
 
-#include 
+#include 
 #include 
 
 #include 
@@ -32,7 +32,11 @@
 static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
acpi_size size)
 {
-   if (!page_is_ram(phys >> PAGE_SHIFT))
+   /*
+* EFI's reserve_regions() call adds memory with the WB attribute
+* to memblock via early_init_dt_add_memory_arch().
+*/
+   if (!memblock_is_memory(phys))
return ioremap(phys, size);
 
return ioremap_cache(phys, size);
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
===>8===

The build error will be gone. (and still kdump should work.)

But I don't know how we should distinguish IORESOURCE_MEM and
IORESOURCE_SYSTEM_RAM.

Thanks,
-Takahiro AKASHI

> (I'm still waiting for allmodconfig on linux-next to finish building)
> 
> 
> Thanks,
> 
> James
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html