[PATCH 1/5] dvbdev: add a dvb_detach() macro

2014-05-29 Thread Mauro Carvalho Chehab
The dvb_attach() was unbalanced, as there was no dvb_dettach. Ok,
on current cases, the dettach is done by dvbdev, but that are some
future corner cases where we may need to do this before registering
the frontend.

So, add a dvb_detach() and use it at dvb_frontend.c.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-core/dvb_frontend.c | 8 
 drivers/media/dvb-core/dvbdev.h   | 4 
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/media/dvb-core/dvb_frontend.c 
b/drivers/media/dvb-core/dvb_frontend.c
index 6ce435ac866f..6cc2631d8f0e 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -2666,20 +2666,20 @@ void dvb_frontend_detach(struct dvb_frontend* fe)
 
if (fe->ops.release_sec) {
fe->ops.release_sec(fe);
-   symbol_put_addr(fe->ops.release_sec);
+   dvb_detach(fe->ops.release_sec);
}
if (fe->ops.tuner_ops.release) {
fe->ops.tuner_ops.release(fe);
-   symbol_put_addr(fe->ops.tuner_ops.release);
+   dvb_detach(fe->ops.tuner_ops.release);
}
if (fe->ops.analog_ops.release) {
fe->ops.analog_ops.release(fe);
-   symbol_put_addr(fe->ops.analog_ops.release);
+   dvb_detach(fe->ops.analog_ops.release);
}
ptr = (void*)fe->ops.release;
if (ptr) {
fe->ops.release(fe);
-   symbol_put_addr(ptr);
+   dvb_detach(ptr);
}
 }
 #else
diff --git a/drivers/media/dvb-core/dvbdev.h b/drivers/media/dvb-core/dvbdev.h
index 93a9470d3f0c..f96b28e7fc95 100644
--- a/drivers/media/dvb-core/dvbdev.h
+++ b/drivers/media/dvb-core/dvbdev.h
@@ -136,11 +136,15 @@ extern int dvb_usercopy(struct file *file, unsigned int 
cmd, unsigned long arg,
__r; \
 })
 
+#define dvb_detach(FUNC)   symbol_put_addr(FUNC)
+
 #else
 #define dvb_attach(FUNCTION, ARGS...) ({ \
FUNCTION(ARGS); \
 })
 
+#define dvb_detach(FUNC)   {}
+
 #endif
 
 #endif /* #ifndef _DVBDEV_H_ */
-- 
1.9.3

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


[PATCH 0/5] Partially fix a longstanding Kconfig issue with dib0700

2014-05-29 Thread Mauro Carvalho Chehab
This series partially fix a longstand Kconfig issue
with dib0700 and their frontend drivers: depending how
options are selected, build errors are generated.

This is partial because it only fixes the issues with
two frontends: dib7000p and dib8000 (the ones I have
devices here for testing). The very same approach can
be used by other devices, but I currently have no ways to
test. So, let's apply those changes first and hope that
someone could either do the patches or donte me some samples.

If none happen, I'll likely just replicate the same solution
on other frontends and post at the ML for others to test.

There's just one practical functional changes on this series:
now, devices will not load dib8000 and/or dib7000p if one
(or the two) frontends are not used by a particular device.

Except for that, no other change should be noticed.

Mauro Carvalho Chehab (5):
  dvbdev: add a dvb_detach() macro
  dib7000p: rename dib7000p_attach to dib7000p_init
  dib7000: export just one symbol
  dib8000: rename dib8000_attach to dib8000_init
  dib8000: export just one symbol

 drivers/media/dvb-core/dvb_frontend.c   |   8 +-
 drivers/media/dvb-core/dvbdev.h |   4 +
 drivers/media/dvb-frontends/dib7000p.c  |  72 +++--
 drivers/media/dvb-frontends/dib7000p.h  | 131 ++--
 drivers/media/dvb-frontends/dib8000.c   |  88 +++---
 drivers/media/dvb-frontends/dib8000.h   | 150 ++---
 drivers/media/pci/cx23885/cx23885-dvb.c |   8 +-
 drivers/media/usb/dvb-usb/cxusb.c   |  39 ++-
 drivers/media/usb/dvb-usb/dib0700_devices.c | 464 ++--
 9 files changed, 484 insertions(+), 480 deletions(-)

-- 
1.9.3

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


[PATCH 5/5] dib8000: export just one symbol

2014-05-29 Thread Mauro Carvalho Chehab
Exporting multiple symbols don't work as it causes compilation
breakages, due to the way dvb_attach() works.

The bug happens when:
CONFIG_DVB_DIB8000=m
CONFIG_DVB_USB_DIB0700=y

As a bonus, dib8000 won't be loaded anymore if the device uses
a different frontend, reducing the memory footprint.

Tested with both Pixelview PV-D231 and MyGica S870.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-frontends/dib8000.c   |  88 
 drivers/media/dvb-frontends/dib8000.h   | 150 +---
 drivers/media/usb/dvb-usb/dib0700_devices.c | 138 -
 3 files changed, 164 insertions(+), 212 deletions(-)

diff --git a/drivers/media/dvb-frontends/dib8000.c 
b/drivers/media/dvb-frontends/dib8000.c
index c1c8c92ce498..270a58e3e837 100644
--- a/drivers/media/dvb-frontends/dib8000.c
+++ b/drivers/media/dvb-frontends/dib8000.c
@@ -656,7 +656,7 @@ static int dib8000_sad_calib(struct dib8000_state *state)
return 0;
 }
 
-int dib8000_set_wbd_ref(struct dvb_frontend *fe, u16 value)
+static int dib8000_set_wbd_ref(struct dvb_frontend *fe, u16 value)
 {
struct dib8000_state *state = fe->demodulator_priv;
if (value > 4095)
@@ -664,7 +664,6 @@ int dib8000_set_wbd_ref(struct dvb_frontend *fe, u16 value)
state->wbd_ref = value;
return dib8000_write_word(state, 106, value);
 }
-EXPORT_SYMBOL(dib8000_set_wbd_ref);
 
 static void dib8000_reset_pll_common(struct dib8000_state *state, const struct 
dibx000_bandwidth_config *bw)
 {
@@ -739,7 +738,7 @@ static void dib8000_reset_pll(struct dib8000_state *state)
dib8000_reset_pll_common(state, pll);
 }
 
