Commit 184892925118d924aa9304b466946ae18c029932

Authored by Shuah Khan
1 parent a67cd5482f

samples: move blackfin gptimers-example from Documentation

Move blackfin gptimers-example to samples and remove it from Documentation
Makefile. Update samples Kconfig and Makefile to build gptimers-example.

blackfin is the last CONFIG_BUILD_DOCSRC target in Documentation/Makefile.
Hence this patch also includes changes to remove CONFIG_BUILD_DOCSRC from
Makefile and lib/Kconfig.debug and updates VIDEO_PCI_SKELETON dependency
on BUILD_DOCSRC.

Documentation/Makefile is not deleted to avoid braking make htmldocs and
make distclean.

Acked-by: Michal Marek <mmarek@suse.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reported-by: Valentin Rothberg <valentinrothberg@gmail.com>
Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>

Showing 11 changed files with 101 additions and 115 deletions Side-by-side Diff

Documentation/Makefile
1   -subdir-y := blackfin
  1 +subdir-y :=
Documentation/blackfin/00-INDEX
1 1 00-INDEX
2 2 - This file
3   -Makefile
4   - - Makefile for gptimers example file.
5 3 bfin-gpio-notes.txt
6 4 - Notes in developing/using bfin-gpio driver.
7 5 bfin-spi-notes.txt
8 6 - Notes for using bfin spi bus driver.
9   -gptimers-example.c
10   - - gptimers example
Documentation/blackfin/Makefile
1   -ifneq ($(CONFIG_BLACKFIN),)
2   -ifneq ($(CONFIG_BFIN_GPTIMERS),)
3   -obj-m := gptimers-example.o
4   -endif
5   -endif
Documentation/blackfin/gptimers-example.c
1   -/*
2   - * Simple gptimers example
3   - * http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:gptimers
4   - *
5   - * Copyright 2007-2009 Analog Devices Inc.
6   - *
7   - * Licensed under the GPL-2 or later.
8   - */
9   -
10   -#include <linux/interrupt.h>
11   -#include <linux/module.h>
12   -
13   -#include <asm/gptimers.h>
14   -#include <asm/portmux.h>
15   -
16   -/* ... random driver includes ... */
17   -
18   -#define DRIVER_NAME "gptimer_example"
19   -
20   -#ifdef IRQ_TIMER5
21   -#define SAMPLE_IRQ_TIMER IRQ_TIMER5
22   -#else
23   -#define SAMPLE_IRQ_TIMER IRQ_TIMER2
24   -#endif
25   -
26   -struct gptimer_data {
27   - uint32_t period, width;
28   -};
29   -static struct gptimer_data data;
30   -
31   -/* ... random driver state ... */
32   -
33   -static irqreturn_t gptimer_example_irq(int irq, void *dev_id)
34   -{
35   - struct gptimer_data *data = dev_id;
36   -
37   - /* make sure it was our timer which caused the interrupt */
38   - if (!get_gptimer_intr(TIMER5_id))
39   - return IRQ_NONE;
40   -
41   - /* read the width/period values that were captured for the waveform */
42   - data->width = get_gptimer_pwidth(TIMER5_id);
43   - data->period = get_gptimer_period(TIMER5_id);
44   -
45   - /* acknowledge the interrupt */
46   - clear_gptimer_intr(TIMER5_id);
47   -
48   - /* tell the upper layers we took care of things */
49   - return IRQ_HANDLED;
50   -}
51   -
52   -/* ... random driver code ... */
53   -
54   -static int __init gptimer_example_init(void)
55   -{
56   - int ret;
57   -
58   - /* grab the peripheral pins */
59   - ret = peripheral_request(P_TMR5, DRIVER_NAME);
60   - if (ret) {
61   - printk(KERN_NOTICE DRIVER_NAME ": peripheral request failed\n");
62   - return ret;
63   - }
64   -
65   - /* grab the IRQ for the timer */
66   - ret = request_irq(SAMPLE_IRQ_TIMER, gptimer_example_irq,
67   - IRQF_SHARED, DRIVER_NAME, &data);
68   - if (ret) {
69   - printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n");
70   - peripheral_free(P_TMR5);
71   - return ret;
72   - }
73   -
74   - /* setup the timer and enable it */
75   - set_gptimer_config(TIMER5_id,
76   - WDTH_CAP | PULSE_HI | PERIOD_CNT | IRQ_ENA);
77   - enable_gptimers(TIMER5bit);
78   -
79   - return 0;
80   -}
81   -module_init(gptimer_example_init);
82   -
83   -static void __exit gptimer_example_exit(void)
84   -{
85   - disable_gptimers(TIMER5bit);
86   - free_irq(SAMPLE_IRQ_TIMER, &data);
87   - peripheral_free(P_TMR5);
88   -}
89   -module_exit(gptimer_example_exit);
90   -
91   -MODULE_LICENSE("BSD");
... ... @@ -933,9 +933,6 @@
933 933 ifdef CONFIG_HEADERS_CHECK
934 934 $(Q)$(MAKE) -f $(srctree)/Makefile headers_check
935 935 endif
936   -ifdef CONFIG_BUILD_DOCSRC
937   - $(Q)$(MAKE) $(build)=Documentation
938   -endif
939 936 ifdef CONFIG_GDB_SCRIPTS
940 937 $(Q)ln -fsn `cd $(srctree) && /bin/pwd`/scripts/gdb/vmlinux-gdb.py
941 938 endif
drivers/media/v4l2-core/Kconfig
... ... @@ -27,7 +27,7 @@
27 27  
28 28 config VIDEO_PCI_SKELETON
29 29 tristate "Skeleton PCI V4L2 driver"
30   - depends on PCI && BUILD_DOCSRC
  30 + depends on PCI