-int dib8000_update_pll(struct dvb_frontend *fe,
+static int dib8000_update_pll(struct dvb_frontend *fe,
struct dibx000_bandwidth_config *pll, u32 bw, u8 ratio)
 {
struct dib8000_state *state = fe->demodulator_priv;
@@ -815,8 +814,6 @@ int dib8000_update_pll(struct dvb_frontend *fe,
 
return 0;
 }
-EXPORT_SYMBOL(dib8000_update_pll);
-
 
 static int dib8000_reset_gpio(struct dib8000_state *st)
 {
@@ -849,13 +846,12 @@ static int dib8000_cfg_gpio(struct dib8000_state *st, u8 
num, u8 dir, u8 val)
return 0;
 }
 
-int dib8000_set_gpio(struct dvb_frontend *fe, u8 num, u8 dir, u8 val)
+static int dib8000_set_gpio(struct dvb_frontend *fe, u8 num, u8 dir, u8 val)
 {
struct dib8000_state *state = fe->demodulator_priv;
return dib8000_cfg_gpio(state, num, dir, val);
 }
 
-EXPORT_SYMBOL(dib8000_set_gpio);
 static const u16 dib8000_defaults[] = {
/* auto search configuration - lock0 by default waiting
 * for cpil_lock; lock1 cpil_lock; lock2 tmcc_sync_lock */
@@ -1228,13 +1224,12 @@ static int dib8000_set_agc_config(struct dib8000_state 
*state, u8 band)
return 0;
 }
 
-void dib8000_pwm_agc_reset(struct dvb_frontend *fe)
+static void dib8000_pwm_agc_reset(struct dvb_frontend *fe)
 {
struct dib8000_state *state = fe->demodulator_priv;
dib8000_set_adc_state(state, DIBX000_ADC_ON);
dib8000_set_agc_config(state, (unsigned 
char)(BAND_OF_FREQUENCY(fe->dtv_property_cache.frequency / 1000)));
 }
-EXPORT_SYMBOL(dib8000_pwm_agc_reset);
 
 static int dib8000_agc_soft_split(struct dib8000_state *state)
 {
@@ -1881,14 +1876,13 @@ static struct i2c_algorithm dib8096p_tuner_xfer_algo = {
.functionality = dib8096p_i2c_func,
 };
 
-struct i2c_adapter *dib8096p_get_i2c_tuner(struct dvb_frontend *fe)
+static struct i2c_adapter *dib8096p_get_i2c_tuner(struct dvb_frontend *fe)
 {
struct dib8000_state *st = fe->demodulator_priv;
return &st->dib8096p_tuner_adap;
 }
-EXPORT_SYMBOL(dib8096p_get_i2c_tuner);
 
-int dib8096p_tuner_sleep(struct dvb_frontend *fe, int onoff)
+static int dib8096p_tuner_sleep(struct dvb_frontend *fe, int onoff)
 {
struct dib8000_state *state = fe->demodulator_priv;
u16 en_cur_state;
@@ -1912,14 +1906,13 @@ int dib8096p_tuner_sleep(struct dvb_frontend *fe, int 
onoff)
 
return 0;
 }
-EXPORT_SYMBOL(dib8096p_tuner_sleep);
 
 static const s32 lut_1000ln_mant[] =
 {
908, 7003, 7090, 7170, 7244, 7313, 7377, 7438, 7495, 7549, 7600
 };
 
-s32 dib8000_get_adc_power(struct dvb_frontend *fe, u8 mode)
+static s32 dib8000_get_adc_power(struct dvb_frontend *fe, u8 mode)
 {
struct dib8000_state *state = fe->demodulator_priv;
u32 ix = 0, tmp_val = 0, exp = 0, mant = 0;
@@ -1937,9 +1930,8 @@ s32 dib8000_get_adc_power(struct dvb_frontend *fe, u8 
mode)
}
return val;
 }
-EXPORT_SYMBOL(dib8000_get_adc_power);
 
-int dib8090p_get_dc_power(struct dvb_frontend *fe, u8 IQ)
+static int dib8090p_get_dc_power(struct dvb_frontend *fe, u8 IQ)
 {
struct dib8000_state *state = fe->demodulator_priv;
int val = 0;
@@ -1957,7 +1949,6 @@ int dib8090p_get_dc_power(struct dvb_frontend *fe, u8 IQ)
 
return val;
 }
-EXPORT_SYMBOL(dib8090p_get_dc_power);
 
 static void dib8000_update_timf(struct dib8

[PATCH 3/5] dib7000: export just one symbol

2014-05-29 Thread Mauro Carvalho Chehab
Exporting multiple symbols don't work as it causes compilation
breakages, due to the way dvb_attach() works.

This were reported several times, like:

   drivers/built-in.o: In function `cxusb_dualdig4_rev2_tuner_attach':
>> cxusb.c:(.text+0x27d4b5): undefined reference to `dib7000p_get_i2c_master'
   drivers/built-in.o: In function `dib7070_set_param_override':
   cxusb.c:(.text+0x27d5a5): undefined reference to `dib0070_wbd_offset'
>> cxusb.c:(.text+0x27d5be): undefined reference to `dib7000p_set_wbd_ref'
   drivers/built-in.o: In function `dib7070_tuner_reset':
>> cxusb.c:(.text+0x27d5f9): undefined reference to `dib7000p_set_gpio'
   drivers/built-in.o: In function `cxusb_dualdig4_rev2_frontend_attach':
>> cxusb.c:(.text+0x27df5c): undefined reference to `dib7000p_i2c_enumeration'

In this specific report:
CONFIG_DVB_USB_CXUSB=y
CONFIG_DVB_DIB7000P=m

But the same type of bug can happen if:
CONFIG_DVB_DIB7000P=m
and one of the bridge drivers is compiled builtin (cxusb, cx23885-dvb
and/or dib0700).

As a bonus, dib7000p won't be loaded anymore if the device uses
a different frontend, reducing the memory footprint.

Tested with Hauppauge Nova-TD (2 frontends).

Reported-by: Fengguang Wu 
Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-frontends/dib7000p.c  |  74 ---
 drivers/media/dvb-frontends/dib7000p.h  | 131 ++-
 drivers/media/pci/cx23885/cx23885-dvb.c |   8 +-
 drivers/media/usb/dvb-usb/cxusb.c   |  39 +++-
 drivers/media/usb/dvb-usb/dib0700_devices.c | 326 ++--
 5 files changed, 313 insertions(+), 265 deletions(-)

diff --git a/drivers/media/dvb-frontends/dib7000p.c 
b/drivers/media/dvb-frontends/dib7000p.c
index 4b33bce3a4c6..d36fa0d74259 100644
--- a/drivers/media/dvb-frontends/dib7000p.c
+++ b/drivers/media/dvb-frontends/dib7000p.c
@@ -401,7 +401,7 @@ static int dib7000p_sad_calib(struct dib7000p_state *state)
return 0;
 }
 
-int dib7000p_set_wbd_ref(struct dvb_frontend *demod, u16 value)
+static int dib7000p_set_wbd_ref(struct dvb_frontend *demod, u16 value)
 {
struct dib7000p_state *state = demod->demodulator_priv;
if (value > 4095)
@@ -409,9 +409,8 @@ int dib7000p_set_wbd_ref(struct dvb_frontend *demod, u16 
value)
state->wbd_ref = value;
return dib7000p_write_word(state, 105, (dib7000p_read_word(state, 105) 
& 0xf000) | value);
 }
-EXPORT_SYMBOL(dib7000p_set_wbd_ref);
 
-int dib7000p_get_agc_values(struct dvb_frontend *fe,
+static int dib7000p_get_agc_values(struct dvb_frontend *fe,
u16 *agc_global, u16 *agc1, u16 *agc2, u16 *wbd)
 {
struct dib7000p_state *state = fe->demodulator_priv;
@@ -427,14 +426,12 @@ int dib7000p_get_agc_values(struct dvb_frontend *fe,
 
return 0;
 }
-EXPORT_SYMBOL(dib7000p_get_agc_values);
 
-int dib7000p_set_agc1_min(struct dvb_frontend *fe, u16 v)
+static int dib7000p_set_agc1_min(struct dvb_frontend *fe, u16 v)
 {
struct dib7000p_state *state = fe->demodulator_priv;
return dib7000p_write_word(state, 108,  v);
 }
-EXPORT_SYMBOL(dib7000p_set_agc1_min);
 
 static void dib7000p_reset_pll(struct dib7000p_state *state)
 {
@@ -478,7 +475,7 @@ static u32 dib7000p_get_internal_freq(struct dib7000p_state 
*state)
return internal;
 }
 
-int dib7000p_update_pll(struct dvb_frontend *fe, struct 
dibx000_bandwidth_config *bw)
+static int dib7000p_update_pll(struct dvb_frontend *fe, struct 
dibx000_bandwidth_config *bw)
 {
struct dib7000p_state *state = fe->demodulator_priv;
u16 reg_1857, reg_1856 = dib7000p_read_word(state, 1856);
@@ -513,7 +510,6 @@ int dib7000p_update_pll(struct dvb_frontend *fe, struct 
dibx000_bandwidth_config
}
return -EIO;
 }
-EXPORT_SYMBOL(dib7000p_update_pll);
 
 static int dib7000p_reset_gpio(struct dib7000p_state *st)
 {
@@ -546,12 +542,11 @@ static int dib7000p_cfg_gpio(struct dib7000p_state *st, 
u8 num, u8 dir, u8 val)
return 0;
 }
 
-int dib7000p_set_gpio(struct dvb_frontend *demod, u8 num, u8 dir, u8 val)
+static int dib7000p_set_gpio(struct dvb_frontend *demod, u8 num, u8 dir, u8 
val)
 {
struct dib7000p_state *state = demod->demodulator_priv;
return dib7000p_cfg_gpio(state, num, dir, val);
 }
-EXPORT_SYMBOL(dib7000p_set_gpio);
 
 static u16 dib7000p_defaults[] = {
// auto search configuration
@@ -934,7 +929,7 @@ static void dib7000p_update_timf(struct dib7000p_state 
*state)
 
 }
 
-u32 dib7000p_ctrl_timf(struct dvb_frontend *fe, u8 op, u32 timf)
+static u32 dib7000p_ctrl_timf(struct dvb_frontend *fe, u8 op, u32 timf)
 {
struct dib7000p_state *state = fe->demodulator_priv;
switch (op) {
@@ -950,7 +945,6 @@ u32 dib7000p_ctrl_timf(struct dvb_frontend *fe, u8 op, u32 
timf)
dib7000p_set_bandwidth(state, state->current_bandwidth);
return state->timf;
 }
-EXPORT_SYMBOL(dib7000p_ctrl_timf);
 
 static void dib7000p_set_channel(struct dib7000p_state *state,

[PATCH 4/5] dib8000: rename dib8000_attach to dib8000_init

2014-05-29 Thread Mauro Carvalho Chehab
Well, what we call as "foo_attach" is the method that should
be called by the dvb_attach() macro.

It should be noticed that the name "dvb_attach" is really a
bad name and don't express what it does.

dvb_attach() basically does three things, if the frontend is
compiled as a module:
- It lookups for the module that it is known to have the
  given symbol name and requests such module;
- It increments the module usage (anonymously - so lsmod
  doesn't print who loaded the module);
- after loading the module, it runs the function associated
  with the dynamic symbol.

When compiled as builtin, it just calls the function given to it.

As dvb_attach() increments refcount, it can't be (easily)
called more than once for the same module, or the kernel
will deny to remove the module, because refcount will never
be zeroed.

In other words, the function name given to dvb_attach()
should be one single symbol that will always be called
before any other function on that module to be used.

For almost all DVB frontends, there's just one function,
but, on dib8000, there are several exported symbols.

We need to get rid of all those direct calls, because they
cause compilation breakages when bridge is builtin and
frontend is module, we'll need to add a new function that
will be the first one to be called, whatever initialization
is needed.

So, let's rename this function, in order to prepare for
a next patch that will add a new attach() function that
will be the only one exported by this module.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-frontends/dib8000.c   |  6 ++---
 drivers/media/dvb-frontends/dib8000.h   |  4 +--
 drivers/media/usb/dvb-usb/dib0700_devices.c | 40 ++---
 3 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/media/dvb-frontends/dib8000.c 
b/drivers/media/dvb-frontends/dib8000.c
index 1632d78a5479..c1c8c92ce498 100644
--- a/drivers/media/dvb-frontends/dib8000.c
+++ b/drivers/media/dvb-frontends/dib8000.c
@@ -4405,12 +4405,12 @@ static const struct dvb_frontend_ops dib8000_ops = {
.read_ucblocks = dib8000_read_unc_blocks,
 };
 
-struct dvb_frontend *dib8000_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, 
struct dib8000_config *cfg)
+struct dvb_frontend *dib8000_init(struct i2c_adapter *i2c_adap, u8 i2c_addr, 
struct dib8000_config *cfg)
 {
struct dvb_frontend *fe;
struct dib8000_state *state;
 
-   dprintk("dib8000_attach");
+   dprintk("dib8000_init");
 
state = kzalloc(sizeof(struct dib8000_state), GFP_KERNEL);
if (state == NULL)
@@ -4467,7 +4467,7 @@ error:
return NULL;
 }
 
-EXPORT_SYMBOL(dib8000_attach);
+EXPORT_SYMBOL(dib8000_init);
 
 MODULE_AUTHOR("Olivier Grenie ");
 MODULE_DESCRIPTION("Driver for the DiBcom 8000 ISDB-T demodulator");
diff --git a/drivers/media/dvb-frontends/dib8000.h 
b/drivers/media/dvb-frontends/dib8000.h
index b8c11e52c512..89962d640e4c 100644
--- a/drivers/media/dvb-frontends/dib8000.h
+++ b/drivers/media/dvb-frontends/dib8000.h
@@ -40,7 +40,7 @@ struct dib8000_config {
 #define DEFAULT_DIB8000_I2C_ADDRESS 18
 
 #if IS_ENABLED(CONFIG_DVB_DIB8000)
-extern struct dvb_frontend *dib8000_attach(struct i2c_adapter *i2c_adap, u8 
i2c_addr, struct dib8000_config *cfg);
+extern struct dvb_frontend *dib8000_init(struct i2c_adapter *i2c_adap, u8 
i2c_addr, struct dib8000_config *cfg);
 extern struct i2c_adapter *dib8000_get_i2c_master(struct dvb_frontend *, enum 
dibx000_i2c_interface, int);
 
 extern int dib8000_i2c_enumeration(struct i2c_adapter *host, int no_of_demods,
@@ -65,7 +65,7 @@ extern int dib8000_set_slave_frontend(struct dvb_frontend 
*fe, struct dvb_fronte
 extern int dib8000_remove_slave_frontend(struct dvb_frontend *fe);
 extern struct dvb_frontend *dib8000_get_slave_frontend(struct dvb_frontend 
*fe, int slave_index);
 #else
-static inline struct dvb_frontend *dib8000_attach(struct i2c_adapter 
*i2c_adap, u8 i2c_addr, struct dib8000_config *cfg)
+static inline struct dvb_frontend *dib8000_init(struct i2c_adapter *i2c_adap, 
u8 i2c_addr, struct dib8000_config *cfg)
 {
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c 
b/drivers/media/usb/dvb-usb/dib0700_devices.c
index 111dcc4c7140..424832cb 100644
--- a/drivers/media/usb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/usb/dvb-usb/dib0700_devices.c
@@ -282,7 +282,7 @@ static int stk7700P2_frontend_attach(struct dvb_usb_adapter 
*adap)
 stk7700d_dib7000p_mt2266_config)
!= 0) {
err("%s: state->dib7000p_ops.i2c_enumeration failed.  
Cannot continue\n", __func__);
-   dvb_detach(dib7000p_attach);
+   dvb_detach(&state->dib7000p_ops);;
return -ENODEV;
}
}
@@ -316,7 +316,7 @@ static int stk7700d_frontend_attach(struct dvb_u

[PATCH 2/5] dib7000p: rename dib7000p_attach to dib7000p_init

2014-05-29 Thread Mauro Carvalho Chehab
Well, what we call as "foo_attach" is the method that should
be called by the dvb_attach() macro.

It should be noticed that the name "dvb_attach" is really a
bad name and don't express what it does.

dvb_attach() basically does three things, if the frontend is
compiled as a module:
- It lookups for the module that it is known to have the
  given symbol name and requests such module;
- It increments the module usage (anonymously - so lsmod
  doesn't print who loaded the module);
- after loading the module, it runs the function associated
  with the dynamic symbol.

When compiled as builtin, it just calls the function given to it.

As dvb_attach() increments refcount, it can't be (easily)
called more than once for the same module, or the kernel
will deny to remove the module, because refcount will never
be zeroed.

In other words, the function name given to dvb_attach()
should be one single symbol that will always be called
before any other function on that module to be used.

For almost all DVB frontends, there's just one function.

However, the dib7000p initialization can require up to 3
functions to be called:
- dib7000p_get_i2c_master;
- dib7000p_i2c_enumeration;
- dib7000p_init (before this patch dib7000_attach).

(plus a bunch of other functions that the bridge driver will
need to call).

As we need to get rid of all those direct calls, because they
cause compilation breakages when bridge is builtin and
frontend is module, we'll need to add a new function that
will be the first one to be called, whatever initialization
is needed.

So, let's rename the function that probes and init the hardware
to dib7000p_init.

A latter patch will add a new dib7000p_attach that will be
used as originally conceived by dvb_attach() way.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-frontends/dib7000p.c  |  4 ++--
 drivers/media/dvb-frontends/dib7000p.h  |  4 ++--
 drivers/media/pci/cx23885/cx23885-dvb.c |  2 +-
 drivers/media/usb/dvb-usb/cxusb.c   |  2 +-
 drivers/media/usb/dvb-usb/dib0700_devices.c | 28 ++--
 5 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/media/dvb-frontends/dib7000p.c 
b/drivers/media/dvb-frontends/dib7000p.c
index effb87f773b0..4b33bce3a4c6 100644
--- a/drivers/media/dvb-frontends/dib7000p.c
+++ b/drivers/media/dvb-frontends/dib7000p.c
@@ -2374,7 +2374,7 @@ int dib7090_slave_reset(struct dvb_frontend *fe)
 EXPORT_SYMBOL(dib7090_slave_reset);
 
 static struct dvb_frontend_ops dib7000p_ops;
-struct dvb_frontend *dib7000p_attach(struct i2c_adapter *i2c_adap, u8 
i2c_addr, struct dib7000p_config *cfg)
+struct dvb_frontend *dib7000p_init(struct i2c_adapter *i2c_adap, u8 i2c_addr, 
struct dib7000p_config *cfg)
 {
struct dvb_frontend *demod;
struct dib7000p_state *st;
@@ -2434,7 +2434,7 @@ error:
kfree(st);
return NULL;
 }
-EXPORT_SYMBOL(dib7000p_attach);
+EXPORT_SYMBOL(dib7000p_init);
 
 static struct dvb_frontend_ops dib7000p_ops = {
.delsys = { SYS_DVBT },
diff --git a/drivers/media/dvb-frontends/dib7000p.h 
b/drivers/media/dvb-frontends/dib7000p.h
index d08cdff59bdf..583c94e8eca5 100644
--- a/drivers/media/dvb-frontends/dib7000p.h
+++ b/drivers/media/dvb-frontends/dib7000p.h
@@ -47,7 +47,7 @@ struct dib7000p_config {
 #define DEFAULT_DIB7000P_I2C_ADDRESS 18
 
 #if IS_ENABLED(CONFIG_DVB_DIB7000P)
-extern struct dvb_frontend *dib7000p_attach(struct i2c_adapter *i2c_adap, u8 
i2c_addr, struct dib7000p_config *cfg);
+extern struct dvb_frontend *dib7000p_init(struct i2c_adapter *i2c_adap, u8 
i2c_addr, struct dib7000p_config *cfg);
 extern struct i2c_adapter *dib7000p_get_i2c_master(struct dvb_frontend *, enum 
dibx000_i2c_interface, int);
 extern int dib7000p_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods, 
u8 default_addr, struct dib7000p_config cfg[]);
 extern int dib7000p_set_gpio(struct dvb_frontend *, u8 num, u8 dir, u8 val);
@@ -65,7 +65,7 @@ extern int dib7000p_get_agc_values(struct dvb_frontend *fe,
u16 *agc_global, u16 *agc1, u16 *agc2, u16 *wbd);
 extern int dib7000p_set_agc1_min(struct dvb_frontend *fe, u16 v);
 #else
-static inline struct dvb_frontend *dib7000p_attach(struct i2c_adapter 
*i2c_adap, u8 i2c_addr, struct dib7000p_config *cfg)
+static inline struct dvb_frontend *dib7000p_init(struct i2c_adapter *i2c_adap, 
u8 i2c_addr, struct dib7000p_config *cfg)
 {
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c 
b/drivers/media/pci/cx23885/cx23885-dvb.c
index 4be01b3bd4f5..69e526391c12 100644
--- a/drivers/media/pci/cx23885/cx23885-dvb.c
+++ b/drivers/media/pci/cx23885/cx23885-dvb.c
@@ -925,7 +925,7 @@ static int dvb_register(struct cx23885_tsport *port)
break;
case CX23885_BOARD_HAUPPAUGE_HVR1400:
i2c_bus = &dev->i2c_bus[0];
-   fe0->dvb.frontend = dvb_attach(dib7000p_at

Pinnacle 320cx -- /dev/video ?

2014-05-29 Thread Marek Kozlowski
:-)

According to:
http://www.linuxtv.org/wiki/index.php/TerraTec_Cinergy_T_USB_RC

Pinnacle Expresscard 320cx  ✔ Yes, in kernel since 2.6.26   2304:022e
USB2.0  dvb-usb-dib0700-1.20.fw

I've just bought this card and it is correctly recognized and
initialized, however it doesn't work. Precisely: tvtime and similar
applications say: `no video device' and no /dev/video0 nor similar
device files are created. Does the _analog_ part work? Am I missing sth?

/m

May 29 14:06:32 localhost kernel: [   35.839778] dvb-usb: found a
'Pinnacle Expresscard 320cx' in cold state, will try to load a firmware
May 29 14:06:32 localhost kernel: [   35.857310] dvb-usb: downloading
firmware from file 'dvb-usb-dib0700-1.20.fw'
May 29 14:06:33 localhost kernel: [   36.058772] dib0700: firmware
started successfully.
May 29 14:06:33 localhost kernel: [   36.560345] dvb-usb: found a
'Pinnacle Expresscard 320cx' in warm state.
May 29 14:06:33 localhost kernel: [   36.560485] dvb-usb: will pass the
complete MPEG2 transport stream to the software demuxer.
May 29 14:06:33 localhost kernel: [   36.560671] DVB: registering new
adapter (Pinnacle Expresscard 320cx)
May 29 14:06:33 localhost kernel: [   36.803166] usb 2-2: DVB:
registering adapter 0 frontend 0 (DiBcom 7000PC)...
May 29 14:06:33 localhost kernel: [   36.865296] xc2028 9-0061: creating
new instance
May 29 14:06:33 localhost kernel: [   36.865300] xc2028 9-0061: type set
to XCeive xc2028/xc3028 tuner
May 29 14:06:33 localhost kernel: [   36.884811] xc2028 9-0061: Loading
80 firmware images from xc3028-v27.fw, type: xc2028 firmware, ver 2.7
May 29 14:06:33 localhost kernel: [   36.906762] Registered IR keymap
rc-dib0700-rc5
May 29 14:06:33 localhost kernel: [   36.907126] input: IR-receiver
inside an USB DVB receiver as
/devices/pci:00/:00:1a.7/usb2/2-2/rc/rc0/input15
May 29 14:06:33 localhost kernel: [   36.908238] rc0: IR-receiver inside
an USB DVB receiver as /devices/pci:00/:00:1a.7/usb2/2-2/rc/rc0
May 29 14:06:33 localhost kernel: [   36.908411] dvb-usb: schedule
remote query interval to 50 msecs.
May 29 14:06:33 localhost kernel: [   36.908419] dvb-usb: Pinnacle
Expresscard 320cx successfully initialized and connected.
May 29 14:06:33 localhost kernel: [   36.908603] usbcore: registered new
interface driver dvb_usb_dib0700
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Pinnacle 320cx -- /dev/video ?

2014-05-29 Thread Devin Heitmueller
> According to:
> http://www.linuxtv.org/wiki/index.php/TerraTec_Cinergy_T_USB_RC
>
> Pinnacle Expresscard 320cx  ✔ Yes, in kernel since 2.6.26   2304:022e
> USB2.0  dvb-usb-dib0700-1.20.fw
>
> I've just bought this card and it is correctly recognized and
> initialized, however it doesn't work. Precisely: tvtime and similar
> applications say: `no video device' and no /dev/video0 nor similar
> device files are created. Does the _analog_ part work? Am I missing sth?

There is no Linux support for the analog video capture with the
dib0700 driver.  Hence you will only be able to use that device for
digital reception.

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] dvbv5-zap fix option lnb UNIVERSAL

2014-05-29 Thread Jose Alberto Reguero
This patch fix the option lnb UNIVERSAL for dvbv5-zap. Without the patch, the 
option don't work.

Signed-off-by: Jose Alberto Reguero 

diff --git a/utils/dvb/dvbv5-zap.c b/utils/dvb/dvbv5-zap.c
index 14e8fd9..085bbf2 100644
--- a/utils/dvb/dvbv5-zap.c
+++ b/utils/dvb/dvbv5-zap.c
@@ -773,7 +773,7 @@ int main(int argc, char **argv)
parms = dvb_fe_open(args.adapter, args.frontend, args.verbose, 
args.force_dvbv3);
if (!parms)
goto err;
-   if (lnb)
+   if (lnb >= 0)
parms->lnb = dvb_sat_get_lnb(lnb);
if (args.sat_number > 0)
parms->sat_number = args.sat_number % 3;

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


Re: [PATCH] [media] videobuf2-dma-contig: allow to vmap contiguous dma buffers

2014-05-29 Thread Marek Szyprowski

Hello,

On 2014-05-26 16:17, Philipp Zabel wrote:

This allows drivers to vmap contiguous dma buffers so they can inspect the
buffer contents with the CPU. This will be needed for the CODA driver's JPEG
handling. On CODA960, the header parsing has to be done on the CPU. The
hardware modules can only process the entropy coded segment after all
registers and tables are set up.

Signed-off-by: Philipp Zabel 


Acked-by: Marek Szyprowski 


---
  drivers/media/v4l2-core/videobuf2-dma-contig.c | 8 
  1 file changed, 8 insertions(+)

diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c 
b/drivers/media/v4l2-core/videobuf2-dma-contig.c
index 880be07..6b254b8 100644
--- a/drivers/media/v4l2-core/videobuf2-dma-contig.c
+++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c
@@ -98,6 +98,9 @@ static void *vb2_dc_vaddr(void *buf_priv)
  {
struct vb2_dc_buf *buf = buf_priv;
  
+	if (!buf->vaddr && buf->db_attach)

+   buf->vaddr = dma_buf_vmap(buf->db_attach->dmabuf);
+
return buf->vaddr;
  }
  
@@ -735,6 +738,7 @@ static int vb2_dc_map_dmabuf(void *mem_priv)
  
  	buf->dma_addr = sg_dma_address(sgt->sgl);

buf->dma_sgt = sgt;
+   buf->vaddr = NULL;
  
  	return 0;

  }
@@ -754,6 +758,10 @@ static void vb2_dc_unmap_dmabuf(void *mem_priv)
return;
}
  
+	if (buf->vaddr) {

+   dma_buf_vunmap(buf->db_attach->dmabuf, buf->vaddr);
+   buf->vaddr = NULL;
+   }
dma_buf_unmap_attachment(buf->db_attach, sgt, buf->dma_dir);
  
  	buf->dma_addr = 0;


Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

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


[PATCH v3 1/3] v4l: Add test pattern colour component controls

2014-05-29 Thread Sakari Ailus
In many cases the test pattern has selectable values for each colour
component. Implement controls for raw bayer components. Additional controls
should be defined for colour components that are not covered by these
controls.

Signed-off-by: Sakari Ailus 
---
 Documentation/DocBook/media/v4l/controls.xml | 34 
 drivers/media/v4l2-core/v4l2-ctrls.c |  4 
 include/uapi/linux/v4l2-controls.h   |  4 
 3 files changed, 42 insertions(+)

diff --git a/Documentation/DocBook/media/v4l/controls.xml 
b/Documentation/DocBook/media/v4l/controls.xml
index 47198ee..bf23994 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -4677,6 +4677,40 @@ interface and may change in the future.
conversion.

  
+ 
+   V4L2_CID_TEST_PATTERN_RED
+   integer
+ 
+ 
+   Test pattern red colour component.
+   
+ 
+ 
+   V4L2_CID_TEST_PATTERN_GREENR
+   integer
+ 
+ 
+   Test pattern green (next to red)
+   colour component.
+   
+ 
+ 
+   V4L2_CID_TEST_PATTERN_BLUE
+   integer
+ 
+ 
+   Test pattern blue colour component.
+   
+ 
+ 
+   V4L2_CID_TEST_PATTERN_GREENB
+   integer
+ 
+ 
+   Test pattern green (next to blue)
+   colour component.
+   
+ 
  

   
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index 55c6832..a4104a7 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -839,6 +839,10 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_VBLANK:   return "Vertical Blanking";
case V4L2_CID_HBLANK:   return "Horizontal Blanking";
case V4L2_CID_ANALOGUE_GAIN:return "Analogue Gain";
+   case V4L2_CID_TEST_PATTERN_RED: return "Red Pixel Value";
+   case V4L2_CID_TEST_PATTERN_GREENR:  return "Green (Red) Pixel 
Value";
+   case V4L2_CID_TEST_PATTERN_BLUE:return "Blue Pixel Value";
+   case V4L2_CID_TEST_PATTERN_GREENB:  return "Green (Blue) Pixel 
Value";
 
/* Image processing controls */
case V4L2_CID_IMAGE_PROC_CLASS: return "Image Processing 
Controls";
diff --git a/include/uapi/linux/v4l2-controls.h 
b/include/uapi/linux/v4l2-controls.h
index 2ac5597..5c55a19 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -855,6 +855,10 @@ enum v4l2_jpeg_chroma_subsampling {
 #define V4L2_CID_VBLANK
(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 1)
 #define V4L2_CID_HBLANK
(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 2)
 #define V4L2_CID_ANALOGUE_GAIN 
(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 3)
+#define V4L2_CID_TEST_PATTERN_RED  
(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 4)
+#define V4L2_CID_TEST_PATTERN_GREENR   
(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 5)
+#define V4L2_CID_TEST_PATTERN_BLUE 
(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 6)
+#define V4L2_CID_TEST_PATTERN_GREENB   
(V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 7)
 
 
 /* Image processing controls */
-- 
1.8.3.2

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


[PATCH v3 0/3] smiapp test pattern support

2014-05-29 Thread Sakari Ailus
Hi,

These patches add four standard controls for test pattern raw bayer colour
component values and test pattern support for the smiapp driver.
Additionally, definitions are provided to control the smiapp driver's test
pattern menu, the items of which are driver specific.

Also the location of the header file has been fixed in the 2nd patch. 

The new controls are located in the image source class (vs. the image
processing class where the test pattern control is). I do prefer consistency
but when it's in conflict with correctness, the latter often wins. :-)

Kind regards,
Sakari

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


[PATCH v3 2/3] smiapp: Add driver-specific test pattern menu item definitions

2014-05-29 Thread Sakari Ailus
Add numeric definitions for menu items used in the smiapp driver's test
pattern menu.

Signed-off-by: Sakari Ailus 
---
 include/uapi/linux/smiapp.h | 29 +
 1 file changed, 29 insertions(+)
 create mode 100644 include/uapi/linux/smiapp.h

diff --git a/include/uapi/linux/smiapp.h b/include/uapi/linux/smiapp.h
new file mode 100644
index 000..53938f4
--- /dev/null
+++ b/include/uapi/linux/smiapp.h
@@ -0,0 +1,29 @@
+/*
+ * include/uapi/linux/smiapp.h
+ *
+ * Generic driver for SMIA/SMIA++ compliant camera modules
+ *
+ * Copyright (C) 2014 Intel Corporation
+ * Contact: Sakari Ailus 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef __UAPI_LINUX_SMIAPP_H_
+#define __UAPI_LINUX_SMIAPP_H_
+
+#define V4L2_SMIAPP_TEST_PATTERN_MODE_DISABLED 0
+#define V4L2_SMIAPP_TEST_PATTERN_MODE_SOLID_COLOUR 1
+#define V4L2_SMIAPP_TEST_PATTERN_MODE_COLOUR_BARS  2
+#define V4L2_SMIAPP_TEST_PATTERN_MODE_COLOUR_BARS_GREY 3
+#define V4L2_SMIAPP_TEST_PATTERN_MODE_PN9  4
+
+#endif /* __UAPI_LINUX_SMIAPP_H_ */
-- 
1.8.3.2

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


[PATCH v3 3/3] smiapp: Implement the test pattern control

2014-05-29 Thread Sakari Ailus
Add support for the V4L2_CID_TEST_PATTERN control. When the solid colour
mode is selected, additional controls become available for setting the
solid four solid colour components.

Signed-off-by: Sakari Ailus 
Acked-by: Hans Verkuil 
---
 drivers/media/i2c/smiapp/smiapp-core.c | 84 --
 drivers/media/i2c/smiapp/smiapp.h  |  4 ++
 2 files changed, 84 insertions(+), 4 deletions(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index 446c82c..dc82adb 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -404,6 +404,16 @@ static void smiapp_update_mbus_formats(struct 
smiapp_sensor *sensor)
pixel_order_str[pixel_order]);
 }
 
+static const char * const smiapp_test_patterns[] = {
+   "Disabled",
+   "Solid Colour",
+   "Eight Vertical Colour Bars",
+   "Colour Bars With Fade to Grey",
+   "Pseudorandom Sequence (PN9)",
+};
+
+static const struct v4l2_ctrl_ops smiapp_ctrl_ops;
+
 static int smiapp_set_ctrl(struct v4l2_ctrl *ctrl)
 {
struct smiapp_sensor *sensor =
@@ -477,6 +487,35 @@ static int smiapp_set_ctrl(struct v4l2_ctrl *ctrl)
 
return smiapp_pll_update(sensor);
 
+   case V4L2_CID_TEST_PATTERN: {
+   unsigned int i;
+
+   for (i = 0; i < ARRAY_SIZE(sensor->test_data); i++)
+   v4l2_ctrl_activate(
+   sensor->test_data[i],
+   ctrl->val ==
+   V4L2_SMIAPP_TEST_PATTERN_MODE_SOLID_COLOUR);
+
+   return smiapp_write(
+   sensor, SMIAPP_REG_U16_TEST_PATTERN_MODE, ctrl->val);
+   }
+
+   case V4L2_CID_TEST_PATTERN_RED:
+   return smiapp_write(
+   sensor, SMIAPP_REG_U16_TEST_DATA_RED, ctrl->val);
+
+   case V4L2_CID_TEST_PATTERN_GREENR:
+   return smiapp_write(
+   sensor, SMIAPP_REG_U16_TEST_DATA_GREENR, ctrl->val);
+
+   case V4L2_CID_TEST_PATTERN_BLUE:
+   return smiapp_write(
+   sensor, SMIAPP_REG_U16_TEST_DATA_BLUE, ctrl->val);
+
+   case V4L2_CID_TEST_PATTERN_GREENB:
+   return smiapp_write(
+   sensor, SMIAPP_REG_U16_TEST_DATA_GREENB, ctrl->val);
+
default:
return -EINVAL;
}
@@ -489,10 +528,10 @@ static const struct v4l2_ctrl_ops smiapp_ctrl_ops = {
 static int smiapp_init_controls(struct smiapp_sensor *sensor)
 {
struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd);
-   unsigned int max;
+   unsigned int max, i;
int rval;
 
-   rval = v4l2_ctrl_handler_init(&sensor->pixel_array->ctrl_handler, 7);
+   rval = v4l2_ctrl_handler_init(&sensor->pixel_array->ctrl_handler, 12);
if (rval)
return rval;
sensor->pixel_array->ctrl_handler.lock = &sensor->mutex;
@@ -535,6 +574,18 @@ static int smiapp_init_controls(struct smiapp_sensor 
*sensor)
&sensor->pixel_array->ctrl_handler, &smiapp_ctrl_ops,
V4L2_CID_PIXEL_RATE, 0, 0, 1, 0);
 
+   v4l2_ctrl_new_std_menu_items(&sensor->pixel_array->ctrl_handler,
+&smiapp_ctrl_ops, V4L2_CID_TEST_PATTERN,
+ARRAY_SIZE(smiapp_test_patterns) - 1,
+0, 0, smiapp_test_patterns);
+
+   for (i = 0; i < ARRAY_SIZE(sensor->test_data); i++)
+   sensor->test_data[i] =
+   v4l2_ctrl_new_std(&sensor->pixel_array->ctrl_handler,
+ &smiapp_ctrl_ops,
+ V4L2_CID_TEST_PATTERN_RED + i,
+ 0, 0, 1, 0);
+
if (sensor->pixel_array->ctrl_handler.error) {
dev_err(&client->dev,
"pixel array controls initialization failed (%d)\n",
@@ -543,6 +594,14 @@ static int smiapp_init_controls(struct smiapp_sensor 
*sensor)
goto error;
}
 
+   for (i = 0; i < ARRAY_SIZE(sensor->test_data); i++) {
+   struct v4l2_ctrl *ctrl = sensor->test_data[i];
+
+   ctrl->maximum =
+   ctrl->default_value =
+   ctrl->cur.val = (1 << sensor->csi_format->width) - 1;
+   }
+
sensor->pixel_array->sd.ctrl_handler =
&sensor->pixel_array->ctrl_handler;
 
@@ -1670,17 +1729,34 @@ static int smiapp_set_format(struct v4l2_subdev *subdev,
if (fmt->pad == ssd->source_pad) {
u32 code = fmt->format.code;
int rval = __smiapp_get_format(subdev, fh, fmt);
+   bool range_changed = false;
+   unsigned int i;
 
if (!rval && subdev == &sensor->src->sd) {
const struct smiapp_csi_data_format *csi_

Re: [PATCH v3 1/3] v4l: Add test pattern colour component controls

2014-05-29 Thread Laurent Pinchart
Hi Sakari,

Thank you for the patch.

On Thursday 29 May 2014 17:40:46 Sakari Ailus wrote:
> In many cases the test pattern has selectable values for each colour
> component. Implement controls for raw bayer components. Additional controls
> should be defined for colour components that are not covered by these
> controls.
>
> Signed-off-by: Sakari Ailus 
> ---
>  Documentation/DocBook/media/v4l/controls.xml | 34 +
>  drivers/media/v4l2-core/v4l2-ctrls.c |  4 
>  include/uapi/linux/v4l2-controls.h   |  4 
>  3 files changed, 42 insertions(+)
> 
> diff --git a/Documentation/DocBook/media/v4l/controls.xml
> b/Documentation/DocBook/media/v4l/controls.xml index 47198ee..bf23994
> 100644
> --- a/Documentation/DocBook/media/v4l/controls.xml
> +++ b/Documentation/DocBook/media/v4l/controls.xml
> @@ -4677,6 +4677,40 @@ interface and may change in the future.
>   conversion.
>   
> 
> +   
> +  spanname="id">V4L2_CID_TEST_PATTERN_RED +
>
> integer
> +   
> +   
> + Test pattern red colour component.
> + 
> +   
> +   
> +  spanname="id">V4L2_CID_TEST_PATTERN_GREENR
> + integer
> +   
> +   
> + Test pattern green (next to red)
> + colour component.

What about non-Bayer RGB sensors ? Should they use the GREENR or the GREENB 
control for the green component ? Or a different control ?

I'm wondering whether we shouldn't have a single test pattern color control 
and create a color type using Hans' complex controls API.

> + 
> +   
> +   
> +  spanname="id">V4L2_CID_TEST_PATTERN_BLUE +   
>
> integer
> +   
> +   
> + Test pattern blue colour component.
> + 
> +   
> +   
> +  spanname="id">V4L2_CID_TEST_PATTERN_GREENB + 
>  
>   integer
> +   
> +   
> + Test pattern green (next to blue)
> + colour component.
> + 
> +   
> 
>   
>
> diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c
> b/drivers/media/v4l2-core/v4l2-ctrls.c index 55c6832..a4104a7 100644
> --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> @@ -839,6 +839,10 @@ const char *v4l2_ctrl_get_name(u32 id)
>   case V4L2_CID_VBLANK:   return "Vertical Blanking";
>   case V4L2_CID_HBLANK:   return "Horizontal Blanking";
>   case V4L2_CID_ANALOGUE_GAIN:return "Analogue Gain";
> + case V4L2_CID_TEST_PATTERN_RED: return "Red Pixel Value";
> + case V4L2_CID_TEST_PATTERN_GREENR:  return "Green (Red) Pixel 
> Value";
> + case V4L2_CID_TEST_PATTERN_BLUE:return "Blue Pixel Value";
> + case V4L2_CID_TEST_PATTERN_GREENB:  return "Green (Blue) Pixel 
> Value";
> 
>   /* Image processing controls */
>   case V4L2_CID_IMAGE_PROC_CLASS: return "Image Processing 
> Controls";
> diff --git a/include/uapi/linux/v4l2-controls.h
> b/include/uapi/linux/v4l2-controls.h index 2ac5597..5c55a19 100644
> --- a/include/uapi/linux/v4l2-controls.h
> +++ b/include/uapi/linux/v4l2-controls.h
> @@ -855,6 +855,10 @@ enum v4l2_jpeg_chroma_subsampling {
>  #define V4L2_CID_VBLANK  
> (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 1)
>  #define V4L2_CID_HBLANK  
> (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 2)
>  #define V4L2_CID_ANALOGUE_GAIN   
> (V4L2_CID_IMAGE_SOURCE_CLASS_BASE 
+ 3)
> +#define V4L2_CID_TEST_PATTERN_RED
> (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 
4)
> +#define V4L2_CID_TEST_PATTERN_GREENR 
> (V4L2_CID_IMAGE_SOURCE_CLASS_BASE 
+
> 5) +#define V4L2_CID_TEST_PATTERN_BLUE
> (V4L2_CID_IMAGE_SOURCE_CLASS_BASE 
+
> 6) +#define V4L2_CID_TEST_PATTERN_GREENB  
(V4L2_CID_IMAGE_SOURCE_CLASS_BASE
> + 7)
> 
> 
>  /* Image processing controls */

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH v3 2/3] smiapp: Add driver-specific test pattern menu item definitions

2014-05-29 Thread Laurent Pinchart
On Thursday 29 May 2014 17:40:47 Sakari Ailus wrote:
> Add numeric definitions for menu items used in the smiapp driver's test
> pattern menu.
> 
> Signed-off-by: Sakari Ailus 

Acked-by: Laurent Pinchart 

> ---
>  include/uapi/linux/smiapp.h | 29 +
>  1 file changed, 29 insertions(+)
>  create mode 100644 include/uapi/linux/smiapp.h
> 
> diff --git a/include/uapi/linux/smiapp.h b/include/uapi/linux/smiapp.h
> new file mode 100644
> index 000..53938f4
> --- /dev/null
> +++ b/include/uapi/linux/smiapp.h
> @@ -0,0 +1,29 @@
> +/*
> + * include/uapi/linux/smiapp.h
> + *
> + * Generic driver for SMIA/SMIA++ compliant camera modules
> + *
> + * Copyright (C) 2014 Intel Corporation
> + * Contact: Sakari Ailus 
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * version 2 as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * General Public License for more details.
> + *
> + */
> +
> +#ifndef __UAPI_LINUX_SMIAPP_H_
> +#define __UAPI_LINUX_SMIAPP_H_
> +
> +#define V4L2_SMIAPP_TEST_PATTERN_MODE_DISABLED   0
> +#define V4L2_SMIAPP_TEST_PATTERN_MODE_SOLID_COLOUR   1
> +#define V4L2_SMIAPP_TEST_PATTERN_MODE_COLOUR_BARS2
> +#define V4L2_SMIAPP_TEST_PATTERN_MODE_COLOUR_BARS_GREY   3
> +#define V4L2_SMIAPP_TEST_PATTERN_MODE_PN94

Out of curiosity, what's PN9 ?

> +
> +#endif /* __UAPI_LINUX_SMIAPP_H_ */

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH v3 3/3] smiapp: Implement the test pattern control

2014-05-29 Thread Laurent Pinchart
Hi Sakari,

Thank you for the patch.

On Thursday 29 May 2014 17:40:48 Sakari Ailus wrote:
> Add support for the V4L2_CID_TEST_PATTERN control. When the solid colour
> mode is selected, additional controls become available for setting the
> solid four solid colour components.
> 
> Signed-off-by: Sakari Ailus 
> Acked-by: Hans Verkuil 
> ---
>  drivers/media/i2c/smiapp/smiapp-core.c | 84 +--
>  drivers/media/i2c/smiapp/smiapp.h  |  4 ++
>  2 files changed, 84 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/i2c/smiapp/smiapp-core.c
> b/drivers/media/i2c/smiapp/smiapp-core.c index 446c82c..dc82adb 100644
> --- a/drivers/media/i2c/smiapp/smiapp-core.c
> +++ b/drivers/media/i2c/smiapp/smiapp-core.c
> @@ -404,6 +404,16 @@ static void smiapp_update_mbus_formats(struct
> smiapp_sensor *sensor) pixel_order_str[pixel_order]);
>  }
> 
> +static const char * const smiapp_test_patterns[] = {
> + "Disabled",
> + "Solid Colour",
> + "Eight Vertical Colour Bars",
> + "Colour Bars With Fade to Grey",
> + "Pseudorandom Sequence (PN9)",
> +};
> +
> +static const struct v4l2_ctrl_ops smiapp_ctrl_ops;

Is this needed ?

> +
>  static int smiapp_set_ctrl(struct v4l2_ctrl *ctrl)
>  {
>   struct smiapp_sensor *sensor =
> @@ -477,6 +487,35 @@ static int smiapp_set_ctrl(struct v4l2_ctrl *ctrl)
> 
>   return smiapp_pll_update(sensor);
> 
> + case V4L2_CID_TEST_PATTERN: {
> + unsigned int i;
> +
> + for (i = 0; i < ARRAY_SIZE(sensor->test_data); i++)
> + v4l2_ctrl_activate(
> + sensor->test_data[i],
> + ctrl->val ==
> + V4L2_SMIAPP_TEST_PATTERN_MODE_SOLID_COLOUR);
> +
> + return smiapp_write(
> + sensor, SMIAPP_REG_U16_TEST_PATTERN_MODE, ctrl->val);
> + }
> +
> + case V4L2_CID_TEST_PATTERN_RED:
> + return smiapp_write(
> + sensor, SMIAPP_REG_U16_TEST_DATA_RED, ctrl->val);
> +
> + case V4L2_CID_TEST_PATTERN_GREENR:
> + return smiapp_write(
> + sensor, SMIAPP_REG_U16_TEST_DATA_GREENR, ctrl->val);
> +
> + case V4L2_CID_TEST_PATTERN_BLUE:
> + return smiapp_write(
> + sensor, SMIAPP_REG_U16_TEST_DATA_BLUE, ctrl->val);
> +
> + case V4L2_CID_TEST_PATTERN_GREENB:
> + return smiapp_write(
> + sensor, SMIAPP_REG_U16_TEST_DATA_GREENB, ctrl->val);
> +
>   default:
>   return -EINVAL;
>   }
> @@ -489,10 +528,10 @@ static const struct v4l2_ctrl_ops smiapp_ctrl_ops = {
>  static int smiapp_init_controls(struct smiapp_sensor *sensor)
>  {
>   struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd);
> - unsigned int max;
> + unsigned int max, i;
>   int rval;
> 
> - rval = v4l2_ctrl_handler_init(&sensor->pixel_array->ctrl_handler, 7);
> + rval = v4l2_ctrl_handler_init(&sensor->pixel_array->ctrl_handler, 12);
>   if (rval)
>   return rval;
>   sensor->pixel_array->ctrl_handler.lock = &sensor->mutex;
> @@ -535,6 +574,18 @@ static int smiapp_init_controls(struct smiapp_sensor
> *sensor) &sensor->pixel_array->ctrl_handler, &smiapp_ctrl_ops,
>   V4L2_CID_PIXEL_RATE, 0, 0, 1, 0);
> 
> + v4l2_ctrl_new_std_menu_items(&sensor->pixel_array->ctrl_handler,
> +  &smiapp_ctrl_ops, V4L2_CID_TEST_PATTERN,
> +  ARRAY_SIZE(smiapp_test_patterns) - 1,
> +  0, 0, smiapp_test_patterns);
> +
> + for (i = 0; i < ARRAY_SIZE(sensor->test_data); i++)
> + sensor->test_data[i] =
> + v4l2_ctrl_new_std(&sensor->pixel_array->ctrl_handler,
> +   &smiapp_ctrl_ops,
> +   V4L2_CID_TEST_PATTERN_RED + i,
> +   0, 0, 1, 0);
> +
>   if (sensor->pixel_array->ctrl_handler.error) {
>   dev_err(&client->dev,
>   "pixel array controls initialization failed (%d)\n",
> @@ -543,6 +594,14 @@ static int smiapp_init_controls(struct smiapp_sensor
> *sensor) goto error;
>   }
> 
> + for (i = 0; i < ARRAY_SIZE(sensor->test_data); i++) {
> + struct v4l2_ctrl *ctrl = sensor->test_data[i];
> +
> + ctrl->maximum =
> + ctrl->default_value =
> + ctrl->cur.val = (1 << sensor->csi_format->width) - 1;

I think multiple assignments on the same line are discouraged.

Furthermore, couldn't you move this above and use the right values directly 
when creating the controls ?

> + }
> +
>   sensor->pixel_array->sd.ctrl_handler =
>   &sensor->pixel_array->ctrl_handler;
> 
> @@ -1670,17 +1729,34 @@ static int smiapp_set_format(struct v4l2_subdev
> *subdev, if (fmt->pad == ssd->source_p

Re: [PATCH v3 1/3] v4l: Add test pattern colour component controls

2014-05-29 Thread Sakari Ailus

Hi Laurent,

Thanks for your comments.

Laurent Pinchart wrote:

Hi Sakari,

Thank you for the patch.

On Thursday 29 May 2014 17:40:46 Sakari Ailus wrote:

In many cases the test pattern has selectable values for each colour
component. Implement controls for raw bayer components. Additional controls
should be defined for colour components that are not covered by these
controls.

Signed-off-by: Sakari Ailus 
---
  Documentation/DocBook/media/v4l/controls.xml | 34 +
  drivers/media/v4l2-core/v4l2-ctrls.c |  4 
  include/uapi/linux/v4l2-controls.h   |  4 
  3 files changed, 42 insertions(+)

diff --git a/Documentation/DocBook/media/v4l/controls.xml
b/Documentation/DocBook/media/v4l/controls.xml index 47198ee..bf23994
100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -4677,6 +4677,40 @@ interface and may change in the future.
conversion.

  
+ 
+   V4L2_CID_TEST_PATTERN_RED +   
integer
+ 
+ 
+   Test pattern red colour component.
+   
+ 
+ 
+   V4L2_CID_TEST_PATTERN_GREENR
+   integer
+ 
+ 
+   Test pattern green (next to red)
+   colour component.


What about non-Bayer RGB sensors ? Should they use the GREENR or the GREENB
control for the green component ? Or a different control ?


A different one. It should be simply green. I could add it to the same 
patch if you wish.



I'm wondering whether we shouldn't have a single test pattern color control
and create a color type using Hans' complex controls API.


A raw bayer four-pixel value, you mean?

--
Regards,

Sakari Ailus
sakari.ai...@linux.intel.com
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 3/3] smiapp: Implement the test pattern control

2014-05-29 Thread Sakari Ailus

Laurent Pinchart wrote:

@@ -404,6 +404,16 @@ static void smiapp_update_mbus_formats(struct
smiapp_sensor *sensor) pixel_order_str[pixel_order]);
  }

+static const char * const smiapp_test_patterns[] = {
+   "Disabled",
+   "Solid Colour",
+   "Eight Vertical Colour Bars",
+   "Colour Bars With Fade to Grey",
+   "Pseudorandom Sequence (PN9)",
+};
+
+static const struct v4l2_ctrl_ops smiapp_ctrl_ops;


Is this needed ?


Not anymore. It was necessary when there was configuration information 
for custom controls. I'll remove it.


--
Sakari Ailus
sakari.ai...@linux.intel.com
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 1/3] v4l: Add test pattern colour component controls

2014-05-29 Thread Laurent Pinchart
On Thursday 29 May 2014 17:58:59 Sakari Ailus wrote:
> Laurent Pinchart wrote:
> > On Thursday 29 May 2014 17:40:46 Sakari Ailus wrote:
> >> In many cases the test pattern has selectable values for each colour
> >> component. Implement controls for raw bayer components. Additional
> >> controls
> >> should be defined for colour components that are not covered by these
> >> controls.
> >> 
> >> Signed-off-by: Sakari Ailus 
> >> ---
> >> 
> >>   Documentation/DocBook/media/v4l/controls.xml | 34 +
> >>   drivers/media/v4l2-core/v4l2-ctrls.c |  4 
> >>   include/uapi/linux/v4l2-controls.h   |  4 
> >>   3 files changed, 42 insertions(+)
> >> 
> >> diff --git a/Documentation/DocBook/media/v4l/controls.xml
> >> b/Documentation/DocBook/media/v4l/controls.xml index 47198ee..bf23994
> >> 100644
> >> --- a/Documentation/DocBook/media/v4l/controls.xml
> >> +++ b/Documentation/DocBook/media/v4l/controls.xml
> >> @@ -4677,6 +4677,40 @@ interface and may change in the future.
> >>conversion.
> >>
> >>  
> >> +
> >> +   >> spanname="id">V4L2_CID_TEST_PATTERN_RED
> >> +   integer
> >> +
> >> +
> >> +  Test pattern red colour component.
> >> +  
> >> +
> >> +
> >> +   >> spanname="id">V4L2_CID_TEST_PATTERN_GREENR
> >> +  integer
> >> +
> >> +
> >> +  Test pattern green (next to red)
> >> +  colour component.
> > 
> > What about non-Bayer RGB sensors ? Should they use the GREENR or the
> > GREENB control for the green component ? Or a different control ?
> 
> A different one. It should be simply green. I could add it to the same
> patch if you wish.
> 
> > I'm wondering whether we shouldn't have a single test pattern color
> > control and create a color type using Hans' complex controls API.
> 
> A raw bayer four-pixel value, you mean?

Yes. I'll let Hans comment on that.

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH v3 2/3] smiapp: Add driver-specific test pattern menu item definitions

2014-05-29 Thread Sakari Ailus

Laurent Pinchart wrote:

diff --git a/include/uapi/linux/smiapp.h b/include/uapi/linux/smiapp.h
new file mode 100644
index 000..53938f4
--- /dev/null
+++ b/include/uapi/linux/smiapp.h
@@ -0,0 +1,29 @@
+/*
+ * include/uapi/linux/smiapp.h
+ *
+ * Generic driver for SMIA/SMIA++ compliant camera modules
+ *
+ * Copyright (C) 2014 Intel Corporation
+ * Contact: Sakari Ailus 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef __UAPI_LINUX_SMIAPP_H_
+#define __UAPI_LINUX_SMIAPP_H_
+
+#define V4L2_SMIAPP_TEST_PATTERN_MODE_DISABLED 0
+#define V4L2_SMIAPP_TEST_PATTERN_MODE_SOLID_COLOUR 1
+#define V4L2_SMIAPP_TEST_PATTERN_MODE_COLOUR_BARS  2
+#define V4L2_SMIAPP_TEST_PATTERN_MODE_COLOUR_BARS_GREY 3
+#define V4L2_SMIAPP_TEST_PATTERN_MODE_PN9  4


Out of curiosity, what's PN9 ?


It's a sequence of pseudo-random binary numbers, e.g.:

http://en.wikipedia.org/wiki/Pseudorandom_binary_sequence>

9 is the order of the polynomial.

--
Sakari Ailus
sakari.ai...@linux.intel.com
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 3/3] smiapp: Implement the test pattern control

2014-05-29 Thread Sakari Ailus

Laurent Pinchart wrote:

@@ -543,6 +594,14 @@ static int smiapp_init_controls(struct smiapp_sensor
*sensor) goto error;
}

+   for (i = 0; i < ARRAY_SIZE(sensor->test_data); i++) {
+   struct v4l2_ctrl *ctrl = sensor->test_data[i];
+
+   ctrl->maximum =
+   ctrl->default_value =
+   ctrl->cur.val = (1 << sensor->csi_format->width) - 1;


I think multiple assignments on the same line are discouraged.

Furthermore, couldn't you move this above and use the right values directly
when creating the controls ?


Good point. There might have been a reason to do this in a past version 
of the patch but it no longer exists.


--
Sakari Ailus
sakari.ai...@linux.intel.com
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3.1 3/3] smiapp: Implement the test pattern control

2014-05-29 Thread Sakari Ailus
Add support for the V4L2_CID_TEST_PATTERN control. When the solid colour
mode is selected, additional controls become available for setting the
solid four solid colour components.

Signed-off-by: Sakari Ailus 
Acked-by: Hans Verkuil 
---
since v3:
- Remove redundant definition of smiapp_ctrl_ops.

- Initialise min, max and default in control creation time.

 drivers/media/i2c/smiapp/smiapp-core.c | 75 --
 drivers/media/i2c/smiapp/smiapp.h  |  4 ++
 2 files changed, 75 insertions(+), 4 deletions(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index 446c82c..4ac7780 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -404,6 +404,14 @@ static void smiapp_update_mbus_formats(struct 
smiapp_sensor *sensor)
pixel_order_str[pixel_order]);
 }
 
+static const char * const smiapp_test_patterns[] = {
+   "Disabled",
+   "Solid Colour",
+   "Eight Vertical Colour Bars",
+   "Colour Bars With Fade to Grey",
+   "Pseudorandom Sequence (PN9)",
+};
+
 static int smiapp_set_ctrl(struct v4l2_ctrl *ctrl)
 {
struct smiapp_sensor *sensor =
@@ -477,6 +485,35 @@ static int smiapp_set_ctrl(struct v4l2_ctrl *ctrl)
 
return smiapp_pll_update(sensor);
 
+   case V4L2_CID_TEST_PATTERN: {
+   unsigned int i;
+
+   for (i = 0; i < ARRAY_SIZE(sensor->test_data); i++)
+   v4l2_ctrl_activate(
+   sensor->test_data[i],
+   ctrl->val ==
+   V4L2_SMIAPP_TEST_PATTERN_MODE_SOLID_COLOUR);
+
+   return smiapp_write(
+   sensor, SMIAPP_REG_U16_TEST_PATTERN_MODE, ctrl->val);
+   }
+
+   case V4L2_CID_TEST_PATTERN_RED:
+   return smiapp_write(
+   sensor, SMIAPP_REG_U16_TEST_DATA_RED, ctrl->val);
+
+   case V4L2_CID_TEST_PATTERN_GREENR:
+   return smiapp_write(
+   sensor, SMIAPP_REG_U16_TEST_DATA_GREENR, ctrl->val);
+
+   case V4L2_CID_TEST_PATTERN_BLUE:
+   return smiapp_write(
+   sensor, SMIAPP_REG_U16_TEST_DATA_BLUE, ctrl->val);
+
+   case V4L2_CID_TEST_PATTERN_GREENB:
+   return smiapp_write(
+   sensor, SMIAPP_REG_U16_TEST_DATA_GREENB, ctrl->val);
+
default:
return -EINVAL;
}
@@ -489,10 +526,10 @@ static const struct v4l2_ctrl_ops smiapp_ctrl_ops = {
 static int smiapp_init_controls(struct smiapp_sensor *sensor)
 {
struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd);
-   unsigned int max;
+   unsigned int max, i;
int rval;
 
-   rval = v4l2_ctrl_handler_init(&sensor->pixel_array->ctrl_handler, 7);
+   rval = v4l2_ctrl_handler_init(&sensor->pixel_array->ctrl_handler, 12);
if (rval)
return rval;
sensor->pixel_array->ctrl_handler.lock = &sensor->mutex;
@@ -535,6 +572,19 @@ static int smiapp_init_controls(struct smiapp_sensor 
*sensor)
&sensor->pixel_array->ctrl_handler, &smiapp_ctrl_ops,
V4L2_CID_PIXEL_RATE, 0, 0, 1, 0);
 
+   v4l2_ctrl_new_std_menu_items(&sensor->pixel_array->ctrl_handler,
+&smiapp_ctrl_ops, V4L2_CID_TEST_PATTERN,
+ARRAY_SIZE(smiapp_test_patterns) - 1,
+0, 0, smiapp_test_patterns);
+
+   for (i = 0; i < ARRAY_SIZE(sensor->test_data); i++)
+   sensor->test_data[i] =
+   v4l2_ctrl_new_std(
+   &sensor->pixel_array->ctrl_handler,
+   &smiapp_ctrl_ops, V4L2_CID_TEST_PATTERN_RED + i,
+   0, (1 << sensor->csi_format->width) - 1, 1,
+   (1 << sensor->csi_format->width) - 1);
+
if (sensor->pixel_array->ctrl_handler.error) {
dev_err(&client->dev,
"pixel array controls initialization failed (%d)\n",
@@ -1670,17 +1720,34 @@ static int smiapp_set_format(struct v4l2_subdev *subdev,
if (fmt->pad == ssd->source_pad) {
u32 code = fmt->format.code;
int rval = __smiapp_get_format(subdev, fh, fmt);
+   bool range_changed = false;
+   unsigned int i;
 
if (!rval && subdev == &sensor->src->sd) {
const struct smiapp_csi_data_format *csi_format =
smiapp_validate_csi_data_format(sensor, code);
-   if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE)
+
+   if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
+   if (csi_format->width !=
+   sensor->csi_format->width)
+

[PATCH] v4l-utils: libdvbv5: Find other TS in NIT pointer fix

2014-05-29 Thread Rob Barker

dvb_scan_add_entry() is modified to return the pointer to the newly
created entry (the last in the list), so the add_update_nit_ functions
now modify the correct element, instead of the penultimate one.  This
fixes the finding of other TS in NIT scan feature.

Signed-off-by: Rob Barker 
---
diff --git a/lib/libdvbv5/dvb-scan.c b/lib/libdvbv5/dvb-scan.c
index 297ac59..9a7997b 100644
--- a/lib/libdvbv5/dvb-scan.c
+++ b/lib/libdvbv5/dvb-scan.c
@@ -741,7 +741,7 @@ struct dvb_entry *dvb_scan_add_entry(struct
dvb_v5_fe_parms *parms,
n, freq);
entry->next = new_entry;
new_entry->next = NULL;
-   return entry;
+   return new_entry;
}
}

--
Rob Barker
Red Embedded

This E-mail and any attachments hereto are strictly confidential and intended 
solely for the addressee. If you are not the intended addressee please notify 
the sender by return and delete the message.

You must not disclose, forward or copy this E-mail or attachments to any third 
party without the prior consent of the sender.

Red Embedded Consulting, Company Number 06688270 Registered in England: The 
Waterfront, Salts Mill Rd, Saltaire, BD17 7EZ
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] v4l-utils: libdvbv5: fix compilation issue

2014-05-29 Thread Rob Barker

Removed unnecessary header file to fix issue with some compilers.

Signed-off-by: Rob Barker 
---

diff --git a/lib/include/libdvbv5/descriptors.h
b/lib/include/libdvbv5/descriptors.h
index 94d85a9..cda958e 100644
--- a/lib/include/libdvbv5/descriptors.h
+++ b/lib/include/libdvbv5/descriptors.h
@@ -26,7 +26,6 @@
 #ifndef _DESCRIPTORS_H
 #define _DESCRIPTORS_H

-#include 
 #include 
 #include 
--
Rob Barker
Red Embedded

This E-mail and any attachments hereto are strictly confidential and intended 
solely for the addressee. If you are not the intended addressee please notify 
the sender by return and delete the message.

You must not disclose, forward or copy this E-mail or attachments to any third 
party without the prior consent of the sender.

Red Embedded Consulting, Company Number 06688270 Registered in England: The 
Waterfront, Salts Mill Rd, Saltaire, BD17 7EZ
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] dib7000p: Add DVBv5 stats support

2014-05-29 Thread Mauro Carvalho Chehab
Adds DVBv5 stats support. For now, just mimic whatever dib8000
does, as they're very similar, with regards to statistics.

However, dib7000p_get_time_us() likely require some
adjustments, as I didn't actually reviewed the formula
for it to work with DVB-T. Still, better than nothing,
as latter patches can improve it.

This patch also doesn't show the signal strength in dB
yet. The code is already there, but it requires to be
callibrated.

A latter patch will do the calibration.

It seems that this patch is also a bug fix: Before this
patch, the frontend were not tuning with some userspace
tools. I suspect that dib7000p firmware or hardware
internally expects that the statistics to be collected,
in order for it to work. With this patch, the DVB core
will always retrive statistics, even if userspace doesn't
request. So, it makes the device work on all tested apps.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-frontends/dib7000p.c | 322 -
 1 file changed, 321 insertions(+), 1 deletion(-)

diff --git a/drivers/media/dvb-frontends/dib7000p.c 
b/drivers/media/dvb-frontends/dib7000p.c
index d36fa0d74259..880e15389d8e 100644
--- a/drivers/media/dvb-frontends/dib7000p.c
+++ b/drivers/media/dvb-frontends/dib7000p.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "dvb_math.h"
 #include "dvb_frontend.h"
@@ -72,6 +73,12 @@ struct dib7000p_state {
struct mutex i2c_buffer_lock;
 
u8 input_mode_mpeg;
+
+   /* for DVBv5 stats */
+   s64 old_ucb;
+   unsigned long per_jiffies_stats;
+   unsigned long ber_jiffies_stats;
+   unsigned long get_stats_time;
 };
 
 enum dib7000p_power_mode {
@@ -631,6 +638,8 @@ static u16 dib7000p_defaults[] = {
0,
 };
 
+static void dib7000p_reset_stats(struct dvb_frontend *fe);
+
 static int dib7000p_demod_reset(struct dib7000p_state *state)
 {
dib7000p_set_power_mode(state, DIB7000P_POWER_ALL);
@@ -1354,6 +1363,9 @@ static int dib7000p_tune(struct dvb_frontend *demod)
dib7000p_spur_protect(state, ch->frequency / 1000, 
BANDWIDTH_TO_KHZ(ch->bandwidth_hz));
 
dib7000p_set_bandwidth(state, BANDWIDTH_TO_KHZ(ch->bandwidth_hz));
+
+   dib7000p_reset_stats(demod);
+
return 0;
 }
 
@@ -1546,6 +1558,8 @@ static int dib7000p_set_frontend(struct dvb_frontend *fe)
return ret;
 }
 
+static int dib7000p_get_stats(struct dvb_frontend *fe, fe_status_t stat);
+
 static int dib7000p_read_status(struct dvb_frontend *fe, fe_status_t * stat)
 {
struct dib7000p_state *state = fe->demodulator_priv;
@@ -1564,6 +1578,8 @@ static int dib7000p_read_status(struct dvb_frontend *fe, 
fe_status_t * stat)
if ((lock & 0x0038) == 0x38)
*stat |= FE_HAS_LOCK;
 
+   dib7000p_get_stats(fe, *stat);
+
return 0;
 }
 
@@ -1589,7 +1605,7 @@ static int dib7000p_read_signal_strength(struct 
dvb_frontend *fe, u16 * strength
return 0;
 }
 
-static int dib7000p_read_snr(struct dvb_frontend *fe, u16 * snr)
+static u32 dib7000p_get_snr(struct dvb_frontend *fe)
 {
struct dib7000p_state *state = fe->demodulator_priv;
u16 val;
@@ -1619,10 +1635,312 @@ static int dib7000p_read_snr(struct dvb_frontend *fe, 
u16 * snr)
else
result -= intlog10(2) * 10 * noise_exp - 100;
 
+   return result;
+}
+
+static int dib7000p_read_snr(struct dvb_frontend *fe, u16 *snr)
+{
+   u32 result;
+
+   result = dib7000p_get_snr(fe);
+
*snr = result / ((1 << 24) / 10);
return 0;
 }
 
+static void dib7000p_reset_stats(struct dvb_frontend *demod)
+{
+   struct dib7000p_state *state = demod->demodulator_priv;
+   struct dtv_frontend_properties *c = &demod->dtv_property_cache;
+   u32 ucb;
+
+   memset(&c->strength, 0, sizeof(c->strength));
+   memset(&c->cnr, 0, sizeof(c->cnr));
+   memset(&c->post_bit_error, 0, sizeof(c->post_bit_error));
+   memset(&c->post_bit_count, 0, sizeof(c->post_bit_count));
+   memset(&c->block_error, 0, sizeof(c->block_error));
+
+   c->strength.len = 1;
+   c->cnr.len = 1;
+   c->block_error.len = 1;
+   c->block_count.len = 1;
+   c->post_bit_error.len = 1;
+   c->post_bit_count.len = 1;
+
+   c->strength.stat[0].scale = FE_SCALE_DECIBEL;
+   c->strength.stat[0].uvalue = 0;
+
+   c->cnr.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
+   c->block_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
+   c->block_count.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
+   c->post_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
+   c->post_bit_count.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
+
+   dib7000p_read_unc_blocks(demod, &ucb);
+
+   state->old_ucb = ucb;
+   state->ber_jiffies_stats = 0;
+   state->per_jiffies_stats = 0;
+}
+
+struct linear_segments {
+   unsigned x;
+   signed y;
+};
+
+/*
+ * Table to estimate signal strength in dBm.
+ * This table should be empirically

[PATCH 2/2] dib7000p: Callibrate signal strength

2014-05-29 Thread Mauro Carvalho Chehab
Calibrate the signal strength to dB.

For this callibration, I used adapter 0 (antenna 1), connected
via a normal cable to a DTF-2111 generator.

The same cabling and RF generator connected to adapter 1
(antenna 2) has a difference of +3dBm (signal was stronger
there).

Yet, changing the RF for a difference of, let's say, 6dB
reflected on a 6dB difference at the measured signal, with
is good.

So, the signal strengh can indeed be used to measure the
antenna gain, if the antenna is repositioned. It is
not precise to measure the absolute dBm value, however.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-frontends/dib7000p.c | 54 +-
 1 file changed, 47 insertions(+), 7 deletions(-)

diff --git a/drivers/media/dvb-frontends/dib7000p.c 
b/drivers/media/dvb-frontends/dib7000p.c
index 880e15389d8e..8751da12aaa3 100644
--- a/drivers/media/dvb-frontends/dib7000p.c
+++ b/drivers/media/dvb-frontends/dib7000p.c
@@ -1693,13 +1693,56 @@ struct linear_segments {
  * This table should be empirically determinated by measuring the signal
  * strength generated by a RF generator directly connected into
  * a device.
+ * This table was determinated by measuring the signal strength generated
+ * by a DTA-2111 RF generator directly connected into a dib7000p device
+ * (a Hauppauge Nova-TD stick), using a good quality 3 meters length
+ * RC6 cable and good RC6 connectors, connected directly to antenna 1.
+ * As the minimum output power of DTA-2111 is -31dBm, a 16 dBm attenuator
+ * were used, for the lower power values.
+ * The real value can actually be on other devices, or even at the
+ * second antena input, depending on several factors, like if LNA
+ * is enabled or not, if diversity is enabled, type of connectors, etc.
+ * Yet, it is better to use this measure in dB than a random non-linear
+ * percentage value, especially for antenna adjustments.
+ * On my tests, the precision of the measure using this table is about
+ * 0.5 dB, with sounds reasonable enough to adjust antennas.
  */
-/* FIXME: Calibrate the table */
-
-#define DB_OFFSET 0
+#define DB_OFFSET 131000
 
 static struct linear_segments strength_to_db_table[] = {
-   { 65535,  65535},
+   { 63630, DB_OFFSET - 20500},
+   { 62273, DB_OFFSET - 21000},
+   { 60162, DB_OFFSET - 22000},
+   { 58730, DB_OFFSET - 23000},
+   { 58294, DB_OFFSET - 24000},
+   { 57778, DB_OFFSET - 25000},
+   { 57320, DB_OFFSET - 26000},
+   { 56779, DB_OFFSET - 27000},
+   { 56293, DB_OFFSET - 28000},
+   { 55724, DB_OFFSET - 29000},
+   { 55145, DB_OFFSET - 3},
+   { 54680, DB_OFFSET - 31000},
+   { 54293, DB_OFFSET - 32000},
+   { 53813, DB_OFFSET - 33000},
+   { 53427, DB_OFFSET - 34000},
+   { 52981, DB_OFFSET - 35000},
+
+   { 52636, DB_OFFSET - 36000},
+   { 52014, DB_OFFSET - 37000},
+   { 51674, DB_OFFSET - 38000},
+   { 50692, DB_OFFSET - 39000},
+   { 49824, DB_OFFSET - 4},
+   { 49052, DB_OFFSET - 41000},
+   { 48436, DB_OFFSET - 42000},
+   { 47836, DB_OFFSET - 43000},
+   { 47368, DB_OFFSET - 44000},
+   { 46468, DB_OFFSET - 45000},
+   { 45597, DB_OFFSET - 46000},
+   { 44586, DB_OFFSET - 47000},
+   { 43667, DB_OFFSET - 48000},
+   { 42673, DB_OFFSET - 49000},
+   { 41816, DB_OFFSET - 5},
+   { 40876, DB_OFFSET - 51000},
{ 0,  0},
 };
 
@@ -1853,9 +1896,6 @@ static int dib7000p_get_stats(struct dvb_frontend *demod, 
fe_status_t stat)
   ARRAY_SIZE(strength_to_db_table)) - DB_OFFSET;
c->strength.stat[0].svalue = db;
 
-   /* FIXME: Remove this when calibrated to DB */
-   c->strength.stat[0].scale = FE_SCALE_COUNTER;
-
/* UCB/BER/CNR measures require lock */
if (!(stat & FE_HAS_LOCK)) {
c->cnr.len = 1;
-- 
1.9.3

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


RE: 1d6b:0001 [MSI A55M-P33] No webcam functionality with Zoran Microelectronics, Ltd Digital Camera EX-20 DSC

2014-05-29 Thread Richie Gress

> Date: Wed, 28 May 2014 10:56:51 +0200
> From: hverk...@xs4all.nl
> To: searchfgold67...@live.com; linux-...@vger.kernel.org; 
> linux-media@vger.kernel.org
> Subject: Re: 1d6b:0001 [MSI A55M-P33] No webcam functionality with Zoran 
> Microelectronics, Ltd Digital Camera EX-20 DSC
>
> On 05/27/14 19:55, Richie Gress wrote:
>>
>>
>>> Date: Tue, 27 May 2014 09:03:33 +0200
>>> From: hverk...@xs4all.nl
>>> To: searchfgold67...@live.com; linux-...@vger.kernel.org; 
>>> linux-media@vger.kernel.org
>>> Subject: Re: 1d6b:0001 [MSI A55M-P33] No webcam functionality with Zoran 
>>> Microelectronics, Ltd Digital Camera EX-20 DSC
>>>
>>> On 05/27/2014 03:34 AM, Richie wrote:
 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1322380

 [1.] One line summary of the problem:

 1d6b:0001 [MSI A55M-P33] No webcam functionality with Zoran 
 Microelectronics,
 Ltd Digital Camera EX-20 DSC

 [2.] Full description of the problem/report:

 No software recognizes the webcam and this is not a regression. dmesg 
 reports
 the following additional output after plugging the camera. You can see 
 where I
 change the camera to "PC Mode" (in order to use the webcam, users must do 
 this
 from the camera) at [ 691.147589]. The device is turned off at [ 
 1094.746444]:

 [ 688.796908] usb 4-2: new full-speed USB device number 2 using ohci-pci
 [ 688.965802] usb 4-2: New USB device found, idVendor=0595, idProduct=2002
 [ 688.965807] usb 4-2: New USB device strings: Mfr=4, Product=5,
 SerialNumber=6
 [ 688.965809] usb 4-2: Product: COACH DSC
 [ 688.965811] usb 4-2: Manufacturer: ZORAN
 [ 688.965813] usb 4-2: SerialNumber: ZORAN01234567
 [ 689.012630] usb-storage 4-2:1.0: USB Mass Storage device detected
 [ 689.021168] scsi6 : usb-storage 4-2:1.0
 [ 689.021266] usbcore: registered new interface driver usb-storage
 [ 690.030971] scsi 6:0:0:0: Direct-Access ZORAN COACH6 (I62) 1.10 PQ: 0 
 ANSI:
 0 CCS
 [ 690.036147] sd 6:0:0:0: Attached scsi generic sg3 type 0
 [ 690.044964] sd 6:0:0:0: [sdc] 3962629 512-byte logical blocks: (2.02 
 GB/1.88
 GiB)
 [ 690.054977] sd 6:0:0:0: [sdc] Write Protect is off
 [ 690.054984] sd 6:0:0:0: [sdc] Mode Sense: 00 06 00 00
 [ 690.064965] sd 6:0:0:0: [sdc] No Caching mode page found
 [ 690.064971] sd 6:0:0:0: [sdc] Assuming drive cache: write through
 [ 690.108960] sd 6:0:0:0: [sdc] No Caching mode page found
 [ 690.108966] sd 6:0:0:0: [sdc] Assuming drive cache: write through
 [ 690.156970] sdc:
 [ 690.210974] sd 6:0:0:0: [sdc] No Caching mode page found
 [ 690.210980] sd 6:0:0:0: [sdc] Assuming drive cache: write through
 [ 690.210985] sd 6:0:0:0: [sdc] Attached SCSI removable disk
 [ 691.147589] usb 4-2: USB disconnect, device number 2
 [ 691.793364] usb 4-2: new full-speed USB device number 3 using ohci-pci
 [ 691.962202] usb 4-2: New USB device found, idVendor=0595, idProduct=4343
 [ 691.962207] usb 4-2: New USB device strings: Mfr=7, Product=8,
 SerialNumber=9
 [ 691.962209] usb 4-2: Product: COACH DSC
 [ 691.962211] usb 4-2: Manufacturer: ZORAN
 [ 691.962213] usb 4-2: SerialNumber: ZORAN0001
 [ 691.964262] usb-storage 4-2:1.0: USB Mass Storage device detected
 [ 691.965410] usb-storage: probe of 4-2:1.0 failed with error -5
 [ 692.053929] Linux video capture interface: v2.00
 [ 692.091447] zr364xx 4-2:1.0: Zoran 364xx compatible webcam plugged
 [ 692.091453] zr364xx 4-2:1.0: model 0595:4343 detected
 [ 692.091461] usb 4-2: 320x240 mode selected
 [ 692.094356] usb 4-2: Zoran 364xx controlling device video0
>>>
>>> Clearly the webcam is recognized and a /dev/video0 node is created.
>>> Please check that /dev/video0 exists. Try e.g. v4l2-ctl -D -d /dev/video0,
>>> it should list it as using the zr364xx driver.
>>>
>>> So what exactly doesn't work?
>>>
>>> Regards,
>>>
>>> Hans
>>>
 [ 692.094672] usbcore: registered new interface driver zr364xx
 [ 1094.746444] hub 4-0:1.0: port 2 disabled by hub (EMI?), re-enabling...
 [ 1094.746451] usb 4-2: USB disconnect, device number 3
 [ 1094.747395] zr364xx 4-2:1.0: Zoran 364xx webcam unplugged
>>>
>>
>> Yes, it does seem to be using the zr364xx driver:
>>
>> $ v4l2-ctl -D -d /dev/video0
>> Driver Info (not using libv4l2):
>> Driver name : Zoran 364xx
>> Card type : COACH DSC
>> Bus info : 4-1
>> Driver version: 3.15.0
>> Capabilities : 0x8501
>> Video Capture
>> Read/Write
>> Streaming
>> Device Capabilities
>> Device Caps : 0x0501
>> Video Capture
>> Read/Write
>> Streaming
>>
>> The exact problem is that while the camera is recognized as a camera by 
>> software like Skype, Kamoso, and Cheese, there is no picture, just black. A 
>> "320x240 mode" was mentioned... perhaps that resolution is just too small to 
>> use by the software?
>
> Try using qv4l2. If that doesn't work, then it is likely t

Re: [PATCH] gpio: removes all usage of gpiochip_remove retval

2014-05-29 Thread David Daney

On 05/29/2014 02:54 PM, abdoulaye berthe wrote:

Did you forget a changelog explaining why this is either needed, or even 
a good idea?  I joined the conversation late and don't know why you are 
doing this.


Thanks,
David Daney




Signed-off-by: abdoulaye berthe 
---
  arch/arm/common/scoop.c| 10 ++
  arch/mips/txx9/generic/setup.c |  4 ++--
  arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c |  3 ++-
  arch/sh/boards/mach-x3proto/gpio.c |  6 ++
  drivers/bcma/driver_gpio.c |  3 ++-
  drivers/gpio/gpio-74x164.c |  8 +++-
  drivers/gpio/gpio-adnp.c   |  9 +
  drivers/gpio/gpio-adp5520.c|  8 +---
  drivers/gpio/gpio-adp5588.c|  6 +-
  drivers/gpio/gpio-amd8111.c|  3 +--
  drivers/gpio/gpio-arizona.c|  3 ++-
  drivers/gpio/gpio-cs5535.c |  8 +---
  drivers/gpio/gpio-da9052.c |  3 ++-
  drivers/gpio/gpio-da9055.c |  3 ++-
  drivers/gpio/gpio-dwapb.c  |  2 +-
  drivers/gpio/gpio-em.c |  5 +
  drivers/gpio/gpio-f7188x.c | 18 ++
  drivers/gpio/gpio-generic.c|  3 ++-
  drivers/gpio/gpio-grgpio.c |  4 +---
  drivers/gpio/gpio-ich.c|  9 +
  drivers/gpio/gpio-it8761e.c|  6 +-
  drivers/gpio/gpio-janz-ttl.c   |  8 +---
  drivers/gpio/gpio-kempld.c |  3 ++-
  drivers/gpio/gpio-lp3943.c |  3 ++-
  drivers/gpio/gpio-lynxpoint.c  |  5 +
  drivers/gpio/gpio-max730x.c| 12 
  drivers/gpio/gpio-max732x.c|  7 +--
  drivers/gpio/gpio-mc33880.c| 11 +++
  drivers/gpio/gpio-mc9s08dz60.c |  3 ++-
  drivers/gpio/gpio-mcp23s08.c   | 26 +++---
  drivers/gpio/gpio-ml-ioh.c |  8 ++--
  drivers/gpio/gpio-msm-v2.c |  5 +
  drivers/gpio/gpio-mxc.c|  2 +-
  drivers/gpio/gpio-octeon.c |  3 ++-
  drivers/gpio/gpio-palmas.c |  3 ++-
  drivers/gpio/gpio-pca953x.c|  7 +--
  drivers/gpio/gpio-pcf857x.c|  4 +---
  drivers/gpio/gpio-pch.c| 10 ++
  drivers/gpio/gpio-rc5t583.c|  3 ++-
  drivers/gpio/gpio-rcar.c   |  5 +
  drivers/gpio/gpio-rdc321x.c|  7 ++-
  drivers/gpio/gpio-sch.c| 16 +++-
  drivers/gpio/gpio-sch311x.c|  6 ++
  drivers/gpio/gpio-sodaville.c  |  4 +---
  drivers/gpio/gpio-stmpe.c  |  8 +---
  drivers/gpio/gpio-sx150x.c |  7 ++-
  drivers/gpio/gpio-syscon.c |  3 ++-
  drivers/gpio/gpio-tb10x.c  |  5 +
  drivers/gpio/gpio-tc3589x.c|  8 +---
  drivers/gpio/gpio-timberdale.c |  5 +
  drivers/gpio/gpio-tps6586x.c   |  3 ++-
  drivers/gpio/gpio-tps65910.c   |  3 ++-
  drivers/gpio/gpio-tps65912.c   |  3 ++-
  drivers/gpio/gpio-ts5500.c |  6 +++---
  drivers/gpio/gpio-twl4030.c|  4 +---
  drivers/gpio/gpio-twl6040.c|  3 ++-
  drivers/gpio/gpio-ucb1400.c|  2 +-
  drivers/gpio/gpio-viperboard.c | 10 +++---
  drivers/gpio/gpio-vx855.c  |  3 +--
  drivers/gpio/gpio-wm831x.c |  3 ++-
  drivers/gpio/gpio-wm8350.c |  3 ++-
  drivers/gpio/gpio-wm8994.c |  3 ++-
  drivers/hid/hid-cp2112.c   |  6 ++
  drivers/input/keyboard/adp5588-keys.c  |  4 +---
  drivers/input/keyboard/adp5589-keys.c  |  4 +---
  drivers/input/touchscreen/ad7879.c | 10 +++---
  drivers/leds/leds-pca9532.c| 10 ++
  drivers/leds/leds-tca6507.c|  7 ++-
  drivers/media/dvb-frontends/cxd2820r_core.c| 10 +++---
  drivers/mfd/asic3.c|  3 ++-
  drivers/mfd/htc-i2cpld.c   |  8 +---
  drivers/mfd/sm501.c| 17 +++--
  drivers/mfd/tc6393xb.c | 13 -
  drivers/mfd/ucb1x00-core.c |  8 ++--
  drivers/pinctrl/pinctrl-abx500.c   | 15 +++
  drivers/pinctrl/pinctrl-adi2.c |  9 -
  drivers/pinctrl/pinctrl-as3722.c   | 11 ++

Re: [PATCH] gpio: removes all usage of gpiochip_remove retval

2014-05-29 Thread Greg KH
On Thu, May 29, 2014 at 11:54:52PM +0200, abdoulaye berthe wrote:
> Signed-off-by: abdoulaye berthe 

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


Re: [PATCH] gpio: removes all usage of gpiochip_remove retval

2014-05-29 Thread Stephen Rothwell
Hi abdoulaye,

On Fri, 30 May 2014 01:16:22 +0200 abdoulaye berthe  wrote:
>
> The aim of this patch is to make gpiochip_remove() behavior consistent,
> especially when issuing a remove request while the chipio chip is
> still requested. A patch has been submitted to change the return value of
> gpiochip_remove() from int to void. This one updates users of the return
> value:

Then you need to keep these two patch in a series with this one first
to make sure that the other patch is not applied without this one.

And you should add the above explanation to the changelog for this
patch.

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


signature.asc
Description: PGP signature


Re: [PATCH 00/12] dvbv5 scan tables for Brazil

2014-05-29 Thread Jonathan McCrohan
Hi Mauro,

On Tue, 27 May 2014 13:50:20 -0300, Mauro Carvalho Chehab wrote:
> This patch series add the DTV scan tables for Brazilian ISDB-T
> and for the Brazilian Countys that have already digital TV.

Thanks for the DVBv5 scan files. I had the attached draft patch sitting
in my tree. I don't think it is ready to be committed yet, but probably
worth sending now to discuss.

How do we want to manage the migration from DVBv3 to DVBv5:
1) point in time migration from DVBv3 to DVBv5?
2) maintain both until DVBv5 is in widespread use?

On a side note, I found a bug in dvb-format-convert; it cannot parse
DVB-T2 DVBv3 scan files.

Jon
From fdcabb0802a4a40e257d54dbd5e5eba59b9820f7 Mon Sep 17 00:00:00 2001
From: Jonathan McCrohan 
Date: Fri, 30 May 2014 01:14:42 +0100
Subject: [PATCH] Add Makefile to convert DVBv3 files to DVBv5

Signed-off-by: Jonathan McCrohan 
---
 Makefile | 25 +
 1 file changed, 25 insertions(+)
 create mode 100644 Makefile

diff --git a/Makefile b/Makefile
new file mode 100644
index 000..fac40e7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+# Makefile for dtv-scan-tables (26 May 2014)
+# Copyright 2014 Jonathan McCrohan 
+
+# The vast majority of the DVB scan files contained in this repository
+# are DVBv3 scan files. This format has been deprecated in favor of the
+# DVBv5 scan format.
+#
+# Use this makefile to convert the existing DVBv3 scan files to DVBv5
+# scan files until such time as DVBv5 scan format is in widespread use.
+#
+# Requires dvb-format-convert from v4l-utils.
+
+MKDIR = mkdir -p
+DVBFORMATCONVERT = dvb-format-convert
+
+DVBFORMATCONVERT_CHANNEL_DVBV5 = -ICHANNEL -ODVBV5
+
+DVBV3DIRS = atsc dvb-c dvb-s dvb-t
+DVBV3CHANNELFILES = $(foreach dir,$(DVBV3DIRS),$(wildcard $(dir)/*))
+
+DVBV5OUTPUTDIR = dvbv5
+
+makedvbv5:
+	@$(foreach var,$(DVBV3DIRS), $(MKDIR) $(DVBV5OUTPUTDIR)/$(var);)
+	@$(foreach var,$(DVBV3CHANNELFILES), $(DVBFORMATCONVERT) $(DVBFORMATCONVERT_CHANNEL_DVBV5) $(var) $(DVBV5OUTPUTDIR)/$(var);)
-- 
2.0.0.rc2



pgpFgPUWQ3RBO.pgp
Description: PGP signature


Re: [PATCH 0/6] [dvb-apps] Various dvb-apps fixes and enhancements

2014-05-29 Thread Jonathan McCrohan
Hi,

On Sun,  4 May 2014 02:51:15 +0100, Jonathan McCrohan wrote:
> The following patch set contains various fixes and enhancements found
> during the packaging of the next version of Debian's dvb-apps package.
>
> A number of these patches have lived as Debian specific patches for a
> long time, however, there is no reason not to upstream them for
> everyone's benefit.

Any thoughts on whether this patchset could be applied?

Thanks,
Jon


pgp9WmiPpmC4h.pgp
Description: PGP signature


Get back to me

2014-05-29 Thread Kong Hui
I am a bank director from Hong Kong, I want you to be my partner in a
business project of mutual benefit. Get back to me if interested.


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


Re: [PATCH 00/12] dvbv5 scan tables for Brazil

2014-05-29 Thread Mauro Carvalho Chehab
Hi Jonathan,

Em Fri, 30 May 2014 01:23:45 +0100
Jonathan McCrohan  escreveu:

> Hi Mauro,
> 
> On Tue, 27 May 2014 13:50:20 -0300, Mauro Carvalho Chehab wrote:
> > This patch series add the DTV scan tables for Brazilian ISDB-T
> > and for the Brazilian Countys that have already digital TV.
> 
> Thanks for the DVBv5 scan files. I had the attached draft patch sitting
> in my tree. I don't think it is ready to be committed yet, but probably
> worth sending now to discuss.

Sure.

> How do we want to manage the migration from DVBv3 to DVBv5:
> 1) point in time migration from DVBv3 to DVBv5?
> 2) maintain both until DVBv5 is in widespread use?

IMHO, the best strategy would be to convert all files at the tree to
DVBv5, and add a Makefile target to produce the DVBv3 files and
another one to install the DVBv5 files on a shared repository.

That gives to distro maintainers the flexibility to have either one 
or two packages for each format, and let them to remove the dvbv3
when all apps on an specific distro would be using just the new format.

> On a side note, I found a bug in dvb-format-convert; it cannot parse
> DVB-T2 DVBv3 scan files.

Well, at the time it was written, there were no DVB-T2 files.

Feel free to send patches improving the library to also handle the
DVB-T2 formats.

Regards,
Mauro


signature.asc
Description: PGP signature


MAIL

2014-05-29 Thread Richard Sun
Hello, 
My name is Mr. Richard Sun from Hong Kong. I want you to be my partner in a 
business project. Contact me back via my private e-mail address for more 
details; 
richad.t...@yahoo.com.hk 
Thank you. 
Mr. Richard Sun.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cron job: media_tree daily build: OK

2014-05-29 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:   Fri May 30 04:00:16 CEST 2014
git branch: test
git hash:   26f15c1fff5493fc0771248d5a409f2c7815a53a
gcc version:i686-linux-gcc (GCC) 4.8.2
sparse version: v0.5.0-11-g38d1124
host hardware:  x86_64
host os:3.14-1.slh.1-amd64

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-exynos: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-omap1: OK
linux-git-arm-pxa: OK
linux-git-blackfin: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.31.14-i686: OK
linux-2.6.32.27-i686: OK
linux-2.6.33.7-i686: OK
linux-2.6.34.7-i686: OK
linux-2.6.35.9-i686: OK
linux-2.6.36.4-i686: OK
linux-2.6.37.6-i686: OK
linux-2.6.38.8-i686: OK
linux-2.6.39.4-i686: OK
linux-3.0.60-i686: OK
linux-3.1.10-i686: OK
linux-3.2.37-i686: OK
linux-3.3.8-i686: OK
linux-3.4.27-i686: OK
linux-3.5.7-i686: OK
linux-3.6.11-i686: OK
linux-3.7.4-i686: OK
linux-3.8-i686: OK
linux-3.9.2-i686: OK
linux-3.10.1-i686: OK
linux-3.11.1-i686: OK
linux-3.12-i686: OK
linux-3.13-i686: OK
linux-3.14-i686: OK
linux-3.15-rc1-i686: OK
linux-2.6.31.14-x86_64: OK
linux-2.6.32.27-x86_64: OK
linux-2.6.33.7-x86_64: OK
linux-2.6.34.7-x86_64: OK
linux-2.6.35.9-x86_64: OK
linux-2.6.36.4-x86_64: OK
linux-2.6.37.6-x86_64: OK
linux-2.6.38.8-x86_64: OK
linux-2.6.39.4-x86_64: OK
linux-3.0.60-x86_64: OK
linux-3.1.10-x86_64: OK
linux-3.2.37-x86_64: OK
linux-3.3.8-x86_64: OK
linux-3.4.27-x86_64: OK
linux-3.5.7-x86_64: OK
linux-3.6.11-x86_64: OK
linux-3.7.4-x86_64: OK
linux-3.8-x86_64: OK
linux-3.9.2-x86_64: OK
linux-3.10.1-x86_64: OK
linux-3.11.1-x86_64: OK
linux-3.12-x86_64: OK
linux-3.13-x86_64: OK
linux-3.14-x86_64: OK
linux-3.15-rc1-x86_64: OK
apps: OK
spec-git: OK
sparse version: v0.5.0-11-g38d1124
sparse: ERRORS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Friday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Friday.tar.bz2

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html