31 31 depends on VIDEO_V4L2 && VIDEOBUF2_CORE
32 32 depends on VIDEOBUF2_MEMOPS && VIDEOBUF2_DMA_CONTIG
33 33 ---help---
... ... @@ -1875,15 +1875,6 @@
1875 1875  
1876 1876 See Documentation/debugging-via-ohci1394.txt for more information.
1877 1877  
1878   -config BUILD_DOCSRC
1879   - bool "Build targets in Documentation/ tree"
1880   - depends on HEADERS_CHECK
1881   - help
1882   - This option attempts to build objects from the source files in the
1883   - kernel Documentation/ tree.
1884   -
1885   - Say N if you are unsure.
1886   -
1887 1878 config DMA_API_DEBUG
1888 1879 bool "Enable debugging of DMA-API usage"
1889 1880 depends on HAVE_DMA_API_DEBUG
... ... @@ -99,5 +99,11 @@
99 99 Build samples of seccomp filters using various methods of
100 100 BPF filter construction.
101 101  
  102 +config SAMPLE_BLACKFIN_GPTIMERS
  103 + tristate "Build blackfin gptimers sample code -- loadable modules only"
  104 + depends on BLACKFIN && BFIN_GPTIMERS && m
  105 + help
  106 + Build samples of blackfin gptimers sample module.
  107 +
102 108 endif # SAMPLES
... ... @@ -2,5 +2,5 @@
2 2  
3 3 obj-$(CONFIG_SAMPLES) += kobject/ kprobes/ trace_events/ livepatch/ \
4 4 hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ \
5   - configfs/ connector/ v4l/ trace_printk/
  5 + configfs/ connector/ v4l/ trace_printk/ blackfin/
samples/blackfin/Makefile
  1 +obj-$(CONFIG_SAMPLE_BLACKFIN_GPTIMERS) += gptimers-example.o
samples/blackfin/gptimers-example.c
  1 +/*
  2 + * Simple gptimers example
  3 + * http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:gptimers
  4 + *
  5 + * Copyright 2007-2009 Analog Devices Inc.
  6 + *
  7 + * Licensed under the GPL-2 or later.
  8 + */
  9 +
  10 +#include <linux/interrupt.h>
  11 +#include <linux/module.h>
  12 +
  13 +#include <asm/gptimers.h>
  14 +#include <asm/portmux.h>
  15 +
  16 +/* ... random driver includes ... */
  17 +
  18 +#define DRIVER_NAME "gptimer_example"
  19 +
  20 +#ifdef IRQ_TIMER5
  21 +#define SAMPLE_IRQ_TIMER IRQ_TIMER5
  22 +#else
  23 +#define SAMPLE_IRQ_TIMER IRQ_TIMER2
  24 +#endif
  25 +
  26 +struct gptimer_data {
  27 + uint32_t period, width;
  28 +};
  29 +static struct gptimer_data data;
  30 +
  31 +/* ... random driver state ... */
  32 +
  33 +static irqreturn_t gptimer_example_irq(int irq, void *dev_id)
  34 +{
  35 + struct gptimer_data *data = dev_id;
  36 +
  37 + /* make sure it was our timer which caused the interrupt */
  38 + if (!get_gptimer_intr(TIMER5_id))
  39 + return IRQ_NONE;
  40 +
  41 + /* read the width/period values that were captured for the waveform */
  42 + data->width = get_gptimer_pwidth(TIMER5_id);
  43 + data->period = get_gptimer_period(TIMER5_id);
  44 +
  45 + /* acknowledge the interrupt */
  46 + clear_gptimer_intr(TIMER5_id);
  47 +
  48 + /* tell the upper layers we took care of things */
  49 + return IRQ_HANDLED;
  50 +}
  51 +
  52 +/* ... random driver code ... */
  53 +
  54 +static int __init gptimer_example_init(void)
  55 +{
  56 + int ret;
  57 +
  58 + /* grab the peripheral pins */
  59 + ret = peripheral_request(P_TMR5, DRIVER_NAME);
  60 + if (ret) {
  61 + printk(KERN_NOTICE DRIVER_NAME ": peripheral request failed\n");
  62 + return ret;
  63 + }
  64 +
  65 + /* grab the IRQ for the timer */
  66 + ret = request_irq(SAMPLE_IRQ_TIMER, gptimer_example_irq,
  67 + IRQF_SHARED, DRIVER_NAME, &data);
  68 + if (ret) {
  69 + printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n");
  70 + peripheral_free(P_TMR5);
  71 + return ret;
  72 + }
  73 +
  74 + /* setup the timer and enable it */
  75 + set_gptimer_config(TIMER5_id,
  76 + WDTH_CAP | PULSE_HI | PERIOD_CNT | IRQ_ENA);
  77 + enable_gptimers(TIMER5bit);
  78 +
  79 + return 0;
  80 +}
  81 +module_init(gptimer_example_init);
  82 +
  83 +static void __exit gptimer_example_exit(void)
  84 +{
  85 + disable_gptimers(TIMER5bit);
  86 + free_irq(SAMPLE_IRQ_TIMER, &data);
  87 + peripheral_free(P_TMR5);
  88 +}
  89 +module_exit(gptimer_example_exit);
  90 +
  91 +MODULE_LICENSE("BSD");