From 88393161210493e317ae391696ee8ef463cb3c23 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Tue, 16 Mar 2010 11:47:56 +0100 Subject: Fix typos in comments [Ss]ytem => [Ss]ystem udpate => update paramters => parameters orginal => original Signed-off-by: Thomas Weber Acked-by: Randy Dunlap Signed-off-by: Jiri Kosina --- drivers/media/dvb/dvb-usb/friio-fe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/friio-fe.c b/drivers/media/dvb/dvb-usb/friio-fe.c index d14bd227b50..93c21ddd0b7 100644 --- a/drivers/media/dvb/dvb-usb/friio-fe.c +++ b/drivers/media/dvb/dvb-usb/friio-fe.c @@ -300,7 +300,7 @@ static int jdvbt90502_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) { /** - * NOTE: ignore all the paramters except frequency. + * NOTE: ignore all the parameters except frequency. * others should be fixed to the proper value for ISDB-T, * but don't check here. */ -- cgit v1.2.3-70-g09d2 From 6120792baa00542b5113222b0e09f5e52b510444 Mon Sep 17 00:00:00 2001 From: Márton Németh Date: Mon, 1 Mar 2010 04:10:52 -0300 Subject: V4L/DVB: az6027: remove redundant condition check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The condition (msg[i].addr == 0xd0) is checked twice the second one is not necessary. This will remove the following compiler warning: az6027.c: In function 'az6027_i2c_xfer': az6027.c:942: warning: 'index' may be used uninitialized in this function az6027.c:943: warning: 'value' may be used uninitialized in this function az6027.c:944: warning: 'length' may be used uninitialized in this function az6027.c:945: warning: 'req' may be used uninitialized in this function Signed-off-by: Márton Németh Cc: Manu Abraham Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/az6027.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/az6027.c b/drivers/media/dvb/dvb-usb/az6027.c index d7290b2c091..27acbfb6d33 100644 --- a/drivers/media/dvb/dvb-usb/az6027.c +++ b/drivers/media/dvb/dvb-usb/az6027.c @@ -976,17 +976,14 @@ static int az6027_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int n i++; } else { - if (msg[i].addr == 0xd0) { - /* demod 16bit addr */ - req = 0xBD; - index = (((msg[i].buf[0] << 8) & 0xff00) | (msg[i].buf[1] & 0x00ff)); - value = msg[i].addr + (2 << 8); - length = msg[i].len - 2; - len = msg[i].len - 2; - for (j = 0; j < len; j++) - data[j] = msg[i].buf[j + 2]; - - } + /* demod 16bit addr */ + req = 0xBD; + index = (((msg[i].buf[0] << 8) & 0xff00) | (msg[i].buf[1] & 0x00ff)); + value = msg[i].addr + (2 << 8); + length = msg[i].len - 2; + len = msg[i].len - 2; + for (j = 0; j < len; j++) + data[j] = msg[i].buf[j + 2]; az6027_usb_out_op(d, req, value, index, data, length); } } -- cgit v1.2.3-70-g09d2 From ab9b4f2c11904c3c491b626915526049ecfe5ecf Mon Sep 17 00:00:00 2001 From: Antti Palosaari Date: Mon, 1 Mar 2010 13:50:40 -0300 Subject: V4L/DVB: af9015: support for KWorld USB DVB-T Stick Mobile (UB383-T) Add USB ID 1b80:e383 for KWorld USB DVB-T Stick Mobile (UB383-T). Signed-off-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/af9015.c | 9 ++++++++- drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c index 74d94e45324..7611af60b6b 100644 --- a/drivers/media/dvb/dvb-usb/af9015.c +++ b/drivers/media/dvb/dvb-usb/af9015.c @@ -1297,6 +1297,7 @@ static struct usb_device_id af9015_usb_table[] = { {USB_DEVICE(USB_VID_KWORLD_2, USB_PID_SVEON_STV20)}, {USB_DEVICE(USB_VID_KWORLD_2, USB_PID_TINYTWIN_2)}, {USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV2000DS)}, +/* 30 */{USB_DEVICE(USB_VID_KWORLD_2, USB_PID_KWORLD_UB383_T)}, {0}, }; MODULE_DEVICE_TABLE(usb, af9015_usb_table); @@ -1569,7 +1570,7 @@ static struct dvb_usb_device_properties af9015_properties[] = { .i2c_algo = &af9015_i2c_algo, - .num_device_descs = 7, /* max 9 */ + .num_device_descs = 8, /* max 9 */ .devices = { { .name = "AverMedia AVerTV Volar GPS 805 (A805)", @@ -1608,6 +1609,12 @@ static struct dvb_usb_device_properties af9015_properties[] = { .cold_ids = {&af9015_usb_table[29], NULL}, .warm_ids = {NULL}, }, + { + .name = "KWorld USB DVB-T Stick Mobile " \ + "(UB383-T)", + .cold_ids = {&af9015_usb_table[30], NULL}, + .warm_ids = {NULL}, + }, } }, }; diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index ae8b57acfe0..6568db52f4a 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h @@ -127,6 +127,7 @@ #define USB_PID_KWORLD_MC810 0xc810 #define USB_PID_KWORLD_PC160_2T 0xc160 #define USB_PID_KWORLD_PC160_T 0xc161 +#define USB_PID_KWORLD_UB383_T 0xe383 #define USB_PID_KWORLD_VSTREAM_COLD 0x17de #define USB_PID_KWORLD_VSTREAM_WARM 0x17df #define USB_PID_TERRATEC_CINERGY_T_USB_XE 0x0055 -- cgit v1.2.3-70-g09d2 From 7fc8709e4d7230ab640a91b9aef8fbd0f7c1488b Mon Sep 17 00:00:00 2001 From: Antti Palosaari Date: Mon, 1 Mar 2010 14:06:52 -0300 Subject: V4L/DVB: af9015: support for KWorld TV Stick II (395UR) Add USB ID 1b80:e39a for KWorld TV Stick II (395UR). Signed-off-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/af9015.c | 4 +++- drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c index 7611af60b6b..d5ba1de8f07 100644 --- a/drivers/media/dvb/dvb-usb/af9015.c +++ b/drivers/media/dvb/dvb-usb/af9015.c @@ -1298,6 +1298,7 @@ static struct usb_device_id af9015_usb_table[] = { {USB_DEVICE(USB_VID_KWORLD_2, USB_PID_TINYTWIN_2)}, {USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV2000DS)}, /* 30 */{USB_DEVICE(USB_VID_KWORLD_2, USB_PID_KWORLD_UB383_T)}, + {USB_DEVICE(USB_VID_KWORLD_2, USB_PID_KWORLD_395U_4)}, {0}, }; MODULE_DEVICE_TABLE(usb, af9015_usb_table); @@ -1501,7 +1502,8 @@ static struct dvb_usb_device_properties af9015_properties[] = { "(VS-DVB-T 395U)", .cold_ids = {&af9015_usb_table[16], &af9015_usb_table[17], - &af9015_usb_table[18], NULL}, + &af9015_usb_table[18], + &af9015_usb_table[31], NULL}, .warm_ids = {NULL}, }, { diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index 6568db52f4a..b34ca80de43 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h @@ -124,6 +124,7 @@ #define USB_PID_KWORLD_395U 0xe396 #define USB_PID_KWORLD_395U_2 0xe39b #define USB_PID_KWORLD_395U_3 0xe395 +#define USB_PID_KWORLD_395U_4 0xe39a #define USB_PID_KWORLD_MC810 0xc810 #define USB_PID_KWORLD_PC160_2T 0xc160 #define USB_PID_KWORLD_PC160_T 0xc161 -- cgit v1.2.3-70-g09d2 From 823b63b49eb9a670fd9125b625e8f4b008fe3abc Mon Sep 17 00:00:00 2001 From: Oleg Roitburd Date: Thu, 25 Feb 2010 17:19:31 -0300 Subject: V4L/DVB: AZ6027: Add support for Technisat V1 device Signed-off-by: Oleg Roitburd Signed-off-by: Manu Abraham Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/az6027.c | 3 ++- drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/az6027.c b/drivers/media/dvb/dvb-usb/az6027.c index 27acbfb6d33..7db7d3d94f7 100644 --- a/drivers/media/dvb/dvb-usb/az6027.c +++ b/drivers/media/dvb/dvb-usb/az6027.c @@ -1057,7 +1057,8 @@ int az6027_identify_state(struct usb_device *udev, static struct usb_device_id az6027_usb_table[] = { { USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_AZUREWAVE_AZ6027) }, { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_DVBS2CI) }, - { USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_USB2_HDCI) }, + { USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_USB2_HDCI_V1) }, + { USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_USB2_HDCI_V2) }, { }, }; diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index b34ca80de43..0573de50c09 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h @@ -299,5 +299,6 @@ #define USB_PID_SVEON_STV20 0xe39d #define USB_PID_AZUREWAVE_AZ6027 0x3275 #define USB_PID_TERRATEC_DVBS2CI 0x3275 -#define USB_PID_TECHNISAT_USB2_HDCI 0x0002 +#define USB_PID_TECHNISAT_USB2_HDCI_V1 0x0001 +#define USB_PID_TECHNISAT_USB2_HDCI_V2 0x0002 #endif -- cgit v1.2.3-70-g09d2 From 20d2c56de8b3c462c40ef2eff42ff722905e28cf Mon Sep 17 00:00:00 2001 From: Oleg Roitburd Date: Fri, 26 Feb 2010 09:47:16 -0300 Subject: V4L/DVB: AZ6027: Fix initialization for some cards Also add in some more device ID's Signed-off-by: Oleg Roitburd Signed-off-by: Manu Abraham Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/az6027.c | 21 +++++++++++++++++++-- drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 3 ++- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/az6027.c b/drivers/media/dvb/dvb-usb/az6027.c index 7db7d3d94f7..60787a28edb 100644 --- a/drivers/media/dvb/dvb-usb/az6027.c +++ b/drivers/media/dvb/dvb-usb/az6027.c @@ -1056,7 +1056,8 @@ int az6027_identify_state(struct usb_device *udev, static struct usb_device_id az6027_usb_table[] = { { USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_AZUREWAVE_AZ6027) }, - { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_DVBS2CI) }, + { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_DVBS2CI_V1) }, + { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_DVBS2CI_V2) }, { USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_USB2_HDCI_V1) }, { USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_USB2_HDCI_V2) }, { }, @@ -1101,12 +1102,28 @@ static struct dvb_usb_device_properties az6027_properties = { .rc_query = az6027_rc_query, .i2c_algo = &az6027_i2c_algo, - .num_device_descs = 1, + .num_device_descs = 5, .devices = { { .name = "AZUREWAVE DVB-S/S2 USB2.0 (AZ6027)", .cold_ids = { &az6027_usb_table[0], NULL }, .warm_ids = { NULL }, + }, { + .name = "TERRATEC S7", + .cold_ids = { &az6027_usb_table[1], NULL }, + .warm_ids = { NULL }, + }, { + .name = "TERRATEC S7 MKII", + .cold_ids = { &az6027_usb_table[2], NULL }, + .warm_ids = { NULL }, + }, { + .name = "Technisat SkyStar USB 2 HD CI", + .cold_ids = { &az6027_usb_table[3], NULL }, + .warm_ids = { NULL }, + }, { + .name = "Technisat SkyStar USB 2 HD CI", + .cold_ids = { &az6027_usb_table[4], NULL }, + .warm_ids = { NULL }, }, { NULL }, } diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index 0573de50c09..de1f3af60d5 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h @@ -298,7 +298,8 @@ #define USB_PID_TVWAY_PLUS 0x0002 #define USB_PID_SVEON_STV20 0xe39d #define USB_PID_AZUREWAVE_AZ6027 0x3275 -#define USB_PID_TERRATEC_DVBS2CI 0x3275 +#define USB_PID_TERRATEC_DVBS2CI_V1 0x10a4 +#define USB_PID_TERRATEC_DVBS2CI_V2 0x10ac #define USB_PID_TECHNISAT_USB2_HDCI_V1 0x0001 #define USB_PID_TECHNISAT_USB2_HDCI_V2 0x0002 #endif -- cgit v1.2.3-70-g09d2 From 000f64efc7fe6693261a78a0164c0e805553631b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 11 Mar 2010 01:58:12 -0300 Subject: V4L/DVB: Fix bad whitespacing Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/az6027.c | 10 +++++----- drivers/media/dvb/frontends/atbm8830_priv.h | 2 +- drivers/media/dvb/mantis/mantis_vp1041.c | 10 +++++----- drivers/media/video/davinci/isif_regs.h | 2 +- drivers/media/video/gspca/ov534.c | 2 +- drivers/media/video/ov9640.c | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/az6027.c b/drivers/media/dvb/dvb-usb/az6027.c index 60787a28edb..30ea3eff1ef 100644 --- a/drivers/media/dvb/dvb-usb/az6027.c +++ b/drivers/media/dvb/dvb-usb/az6027.c @@ -125,12 +125,12 @@ static const struct stb0899_s1_reg az6027_stb0899_s1_init_3[] = { { STB0899_RCOMPC , 0xc9 }, { STB0899_AGC1CN , 0x01 }, { STB0899_AGC1REF , 0x10 }, - { STB0899_RTC , 0x23 }, + { STB0899_RTC , 0x23 }, { STB0899_TMGCFG , 0x4e }, { STB0899_AGC2REF , 0x34 }, { STB0899_TLSR , 0x84 }, { STB0899_CFD , 0xf7 }, - { STB0899_ACLC , 0x87 }, + { STB0899_ACLC , 0x87 }, { STB0899_BCLC , 0x94 }, { STB0899_EQON , 0x41 }, { STB0899_LDT , 0xf1 }, @@ -183,10 +183,10 @@ static const struct stb0899_s1_reg az6027_stb0899_s1_init_3[] = { { STB0899_ECNT3M , 0x0a }, { STB0899_ECNT3L , 0xad }, { STB0899_FECAUTO1 , 0x06 }, - { STB0899_FECM , 0x01 }, + { STB0899_FECM , 0x01 }, { STB0899_VTH12 , 0xb0 }, { STB0899_VTH23 , 0x7a }, - { STB0899_VTH34 , 0x58 }, + { STB0899_VTH34 , 0x58 }, { STB0899_VTH56 , 0x38 }, { STB0899_VTH67 , 0x34 }, { STB0899_VTH78 , 0x24 }, @@ -195,7 +195,7 @@ static const struct stb0899_s1_reg az6027_stb0899_s1_init_3[] = { { STB0899_RSULC , 0xb1 }, /* DVB = 0xb1, DSS = 0xa1 */ { STB0899_TSULC , 0x42 }, { STB0899_RSLLC , 0x41 }, - { STB0899_TSLPL , 0x12 }, + { STB0899_TSLPL , 0x12 }, { STB0899_TSCFGH , 0x0c }, { STB0899_TSCFGM , 0x00 }, { STB0899_TSCFGL , 0x00 }, diff --git a/drivers/media/dvb/frontends/atbm8830_priv.h b/drivers/media/dvb/frontends/atbm8830_priv.h index ce960f76092..d460058d497 100644 --- a/drivers/media/dvb/frontends/atbm8830_priv.h +++ b/drivers/media/dvb/frontends/atbm8830_priv.h @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - + #ifndef __ATBM8830_PRIV_H #define __ATBM8830_PRIV_H diff --git a/drivers/media/dvb/mantis/mantis_vp1041.c b/drivers/media/dvb/mantis/mantis_vp1041.c index 515346dd31d..d1aa2bc0c15 100644 --- a/drivers/media/dvb/mantis/mantis_vp1041.c +++ b/drivers/media/dvb/mantis/mantis_vp1041.c @@ -136,12 +136,12 @@ static const struct stb0899_s1_reg vp1041_stb0899_s1_init_3[] = { { STB0899_RCOMPC , 0xc9 }, { STB0899_AGC1CN , 0x01 }, { STB0899_AGC1REF , 0x10 }, - { STB0899_RTC , 0x23 }, + { STB0899_RTC , 0x23 }, { STB0899_TMGCFG , 0x4e }, { STB0899_AGC2REF , 0x34 }, { STB0899_TLSR , 0x84 }, { STB0899_CFD , 0xf7 }, - { STB0899_ACLC , 0x87 }, + { STB0899_ACLC , 0x87 }, { STB0899_BCLC , 0x94 }, { STB0899_EQON , 0x41 }, { STB0899_LDT , 0xf1 }, @@ -194,10 +194,10 @@ static const struct stb0899_s1_reg vp1041_stb0899_s1_init_3[] = { { STB0899_ECNT3M , 0x0a }, { STB0899_ECNT3L , 0xad }, { STB0899_FECAUTO1 , 0x06 }, - { STB0899_FECM , 0x01 }, + { STB0899_FECM , 0x01 }, { STB0899_VTH12 , 0xb0 }, { STB0899_VTH23 , 0x7a }, - { STB0899_VTH34 , 0x58 }, + { STB0899_VTH34 , 0x58 }, { STB0899_VTH56 , 0x38 }, { STB0899_VTH67 , 0x34 }, { STB0899_VTH78 , 0x24 }, @@ -206,7 +206,7 @@ static const struct stb0899_s1_reg vp1041_stb0899_s1_init_3[] = { { STB0899_RSULC , 0xb1 }, /* DVB = 0xb1, DSS = 0xa1 */ { STB0899_TSULC , 0x42 }, { STB0899_RSLLC , 0x41 }, - { STB0899_TSLPL , 0x12 }, + { STB0899_TSLPL , 0x12 }, { STB0899_TSCFGH , 0x0c }, { STB0899_TSCFGM , 0x00 }, { STB0899_TSCFGL , 0x00 }, diff --git a/drivers/media/video/davinci/isif_regs.h b/drivers/media/video/davinci/isif_regs.h index f7b8893a295..aa69a463c12 100644 --- a/drivers/media/video/davinci/isif_regs.h +++ b/drivers/media/video/davinci/isif_regs.h @@ -158,7 +158,7 @@ /* gain - offset masks */ #define GAIN_INTEGER_SHIFT 9 -#define OFFSET_MASK 0xFFF +#define OFFSET_MASK 0xFFF #define GAIN_SDRAM_EN_SHIFT 12 #define GAIN_IPIPE_EN_SHIFT 13 #define GAIN_H3A_EN_SHIFT 14 diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c index 8cd193d18b7..dc1e4efe30f 100644 --- a/drivers/media/video/gspca/ov534.c +++ b/drivers/media/video/gspca/ov534.c @@ -709,7 +709,7 @@ static void setexposure(struct gspca_dev *gspca_dev) /* 'val' is one byte and represents half of the exposure value we are * going to set into registers, a two bytes value: - * + * * MSB: ((u16) val << 1) >> 8 == val >> 7 * LSB: ((u16) val << 1) & 0xff == val << 1 */ diff --git a/drivers/media/video/ov9640.c b/drivers/media/video/ov9640.c index 47bf60ceb7a..36599a65f54 100644 --- a/drivers/media/video/ov9640.c +++ b/drivers/media/video/ov9640.c @@ -59,9 +59,9 @@ static const struct ov9640_reg ov9640_regs_dflt[] = { * COM12 |= OV9640_COM12_YUV_AVG * * for RGB, alter the following registers: - * COM7 |= OV9640_COM7_RGB - * COM13 |= OV9640_COM13_RGB_AVG - * COM15 |= proper RGB color encoding mode + * COM7 |= OV9640_COM7_RGB + * COM13 |= OV9640_COM13_RGB_AVG + * COM15 |= proper RGB color encoding mode */ static const struct ov9640_reg ov9640_regs_qqcif[] = { { OV9640_CLKRC, OV9640_CLKRC_DPLL_EN | OV9640_CLKRC_DIV(0x0f) }, -- cgit v1.2.3-70-g09d2 From 4605664bd94ed94ab65a00bc7c749704304cfd40 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 31 Jan 2010 21:06:10 -0300 Subject: V4L/DVB: dvb-usb: enable specifying a separate generic bulk ctrl response endpoint Some DVB USB devices use a separate endpoint for responses to control messages sent with bulk transfers via the generic_bulk_ctrl_endpoint. When generic_bulk_ctrl_endpoint_response is set, it will be used instead of the generic_bulk_ctrl_endpoint when reading usb responses in the dvb_usb_generic_rw helper function. Signed-off-by: Michael Krufky Reviewed-by: Patrick Boettcher Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/dvb-usb-urb.c | 2 ++ drivers/media/dvb/dvb-usb/dvb-usb.h | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c index 6fe71c6745e..bb46ba6a357 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c @@ -42,6 +42,8 @@ int dvb_usb_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf, msleep(delay_ms); ret = usb_bulk_msg(d->udev,usb_rcvbulkpipe(d->udev, + d->props.generic_bulk_ctrl_endpoint_response ? + d->props.generic_bulk_ctrl_endpoint_response : d->props.generic_bulk_ctrl_endpoint),rbuf,rlen,&actlen, 2000); diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index 0143aef19ec..4a9f676087b 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h @@ -198,6 +198,12 @@ struct dvb_usb_adapter_properties { * is non-zero, one can use dvb_usb_generic_rw and dvb_usb_generic_write- * helper functions. * + * @generic_bulk_ctrl_endpoint_response: some DVB USB devices use a separate + * endpoint for responses to control messages sent with bulk transfers via + * the generic_bulk_ctrl_endpoint. When this is non-zero, this will be used + * instead of the generic_bulk_ctrl_endpoint when reading usb responses in + * the dvb_usb_generic_rw helper function. + * * @num_device_descs: number of struct dvb_usb_device_description in @devices * @devices: array of struct dvb_usb_device_description compatibles with these * properties. @@ -239,6 +245,7 @@ struct dvb_usb_device_properties { struct i2c_algorithm *i2c_algo; int generic_bulk_ctrl_endpoint; + int generic_bulk_ctrl_endpoint_response; int num_device_descs; struct dvb_usb_device_description devices[12]; -- cgit v1.2.3-70-g09d2 From e27e971c69f87bd6c00c4cff973497de365229ef Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 1 Apr 2010 21:35:32 -0300 Subject: V4L/DVB: rename all *_rc_keys to ir_codes_*_nec_table Several DVB drivers use a different name convention. As we're moving the keytables, we need to use the same convention on all places. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/a800.c | 6 ++-- drivers/media/dvb/dvb-usb/af9005-remote.c | 16 ++++----- drivers/media/dvb/dvb-usb/af9005.c | 8 ++--- drivers/media/dvb/dvb-usb/af9005.h | 4 +-- drivers/media/dvb/dvb-usb/af9015.c | 30 ++++++++-------- drivers/media/dvb/dvb-usb/af9015.h | 18 +++++----- drivers/media/dvb/dvb-usb/anysee.c | 6 ++-- drivers/media/dvb/dvb-usb/az6027.c | 6 ++-- drivers/media/dvb/dvb-usb/cinergyT2-core.c | 6 ++-- drivers/media/dvb/dvb-usb/cxusb.c | 46 ++++++++++++------------ drivers/media/dvb/dvb-usb/dib0700_devices.c | 54 ++++++++++++++--------------- drivers/media/dvb/dvb-usb/dibusb-common.c | 4 +-- drivers/media/dvb/dvb-usb/dibusb-mb.c | 8 ++--- drivers/media/dvb/dvb-usb/dibusb-mc.c | 2 +- drivers/media/dvb/dvb-usb/dibusb.h | 2 +- drivers/media/dvb/dvb-usb/digitv.c | 6 ++-- drivers/media/dvb/dvb-usb/dtt200u.c | 18 +++++----- drivers/media/dvb/dvb-usb/dw2102.c | 44 +++++++++++------------ drivers/media/dvb/dvb-usb/m920x.c | 18 +++++----- drivers/media/dvb/dvb-usb/nova-t-usb2.c | 18 +++++----- drivers/media/dvb/dvb-usb/opera1.c | 16 ++++----- drivers/media/dvb/dvb-usb/vp702x.c | 12 +++---- drivers/media/dvb/dvb-usb/vp7045.c | 12 +++---- 23 files changed, 180 insertions(+), 180 deletions(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/a800.c b/drivers/media/dvb/dvb-usb/a800.c index 6247239982e..b6cbb1dfc5f 100644 --- a/drivers/media/dvb/dvb-usb/a800.c +++ b/drivers/media/dvb/dvb-usb/a800.c @@ -37,7 +37,7 @@ static int a800_identify_state(struct usb_device *udev, struct dvb_usb_device_pr return 0; } -static struct dvb_usb_rc_key a800_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_a800_table[] = { { 0x0201, KEY_PROG1 }, /* SOURCE */ { 0x0200, KEY_POWER }, /* POWER */ { 0x0205, KEY_1 }, /* 1 */ @@ -147,8 +147,8 @@ static struct dvb_usb_device_properties a800_properties = { .identify_state = a800_identify_state, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = a800_rc_keys, - .rc_key_map_size = ARRAY_SIZE(a800_rc_keys), + .rc_key_map = ir_codes_a800_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_a800_table), .rc_query = a800_rc_query, .i2c_algo = &dibusb_i2c_algo, diff --git a/drivers/media/dvb/dvb-usb/af9005-remote.c b/drivers/media/dvb/dvb-usb/af9005-remote.c index f4379c650a1..b41fa873b04 100644 --- a/drivers/media/dvb/dvb-usb/af9005-remote.c +++ b/drivers/media/dvb/dvb-usb/af9005-remote.c @@ -33,7 +33,7 @@ MODULE_PARM_DESC(debug, #define deb_decode(args...) dprintk(dvb_usb_af9005_remote_debug,0x01,args) -struct dvb_usb_rc_key af9005_rc_keys[] = { +struct dvb_usb_rc_key ir_codes_af9005_table[] = { {0x01b7, KEY_POWER}, {0x01a7, KEY_VOLUMEUP}, @@ -74,7 +74,7 @@ struct dvb_usb_rc_key af9005_rc_keys[] = { {0x00d5, KEY_GOTO}, /* marked jump on the remote */ }; -int af9005_rc_keys_size = ARRAY_SIZE(af9005_rc_keys); +int ir_codes_af9005_table_size = ARRAY_SIZE(ir_codes_af9005_table); static int repeatable_keys[] = { KEY_VOLUMEUP, @@ -130,10 +130,10 @@ int af9005_rc_decode(struct dvb_usb_device *d, u8 * data, int len, u32 * event, deb_decode("code != inverted code\n"); return 0; } - for (i = 0; i < af9005_rc_keys_size; i++) { - if (rc5_custom(&af9005_rc_keys[i]) == cust - && rc5_data(&af9005_rc_keys[i]) == dat) { - *event = af9005_rc_keys[i].event; + for (i = 0; i < ir_codes_af9005_table_size; i++) { + if (rc5_custom(&ir_codes_af9005_table[i]) == cust + && rc5_data(&ir_codes_af9005_table[i]) == dat) { + *event = ir_codes_af9005_table[i].event; *state = REMOTE_KEY_PRESSED; deb_decode ("key pressed, event %x\n", *event); @@ -146,8 +146,8 @@ int af9005_rc_decode(struct dvb_usb_device *d, u8 * data, int len, u32 * event, return 0; } -EXPORT_SYMBOL(af9005_rc_keys); -EXPORT_SYMBOL(af9005_rc_keys_size); +EXPORT_SYMBOL(ir_codes_af9005_table); +EXPORT_SYMBOL(ir_codes_af9005_table_size); EXPORT_SYMBOL(af9005_rc_decode); MODULE_AUTHOR("Luca Olivetti "); diff --git a/drivers/media/dvb/dvb-usb/af9005.c b/drivers/media/dvb/dvb-usb/af9005.c index ca5a0a4d2a4..cfd6107d534 100644 --- a/drivers/media/dvb/dvb-usb/af9005.c +++ b/drivers/media/dvb/dvb-usb/af9005.c @@ -1109,8 +1109,8 @@ static int __init af9005_usb_module_init(void) return result; } rc_decode = symbol_request(af9005_rc_decode); - rc_keys = symbol_request(af9005_rc_keys); - rc_keys_size = symbol_request(af9005_rc_keys_size); + rc_keys = symbol_request(ir_codes_af9005_table); + rc_keys_size = symbol_request(ir_codes_af9005_table_size); if (rc_decode == NULL || rc_keys == NULL || rc_keys_size == NULL) { err("af9005_rc_decode function not found, disabling remote"); af9005_properties.rc_query = NULL; @@ -1128,9 +1128,9 @@ static void __exit af9005_usb_module_exit(void) if (rc_decode != NULL) symbol_put(af9005_rc_decode); if (rc_keys != NULL) - symbol_put(af9005_rc_keys); + symbol_put(ir_codes_af9005_table); if (rc_keys_size != NULL) - symbol_put(af9005_rc_keys_size); + symbol_put(ir_codes_af9005_table_size); /* deregister this driver from the USB subsystem */ usb_deregister(&af9005_usb_driver); } diff --git a/drivers/media/dvb/dvb-usb/af9005.h b/drivers/media/dvb/dvb-usb/af9005.h index 0bc48a01218..088e7083a39 100644 --- a/drivers/media/dvb/dvb-usb/af9005.h +++ b/drivers/media/dvb/dvb-usb/af9005.h @@ -3490,7 +3490,7 @@ extern u8 regmask[8]; /* remote control decoder */ extern int af9005_rc_decode(struct dvb_usb_device *d, u8 * data, int len, u32 * event, int *state); -extern struct dvb_usb_rc_key af9005_rc_keys[]; -extern int af9005_rc_keys_size; +extern struct dvb_usb_rc_key ir_codes_af9005_table[]; +extern int ir_codes_af9005_table_size; #endif diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c index d5ba1de8f07..66c7c3ea799 100644 --- a/drivers/media/dvb/dvb-usb/af9015.c +++ b/drivers/media/dvb/dvb-usb/af9015.c @@ -752,19 +752,19 @@ static const struct af9015_setup *af9015_setup_match(unsigned int id, static const struct af9015_setup af9015_setup_modparam[] = { { AF9015_REMOTE_A_LINK_DTU_M, - af9015_rc_keys_a_link, ARRAY_SIZE(af9015_rc_keys_a_link), + ir_codes_af9015_table_a_link, ARRAY_SIZE(ir_codes_af9015_table_a_link), af9015_ir_table_a_link, ARRAY_SIZE(af9015_ir_table_a_link) }, { AF9015_REMOTE_MSI_DIGIVOX_MINI_II_V3, - af9015_rc_keys_msi, ARRAY_SIZE(af9015_rc_keys_msi), + ir_codes_af9015_table_msi, ARRAY_SIZE(ir_codes_af9015_table_msi), af9015_ir_table_msi, ARRAY_SIZE(af9015_ir_table_msi) }, { AF9015_REMOTE_MYGICTV_U718, - af9015_rc_keys_mygictv, ARRAY_SIZE(af9015_rc_keys_mygictv), + ir_codes_af9015_table_mygictv, ARRAY_SIZE(ir_codes_af9015_table_mygictv), af9015_ir_table_mygictv, ARRAY_SIZE(af9015_ir_table_mygictv) }, { AF9015_REMOTE_DIGITTRADE_DVB_T, - af9015_rc_keys_digittrade, ARRAY_SIZE(af9015_rc_keys_digittrade), + ir_codes_af9015_table_digittrade, ARRAY_SIZE(ir_codes_af9015_table_digittrade), af9015_ir_table_digittrade, ARRAY_SIZE(af9015_ir_table_digittrade) }, { AF9015_REMOTE_AVERMEDIA_KS, - af9015_rc_keys_avermedia, ARRAY_SIZE(af9015_rc_keys_avermedia), + ir_codes_af9015_table_avermedia, ARRAY_SIZE(ir_codes_af9015_table_avermedia), af9015_ir_table_avermedia_ks, ARRAY_SIZE(af9015_ir_table_avermedia_ks) }, { } }; @@ -772,32 +772,32 @@ static const struct af9015_setup af9015_setup_modparam[] = { /* don't add new entries here anymore, use hashes instead */ static const struct af9015_setup af9015_setup_usbids[] = { { USB_VID_LEADTEK, - af9015_rc_keys_leadtek, ARRAY_SIZE(af9015_rc_keys_leadtek), + ir_codes_af9015_table_leadtek, ARRAY_SIZE(ir_codes_af9015_table_leadtek), af9015_ir_table_leadtek, ARRAY_SIZE(af9015_ir_table_leadtek) }, { USB_VID_VISIONPLUS, - af9015_rc_keys_twinhan, ARRAY_SIZE(af9015_rc_keys_twinhan), + ir_codes_af9015_table_twinhan, ARRAY_SIZE(ir_codes_af9015_table_twinhan), af9015_ir_table_twinhan, ARRAY_SIZE(af9015_ir_table_twinhan) }, { USB_VID_KWORLD_2, /* TODO: use correct rc keys */ - af9015_rc_keys_twinhan, ARRAY_SIZE(af9015_rc_keys_twinhan), + ir_codes_af9015_table_twinhan, ARRAY_SIZE(ir_codes_af9015_table_twinhan), af9015_ir_table_kworld, ARRAY_SIZE(af9015_ir_table_kworld) }, { USB_VID_AVERMEDIA, - af9015_rc_keys_avermedia, ARRAY_SIZE(af9015_rc_keys_avermedia), + ir_codes_af9015_table_avermedia, ARRAY_SIZE(ir_codes_af9015_table_avermedia), af9015_ir_table_avermedia, ARRAY_SIZE(af9015_ir_table_avermedia) }, { USB_VID_MSI_2, - af9015_rc_keys_msi_digivox_iii, ARRAY_SIZE(af9015_rc_keys_msi_digivox_iii), + ir_codes_af9015_table_msi_digivox_iii, ARRAY_SIZE(ir_codes_af9015_table_msi_digivox_iii), af9015_ir_table_msi_digivox_iii, ARRAY_SIZE(af9015_ir_table_msi_digivox_iii) }, { } }; static const struct af9015_setup af9015_setup_hashes[] = { { 0xb8feb708, - af9015_rc_keys_msi, ARRAY_SIZE(af9015_rc_keys_msi), + ir_codes_af9015_table_msi, ARRAY_SIZE(ir_codes_af9015_table_msi), af9015_ir_table_msi, ARRAY_SIZE(af9015_ir_table_msi) }, { 0xa3703d00, - af9015_rc_keys_a_link, ARRAY_SIZE(af9015_rc_keys_a_link), + ir_codes_af9015_table_a_link, ARRAY_SIZE(ir_codes_af9015_table_a_link), af9015_ir_table_a_link, ARRAY_SIZE(af9015_ir_table_a_link) }, { 0x9b7dc64e, - af9015_rc_keys_mygictv, ARRAY_SIZE(af9015_rc_keys_mygictv), + ir_codes_af9015_table_mygictv, ARRAY_SIZE(ir_codes_af9015_table_mygictv), af9015_ir_table_mygictv, ARRAY_SIZE(af9015_ir_table_mygictv) }, { } }; @@ -836,8 +836,8 @@ static void af9015_set_remote_config(struct usb_device *udev, } else if (udev->descriptor.idProduct == cpu_to_le16(USB_PID_TREKSTOR_DVBT)) { table = &(const struct af9015_setup){ 0, - af9015_rc_keys_trekstor, - ARRAY_SIZE(af9015_rc_keys_trekstor), + ir_codes_af9015_table_trekstor, + ARRAY_SIZE(ir_codes_af9015_table_trekstor), af9015_ir_table_trekstor, ARRAY_SIZE(af9015_ir_table_trekstor) }; diff --git a/drivers/media/dvb/dvb-usb/af9015.h b/drivers/media/dvb/dvb-usb/af9015.h index ef36b183149..63b2a4907b7 100644 --- a/drivers/media/dvb/dvb-usb/af9015.h +++ b/drivers/media/dvb/dvb-usb/af9015.h @@ -123,7 +123,7 @@ enum af9015_remote { /* LeadTek - Y04G0051 */ /* Leadtek WinFast DTV Dongle Gold */ -static struct dvb_usb_rc_key af9015_rc_keys_leadtek[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_leadtek[] = { { 0x001e, KEY_1 }, { 0x001f, KEY_2 }, { 0x0020, KEY_3 }, @@ -227,7 +227,7 @@ static u8 af9015_ir_table_leadtek[] = { }; /* TwinHan AzureWave AD-TU700(704J) */ -static struct dvb_usb_rc_key af9015_rc_keys_twinhan[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_twinhan[] = { { 0x053f, KEY_POWER }, { 0x0019, KEY_FAVORITES }, /* Favorite List */ { 0x0004, KEY_TEXT }, /* Teletext */ @@ -338,7 +338,7 @@ static u8 af9015_ir_table_twinhan[] = { }; /* A-Link DTU(m) */ -static struct dvb_usb_rc_key af9015_rc_keys_a_link[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_a_link[] = { { 0x001e, KEY_1 }, { 0x001f, KEY_2 }, { 0x0020, KEY_3 }, @@ -381,7 +381,7 @@ static u8 af9015_ir_table_a_link[] = { }; /* MSI DIGIVOX mini II V3.0 */ -static struct dvb_usb_rc_key af9015_rc_keys_msi[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_msi[] = { { 0x001e, KEY_1 }, { 0x001f, KEY_2 }, { 0x0020, KEY_3 }, @@ -424,7 +424,7 @@ static u8 af9015_ir_table_msi[] = { }; /* MYGICTV U718 */ -static struct dvb_usb_rc_key af9015_rc_keys_mygictv[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_mygictv[] = { { 0x003d, KEY_SWITCHVIDEOMODE }, /* TV / AV */ { 0x0545, KEY_POWER }, @@ -550,7 +550,7 @@ static u8 af9015_ir_table_kworld[] = { }; /* AverMedia Volar X */ -static struct dvb_usb_rc_key af9015_rc_keys_avermedia[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_avermedia[] = { { 0x053d, KEY_PROG1 }, /* SOURCE */ { 0x0512, KEY_POWER }, /* POWER */ { 0x051e, KEY_1 }, /* 1 */ @@ -656,7 +656,7 @@ static u8 af9015_ir_table_avermedia_ks[] = { }; /* Digittrade DVB-T USB Stick */ -static struct dvb_usb_rc_key af9015_rc_keys_digittrade[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_digittrade[] = { { 0x010f, KEY_LAST }, /* RETURN */ { 0x0517, KEY_TEXT }, /* TELETEXT */ { 0x0108, KEY_EPG }, /* EPG */ @@ -719,7 +719,7 @@ static u8 af9015_ir_table_digittrade[] = { }; /* TREKSTOR DVB-T USB Stick */ -static struct dvb_usb_rc_key af9015_rc_keys_trekstor[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_trekstor[] = { { 0x0704, KEY_AGAIN }, /* Home */ { 0x0705, KEY_MUTE }, /* Mute */ { 0x0706, KEY_UP }, /* Up */ @@ -782,7 +782,7 @@ static u8 af9015_ir_table_trekstor[] = { }; /* MSI DIGIVOX mini III */ -static struct dvb_usb_rc_key af9015_rc_keys_msi_digivox_iii[] = { +static struct dvb_usb_rc_key ir_codes_af9015_table_msi_digivox_iii[] = { { 0x0713, KEY_POWER }, /* [red power button] */ { 0x073b, KEY_VIDEO }, /* Source */ { 0x073e, KEY_ZOOM }, /* Zoom */ diff --git a/drivers/media/dvb/dvb-usb/anysee.c b/drivers/media/dvb/dvb-usb/anysee.c index bb69f3719f9..faca1ad88a6 100644 --- a/drivers/media/dvb/dvb-usb/anysee.c +++ b/drivers/media/dvb/dvb-usb/anysee.c @@ -399,7 +399,7 @@ static int anysee_rc_query(struct dvb_usb_device *d, u32 *event, int *state) return 0; } -static struct dvb_usb_rc_key anysee_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_anysee_table[] = { { 0x0100, KEY_0 }, { 0x0101, KEY_1 }, { 0x0102, KEY_2 }, @@ -518,8 +518,8 @@ static struct dvb_usb_device_properties anysee_properties = { } }, - .rc_key_map = anysee_rc_keys, - .rc_key_map_size = ARRAY_SIZE(anysee_rc_keys), + .rc_key_map = ir_codes_anysee_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_anysee_table), .rc_query = anysee_rc_query, .rc_interval = 200, /* windows driver uses 500ms */ diff --git a/drivers/media/dvb/dvb-usb/az6027.c b/drivers/media/dvb/dvb-usb/az6027.c index 30ea3eff1ef..8934788bd83 100644 --- a/drivers/media/dvb/dvb-usb/az6027.c +++ b/drivers/media/dvb/dvb-usb/az6027.c @@ -386,7 +386,7 @@ static int az6027_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) } /* keys for the enclosed remote control */ -static struct dvb_usb_rc_key az6027_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_az6027_table[] = { { 0x01, KEY_1 }, { 0x02, KEY_2 }, }; @@ -1096,8 +1096,8 @@ static struct dvb_usb_device_properties az6027_properties = { .power_ctrl = az6027_power_ctrl, .read_mac_address = az6027_read_mac_addr, */ - .rc_key_map = az6027_rc_keys, - .rc_key_map_size = ARRAY_SIZE(az6027_rc_keys), + .rc_key_map = ir_codes_az6027_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_az6027_table), .rc_interval = 400, .rc_query = az6027_rc_query, .i2c_algo = &az6027_i2c_algo, diff --git a/drivers/media/dvb/dvb-usb/cinergyT2-core.c b/drivers/media/dvb/dvb-usb/cinergyT2-core.c index e37ac4d4860..5a9c14bdc98 100644 --- a/drivers/media/dvb/dvb-usb/cinergyT2-core.c +++ b/drivers/media/dvb/dvb-usb/cinergyT2-core.c @@ -84,7 +84,7 @@ static int cinergyt2_frontend_attach(struct dvb_usb_adapter *adap) return 0; } -static struct dvb_usb_rc_key cinergyt2_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_cinergyt2_table[] = { { 0x0401, KEY_POWER }, { 0x0402, KEY_1 }, { 0x0403, KEY_2 }, @@ -218,8 +218,8 @@ static struct dvb_usb_device_properties cinergyt2_properties = { .power_ctrl = cinergyt2_power_ctrl, .rc_interval = 50, - .rc_key_map = cinergyt2_rc_keys, - .rc_key_map_size = ARRAY_SIZE(cinergyt2_rc_keys), + .rc_key_map = ir_codes_cinergyt2_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_cinergyt2_table), .rc_query = cinergyt2_rc_query, .generic_bulk_ctrl_endpoint = 1, diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index 960376da7d5..33a83f93e7c 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c @@ -461,7 +461,7 @@ static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d, u32 *event, return 0; } -static struct dvb_usb_rc_key dvico_mce_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_dvico_mce_table[] = { { 0xfe02, KEY_TV }, { 0xfe0e, KEY_MP3 }, { 0xfe1a, KEY_DVD }, @@ -509,7 +509,7 @@ static struct dvb_usb_rc_key dvico_mce_rc_keys[] = { { 0xfe4e, KEY_POWER }, }; -static struct dvb_usb_rc_key dvico_portable_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_dvico_portable_table[] = { { 0xfc02, KEY_SETUP }, /* Profile */ { 0xfc43, KEY_POWER2 }, { 0xfc06, KEY_EPG }, @@ -548,7 +548,7 @@ static struct dvb_usb_rc_key dvico_portable_rc_keys[] = { { 0xfc00, KEY_UNKNOWN }, /* HD */ }; -static struct dvb_usb_rc_key d680_dmb_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_d680_dmb_table[] = { { 0x0038, KEY_UNKNOWN }, /* TV/AV */ { 0x080c, KEY_ZOOM }, { 0x0800, KEY_0 }, @@ -1449,8 +1449,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_lgh064f_properties = { .i2c_algo = &cxusb_i2c_algo, .rc_interval = 100, - .rc_key_map = dvico_portable_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys), + .rc_key_map = ir_codes_dvico_portable_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_portable_table), .rc_query = cxusb_rc_query, .generic_bulk_ctrl_endpoint = 0x01, @@ -1500,8 +1500,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties = { .i2c_algo = &cxusb_i2c_algo, .rc_interval = 150, - .rc_key_map = dvico_mce_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys), + .rc_key_map = ir_codes_dvico_mce_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_mce_table), .rc_query = cxusb_rc_query, .generic_bulk_ctrl_endpoint = 0x01, @@ -1559,8 +1559,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties = { .i2c_algo = &cxusb_i2c_algo, .rc_interval = 100, - .rc_key_map = dvico_portable_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys), + .rc_key_map = ir_codes_dvico_portable_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_portable_table), .rc_query = cxusb_rc_query, .generic_bulk_ctrl_endpoint = 0x01, @@ -1609,8 +1609,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties = { .i2c_algo = &cxusb_i2c_algo, .rc_interval = 100, - .rc_key_map = dvico_portable_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys), + .rc_key_map = ir_codes_dvico_portable_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_portable_table), .rc_query = cxusb_rc_query, .generic_bulk_ctrl_endpoint = 0x01, @@ -1658,8 +1658,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties = { .generic_bulk_ctrl_endpoint = 0x01, .rc_interval = 100, - .rc_key_map = dvico_mce_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys), + .rc_key_map = ir_codes_dvico_mce_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_mce_table), .rc_query = cxusb_bluebird2_rc_query, .num_device_descs = 1, @@ -1706,8 +1706,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_nano2_properties = { .generic_bulk_ctrl_endpoint = 0x01, .rc_interval = 100, - .rc_key_map = dvico_portable_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys), + .rc_key_map = ir_codes_dvico_portable_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_portable_table), .rc_query = cxusb_bluebird2_rc_query, .num_device_descs = 1, @@ -1756,8 +1756,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_nano2_needsfirmware_prope .generic_bulk_ctrl_endpoint = 0x01, .rc_interval = 100, - .rc_key_map = dvico_portable_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys), + .rc_key_map = ir_codes_dvico_portable_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_portable_table), .rc_query = cxusb_rc_query, .num_device_descs = 1, @@ -1847,8 +1847,8 @@ struct dvb_usb_device_properties cxusb_bluebird_dualdig4_rev2_properties = { .generic_bulk_ctrl_endpoint = 0x01, .rc_interval = 100, - .rc_key_map = dvico_mce_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys), + .rc_key_map = ir_codes_dvico_mce_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_mce_table), .rc_query = cxusb_rc_query, .num_device_descs = 1, @@ -1895,8 +1895,8 @@ static struct dvb_usb_device_properties cxusb_d680_dmb_properties = { .generic_bulk_ctrl_endpoint = 0x01, .rc_interval = 100, - .rc_key_map = d680_dmb_rc_keys, - .rc_key_map_size = ARRAY_SIZE(d680_dmb_rc_keys), + .rc_key_map = ir_codes_d680_dmb_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_d680_dmb_table), .rc_query = cxusb_d680_dmb_rc_query, .num_device_descs = 1, @@ -1944,8 +1944,8 @@ static struct dvb_usb_device_properties cxusb_mygica_d689_properties = { .generic_bulk_ctrl_endpoint = 0x01, .rc_interval = 100, - .rc_key_map = d680_dmb_rc_keys, - .rc_key_map_size = ARRAY_SIZE(d680_dmb_rc_keys), + .rc_key_map = ir_codes_d680_dmb_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_d680_dmb_table), .rc_query = cxusb_d680_dmb_rc_query, .num_device_descs = 1, diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c index 34eab05afc6..2deca210d5a 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c @@ -562,7 +562,7 @@ static int dib0700_rc_query(struct dvb_usb_device *d, u32 *event, int *state) return 0; } -static struct dvb_usb_rc_key dib0700_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_dib0700_table[] = { /* Key codes for the tiny Pinnacle remote*/ { 0x0700, KEY_MUTE }, { 0x0701, KEY_MENU }, /* Pinnacle logo */ @@ -2131,8 +2131,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dib0700_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), .rc_query = dib0700_rc_query }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, @@ -2160,8 +2160,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dib0700_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), .rc_query = dib0700_rc_query }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, @@ -2214,8 +2214,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dib0700_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), .rc_query = dib0700_rc_query }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, @@ -2251,8 +2251,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dib0700_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), .rc_query = dib0700_rc_query }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, @@ -2321,8 +2321,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dib0700_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), .rc_query = dib0700_rc_query }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, @@ -2360,8 +2360,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dib0700_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), .rc_query = dib0700_rc_query }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, @@ -2422,8 +2422,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { } }, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dib0700_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), .rc_query = dib0700_rc_query }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, @@ -2484,8 +2484,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, }, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dib0700_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), .rc_query = dib0700_rc_query }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 1, @@ -2513,8 +2513,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, }, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dib0700_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), .rc_query = dib0700_rc_query }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 1, @@ -2574,8 +2574,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, }, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dib0700_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), .rc_query = dib0700_rc_query }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 1, @@ -2612,8 +2612,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dib0700_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), .rc_query = dib0700_rc_query }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, @@ -2656,8 +2656,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dib0700_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), .rc_query = dib0700_rc_query }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, .num_adapters = 1, @@ -2687,8 +2687,8 @@ struct dvb_usb_device_properties dib0700_devices[] = { }, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dib0700_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), + .rc_key_map = ir_codes_dib0700_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dib0700_table), .rc_query = dib0700_rc_query }, }; diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c index 9143b5631e8..bc08bc0b723 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-common.c +++ b/drivers/media/dvb/dvb-usb/dibusb-common.c @@ -327,7 +327,7 @@ EXPORT_SYMBOL(dibusb_dib3000mc_tuner_attach); /* * common remote control stuff */ -struct dvb_usb_rc_key dibusb_rc_keys[] = { +struct dvb_usb_rc_key ir_codes_dibusb_table[] = { /* Key codes for the little Artec T1/Twinhan/HAMA/ remote. */ { 0x0016, KEY_POWER }, { 0x0010, KEY_MUTE }, @@ -456,7 +456,7 @@ struct dvb_usb_rc_key dibusb_rc_keys[] = { { 0x804e, KEY_ENTER }, { 0x804f, KEY_VOLUMEDOWN }, }; -EXPORT_SYMBOL(dibusb_rc_keys); +EXPORT_SYMBOL(ir_codes_dibusb_table); int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state) { diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c b/drivers/media/dvb/dvb-usb/dibusb-mb.c index 5c0126dc1ff..eb2e6f050fb 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-mb.c +++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c @@ -212,7 +212,7 @@ static struct dvb_usb_device_properties dibusb1_1_properties = { .power_ctrl = dibusb_power_ctrl, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dibusb_rc_keys, + .rc_key_map = ir_codes_dibusb_table, .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ .rc_query = dibusb_rc_query, @@ -296,7 +296,7 @@ static struct dvb_usb_device_properties dibusb1_1_an2235_properties = { .power_ctrl = dibusb_power_ctrl, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dibusb_rc_keys, + .rc_key_map = ir_codes_dibusb_table, .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ .rc_query = dibusb_rc_query, @@ -360,7 +360,7 @@ static struct dvb_usb_device_properties dibusb2_0b_properties = { .power_ctrl = dibusb2_0_power_ctrl, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dibusb_rc_keys, + .rc_key_map = ir_codes_dibusb_table, .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ .rc_query = dibusb_rc_query, @@ -417,7 +417,7 @@ static struct dvb_usb_device_properties artec_t1_usb2_properties = { .power_ctrl = dibusb2_0_power_ctrl, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dibusb_rc_keys, + .rc_key_map = ir_codes_dibusb_table, .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ .rc_query = dibusb_rc_query, diff --git a/drivers/media/dvb/dvb-usb/dibusb-mc.c b/drivers/media/dvb/dvb-usb/dibusb-mc.c index a05b9f87566..588308eb663 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-mc.c +++ b/drivers/media/dvb/dvb-usb/dibusb-mc.c @@ -82,7 +82,7 @@ static struct dvb_usb_device_properties dibusb_mc_properties = { .power_ctrl = dibusb2_0_power_ctrl, .rc_interval = DEFAULT_RC_INTERVAL, - .rc_key_map = dibusb_rc_keys, + .rc_key_map = ir_codes_dibusb_table, .rc_key_map_size = 111, /* FIXME */ .rc_query = dibusb_rc_query, diff --git a/drivers/media/dvb/dvb-usb/dibusb.h b/drivers/media/dvb/dvb-usb/dibusb.h index 8e847aa73ba..3d50ac59088 100644 --- a/drivers/media/dvb/dvb-usb/dibusb.h +++ b/drivers/media/dvb/dvb-usb/dibusb.h @@ -124,7 +124,7 @@ extern int dibusb2_0_power_ctrl(struct dvb_usb_device *, int); #define DEFAULT_RC_INTERVAL 150 //#define DEFAULT_RC_INTERVAL 100000 -extern struct dvb_usb_rc_key dibusb_rc_keys[]; +extern struct dvb_usb_rc_key ir_codes_dibusb_table[]; extern int dibusb_rc_query(struct dvb_usb_device *, u32 *, int *); extern int dibusb_read_eeprom_byte(struct dvb_usb_device *, u8, u8 *); diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index 955147d0075..e826077094f 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c @@ -161,7 +161,7 @@ static int digitv_tuner_attach(struct dvb_usb_adapter *adap) return 0; } -static struct dvb_usb_rc_key digitv_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_digitv_table[] = { { 0x5f55, KEY_0 }, { 0x6f55, KEY_1 }, { 0x9f55, KEY_2 }, @@ -311,8 +311,8 @@ static struct dvb_usb_device_properties digitv_properties = { .identify_state = digitv_identify_state, .rc_interval = 1000, - .rc_key_map = digitv_rc_keys, - .rc_key_map_size = ARRAY_SIZE(digitv_rc_keys), + .rc_key_map = ir_codes_digitv_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_digitv_table), .rc_query = digitv_rc_query, .i2c_algo = &digitv_i2c_algo, diff --git a/drivers/media/dvb/dvb-usb/dtt200u.c b/drivers/media/dvb/dvb-usb/dtt200u.c index a1b12b01cbe..f57e59044d4 100644 --- a/drivers/media/dvb/dvb-usb/dtt200u.c +++ b/drivers/media/dvb/dvb-usb/dtt200u.c @@ -57,7 +57,7 @@ static int dtt200u_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, /* remote control */ /* key list for the tiny remote control (Yakumo, don't know about the others) */ -static struct dvb_usb_rc_key dtt200u_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_dtt200u_table[] = { { 0x8001, KEY_MUTE }, { 0x8002, KEY_CHANNELDOWN }, { 0x8003, KEY_VOLUMEDOWN }, @@ -162,8 +162,8 @@ static struct dvb_usb_device_properties dtt200u_properties = { .power_ctrl = dtt200u_power_ctrl, .rc_interval = 300, - .rc_key_map = dtt200u_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys), + .rc_key_map = ir_codes_dtt200u_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dtt200u_table), .rc_query = dtt200u_rc_query, .generic_bulk_ctrl_endpoint = 0x01, @@ -207,8 +207,8 @@ static struct dvb_usb_device_properties wt220u_properties = { .power_ctrl = dtt200u_power_ctrl, .rc_interval = 300, - .rc_key_map = dtt200u_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys), + .rc_key_map = ir_codes_dtt200u_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dtt200u_table), .rc_query = dtt200u_rc_query, .generic_bulk_ctrl_endpoint = 0x01, @@ -252,8 +252,8 @@ static struct dvb_usb_device_properties wt220u_fc_properties = { .power_ctrl = dtt200u_power_ctrl, .rc_interval = 300, - .rc_key_map = dtt200u_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys), + .rc_key_map = ir_codes_dtt200u_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dtt200u_table), .rc_query = dtt200u_rc_query, .generic_bulk_ctrl_endpoint = 0x01, @@ -297,8 +297,8 @@ static struct dvb_usb_device_properties wt220u_zl0353_properties = { .power_ctrl = dtt200u_power_ctrl, .rc_interval = 300, - .rc_key_map = dtt200u_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys), + .rc_key_map = ir_codes_dtt200u_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dtt200u_table), .rc_query = dtt200u_rc_query, .generic_bulk_ctrl_endpoint = 0x01, diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c index accc65509b0..e8fb8538067 100644 --- a/drivers/media/dvb/dvb-usb/dw2102.c +++ b/drivers/media/dvb/dvb-usb/dw2102.c @@ -73,7 +73,7 @@ "Please see linux/Documentation/dvb/ for more details " \ "on firmware-problems." -struct dvb_usb_rc_keys_table { +struct ir_codes_dvb_usb_table_table { struct dvb_usb_rc_key *rc_keys; int rc_keys_size; }; @@ -948,7 +948,7 @@ static int dw3101_tuner_attach(struct dvb_usb_adapter *adap) return 0; } -static struct dvb_usb_rc_key dw210x_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_dw210x_table[] = { { 0xf80a, KEY_Q }, /*power*/ { 0xf80c, KEY_M }, /*mute*/ { 0xf811, KEY_1 }, @@ -982,7 +982,7 @@ static struct dvb_usb_rc_key dw210x_rc_keys[] = { { 0xf81b, KEY_B }, /*recall*/ }; -static struct dvb_usb_rc_key tevii_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_tevii_table[] = { { 0xf80a, KEY_POWER }, { 0xf80c, KEY_MUTE }, { 0xf811, KEY_1 }, @@ -1032,7 +1032,7 @@ static struct dvb_usb_rc_key tevii_rc_keys[] = { { 0xf858, KEY_SWITCHVIDEOMODE }, }; -static struct dvb_usb_rc_key tbs_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_tbs_table[] = { { 0xf884, KEY_POWER }, { 0xf894, KEY_MUTE }, { 0xf887, KEY_1 }, @@ -1067,10 +1067,10 @@ static struct dvb_usb_rc_key tbs_rc_keys[] = { { 0xf89b, KEY_MODE } }; -static struct dvb_usb_rc_keys_table keys_tables[] = { - { dw210x_rc_keys, ARRAY_SIZE(dw210x_rc_keys) }, - { tevii_rc_keys, ARRAY_SIZE(tevii_rc_keys) }, - { tbs_rc_keys, ARRAY_SIZE(tbs_rc_keys) }, +static struct ir_codes_dvb_usb_table_table keys_tables[] = { + { ir_codes_dw210x_table, ARRAY_SIZE(ir_codes_dw210x_table) }, + { ir_codes_tevii_table, ARRAY_SIZE(ir_codes_tevii_table) }, + { ir_codes_tbs_table, ARRAY_SIZE(ir_codes_tbs_table) }, }; static int dw2102_rc_query(struct dvb_usb_device *d, u32 *event, int *state) @@ -1185,14 +1185,14 @@ static int dw2102_load_firmware(struct usb_device *dev, /* init registers */ switch (dev->descriptor.idProduct) { case USB_PID_PROF_1100: - s6x0_properties.rc_key_map = tbs_rc_keys; + s6x0_properties.rc_key_map = ir_codes_tbs_table; s6x0_properties.rc_key_map_size = - ARRAY_SIZE(tbs_rc_keys); + ARRAY_SIZE(ir_codes_tbs_table); break; case USB_PID_TEVII_S650: - dw2104_properties.rc_key_map = tevii_rc_keys; + dw2104_properties.rc_key_map = ir_codes_tevii_table; dw2104_properties.rc_key_map_size = - ARRAY_SIZE(tevii_rc_keys); + ARRAY_SIZE(ir_codes_tevii_table); case USB_PID_DW2104: reset = 1; dw210x_op_rw(dev, 0xc4, 0x0000, 0, &reset, 1, @@ -1255,8 +1255,8 @@ static struct dvb_usb_device_properties dw2102_properties = { .no_reconnect = 1, .i2c_algo = &dw2102_serit_i2c_algo, - .rc_key_map = dw210x_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dw210x_rc_keys), + .rc_key_map = ir_codes_dw210x_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dw210x_table), .rc_interval = 150, .rc_query = dw2102_rc_query, @@ -1306,8 +1306,8 @@ static struct dvb_usb_device_properties dw2104_properties = { .no_reconnect = 1, .i2c_algo = &dw2104_i2c_algo, - .rc_key_map = dw210x_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dw210x_rc_keys), + .rc_key_map = ir_codes_dw210x_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dw210x_table), .rc_interval = 150, .rc_query = dw2102_rc_query, @@ -1353,8 +1353,8 @@ static struct dvb_usb_device_properties dw3101_properties = { .no_reconnect = 1, .i2c_algo = &dw3101_i2c_algo, - .rc_key_map = dw210x_rc_keys, - .rc_key_map_size = ARRAY_SIZE(dw210x_rc_keys), + .rc_key_map = ir_codes_dw210x_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_dw210x_table), .rc_interval = 150, .rc_query = dw2102_rc_query, @@ -1396,8 +1396,8 @@ static struct dvb_usb_device_properties s6x0_properties = { .no_reconnect = 1, .i2c_algo = &s6x0_i2c_algo, - .rc_key_map = tevii_rc_keys, - .rc_key_map_size = ARRAY_SIZE(tevii_rc_keys), + .rc_key_map = ir_codes_tevii_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_tevii_table), .rc_interval = 150, .rc_query = dw2102_rc_query, @@ -1459,8 +1459,8 @@ static int dw2102_probe(struct usb_interface *intf, /* fill only different fields */ p7500->firmware = "dvb-usb-p7500.fw"; p7500->devices[0] = d7500; - p7500->rc_key_map = tbs_rc_keys; - p7500->rc_key_map_size = ARRAY_SIZE(tbs_rc_keys); + p7500->rc_key_map = ir_codes_tbs_table; + p7500->rc_key_map_size = ARRAY_SIZE(ir_codes_tbs_table); p7500->adapter->frontend_attach = prof_7500_frontend_attach; if (0 == dvb_usb_device_init(intf, &dw2102_properties, diff --git a/drivers/media/dvb/dvb-usb/m920x.c b/drivers/media/dvb/dvb-usb/m920x.c index 737ffa36ac9..c211fef45fc 100644 --- a/drivers/media/dvb/dvb-usb/m920x.c +++ b/drivers/media/dvb/dvb-usb/m920x.c @@ -589,7 +589,7 @@ static struct m920x_inits pinnacle310e_init[] = { }; /* ir keymaps */ -static struct dvb_usb_rc_key megasky_rc_keys [] = { +static struct dvb_usb_rc_key ir_codes_megasky_table [] = { { 0x0012, KEY_POWER }, { 0x001e, KEY_CYCLEWINDOWS }, /* min/max */ { 0x0002, KEY_CHANNELUP }, @@ -608,7 +608,7 @@ static struct dvb_usb_rc_key megasky_rc_keys [] = { { 0x000e, KEY_COFFEE }, /* "MTS" */ }; -static struct dvb_usb_rc_key tvwalkertwin_rc_keys [] = { +static struct dvb_usb_rc_key ir_codes_tvwalkertwin_table [] = { { 0x0001, KEY_ZOOM }, /* Full Screen */ { 0x0002, KEY_CAMERA }, /* snapshot */ { 0x0003, KEY_MUTE }, @@ -628,7 +628,7 @@ static struct dvb_usb_rc_key tvwalkertwin_rc_keys [] = { { 0x001e, KEY_VOLUMEUP }, }; -static struct dvb_usb_rc_key pinnacle310e_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_pinnacle310e_table[] = { { 0x16, KEY_POWER }, { 0x17, KEY_FAVORITES }, { 0x0f, KEY_TEXT }, @@ -785,8 +785,8 @@ static struct dvb_usb_device_properties megasky_properties = { .download_firmware = m920x_firmware_download, .rc_interval = 100, - .rc_key_map = megasky_rc_keys, - .rc_key_map_size = ARRAY_SIZE(megasky_rc_keys), + .rc_key_map = ir_codes_megasky_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_megasky_table), .rc_query = m920x_rc_query, .size_of_priv = sizeof(struct m920x_state), @@ -886,8 +886,8 @@ static struct dvb_usb_device_properties tvwalkertwin_properties = { .download_firmware = m920x_firmware_download, .rc_interval = 100, - .rc_key_map = tvwalkertwin_rc_keys, - .rc_key_map_size = ARRAY_SIZE(tvwalkertwin_rc_keys), + .rc_key_map = ir_codes_tvwalkertwin_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_tvwalkertwin_table), .rc_query = m920x_rc_query, .size_of_priv = sizeof(struct m920x_state), @@ -993,8 +993,8 @@ static struct dvb_usb_device_properties pinnacle_pctv310e_properties = { .download_firmware = NULL, .rc_interval = 100, - .rc_key_map = pinnacle310e_rc_keys, - .rc_key_map_size = ARRAY_SIZE(pinnacle310e_rc_keys), + .rc_key_map = ir_codes_pinnacle310e_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_pinnacle310e_table), .rc_query = m920x_rc_query, .size_of_priv = sizeof(struct m920x_state), diff --git a/drivers/media/dvb/dvb-usb/nova-t-usb2.c b/drivers/media/dvb/dvb-usb/nova-t-usb2.c index b41d66ef832..d195a587cc6 100644 --- a/drivers/media/dvb/dvb-usb/nova-t-usb2.c +++ b/drivers/media/dvb/dvb-usb/nova-t-usb2.c @@ -21,7 +21,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); #define deb_ee(args...) dprintk(debug,0x02,args) /* Hauppauge NOVA-T USB2 keys */ -static struct dvb_usb_rc_key haupp_rc_keys [] = { +static struct dvb_usb_rc_key ir_codes_haupp_table [] = { { 0x1e00, KEY_0 }, { 0x1e01, KEY_1 }, { 0x1e02, KEY_2 }, @@ -91,14 +91,14 @@ static int nova_t_rc_query(struct dvb_usb_device *d, u32 *event, int *state) deb_rc("raw key code 0x%02x, 0x%02x, 0x%02x to c: %02x d: %02x toggle: %d\n",key[1],key[2],key[3],custom,data,toggle); - for (i = 0; i < ARRAY_SIZE(haupp_rc_keys); i++) { - if (rc5_data(&haupp_rc_keys[i]) == data && - rc5_custom(&haupp_rc_keys[i]) == custom) { + for (i = 0; i < ARRAY_SIZE(ir_codes_haupp_table); i++) { + if (rc5_data(&ir_codes_haupp_table[i]) == data && + rc5_custom(&ir_codes_haupp_table[i]) == custom) { - deb_rc("c: %x, d: %x\n", rc5_data(&haupp_rc_keys[i]), - rc5_custom(&haupp_rc_keys[i])); + deb_rc("c: %x, d: %x\n", rc5_data(&ir_codes_haupp_table[i]), + rc5_custom(&ir_codes_haupp_table[i])); - *event = haupp_rc_keys[i].event; + *event = ir_codes_haupp_table[i].event; *state = REMOTE_KEY_PRESSED; if (st->old_toggle == toggle) { if (st->last_repeat_count++ < 2) @@ -196,8 +196,8 @@ static struct dvb_usb_device_properties nova_t_properties = { .read_mac_address = nova_t_read_mac_address, .rc_interval = 100, - .rc_key_map = haupp_rc_keys, - .rc_key_map_size = ARRAY_SIZE(haupp_rc_keys), + .rc_key_map = ir_codes_haupp_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_haupp_table), .rc_query = nova_t_rc_query, .i2c_algo = &dibusb_i2c_algo, diff --git a/drivers/media/dvb/dvb-usb/opera1.c b/drivers/media/dvb/dvb-usb/opera1.c index 830557696ae..dfb81ff1d9a 100644 --- a/drivers/media/dvb/dvb-usb/opera1.c +++ b/drivers/media/dvb/dvb-usb/opera1.c @@ -35,7 +35,7 @@ struct opera1_state { u32 last_key_pressed; }; -struct opera_rc_keys { +struct ir_codes_opera_table { u32 keycode; u32 event; }; @@ -331,7 +331,7 @@ static int opera1_pid_filter_control(struct dvb_usb_adapter *adap, int onoff) return 0; } -static struct dvb_usb_rc_key opera1_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_opera1_table[] = { {0x5fa0, KEY_1}, {0x51af, KEY_2}, {0x5da2, KEY_3}, @@ -404,12 +404,12 @@ static int opera1_rc_query(struct dvb_usb_device *dev, u32 * event, int *state) send_key = (send_key & 0xffff) | 0x0100; - for (i = 0; i < ARRAY_SIZE(opera1_rc_keys); i++) { - if (rc5_scan(&opera1_rc_keys[i]) == (send_key & 0xffff)) { + for (i = 0; i < ARRAY_SIZE(ir_codes_opera1_table); i++) { + if (rc5_scan(&ir_codes_opera1_table[i]) == (send_key & 0xffff)) { *state = REMOTE_KEY_PRESSED; - *event = opera1_rc_keys[i].event; + *event = ir_codes_opera1_table[i].event; opst->last_key_pressed = - opera1_rc_keys[i].event; + ir_codes_opera1_table[i].event; break; } opst->last_key_pressed = 0; @@ -498,8 +498,8 @@ static struct dvb_usb_device_properties opera1_properties = { .power_ctrl = opera1_power_ctrl, .i2c_algo = &opera1_i2c_algo, - .rc_key_map = opera1_rc_keys, - .rc_key_map_size = ARRAY_SIZE(opera1_rc_keys), + .rc_key_map = ir_codes_opera1_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_opera1_table), .rc_interval = 200, .rc_query = opera1_rc_query, .read_mac_address = opera1_read_mac_address, diff --git a/drivers/media/dvb/dvb-usb/vp702x.c b/drivers/media/dvb/dvb-usb/vp702x.c index ef4e37d9c5f..4d332451653 100644 --- a/drivers/media/dvb/dvb-usb/vp702x.c +++ b/drivers/media/dvb/dvb-usb/vp702x.c @@ -174,7 +174,7 @@ static int vp702x_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) } /* keys for the enclosed remote control */ -static struct dvb_usb_rc_key vp702x_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_vp702x_table[] = { { 0x0001, KEY_1 }, { 0x0002, KEY_2 }, }; @@ -197,10 +197,10 @@ static int vp702x_rc_query(struct dvb_usb_device *d, u32 *event, int *state) return 0; } - for (i = 0; i < ARRAY_SIZE(vp702x_rc_keys); i++) - if (rc5_custom(&vp702x_rc_keys[i]) == key[1]) { + for (i = 0; i < ARRAY_SIZE(ir_codes_vp702x_table); i++) + if (rc5_custom(&ir_codes_vp702x_table[i]) == key[1]) { *state = REMOTE_KEY_PRESSED; - *event = vp702x_rc_keys[i].event; + *event = ir_codes_vp702x_table[i].event; break; } return 0; @@ -283,8 +283,8 @@ static struct dvb_usb_device_properties vp702x_properties = { }, .read_mac_address = vp702x_read_mac_addr, - .rc_key_map = vp702x_rc_keys, - .rc_key_map_size = ARRAY_SIZE(vp702x_rc_keys), + .rc_key_map = ir_codes_vp702x_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_vp702x_table), .rc_interval = 400, .rc_query = vp702x_rc_query, diff --git a/drivers/media/dvb/dvb-usb/vp7045.c b/drivers/media/dvb/dvb-usb/vp7045.c index a59faa27912..036893fa448 100644 --- a/drivers/media/dvb/dvb-usb/vp7045.c +++ b/drivers/media/dvb/dvb-usb/vp7045.c @@ -99,7 +99,7 @@ static int vp7045_power_ctrl(struct dvb_usb_device *d, int onoff) /* The keymapping struct. Somehow this should be loaded to the driver, but * currently it is hardcoded. */ -static struct dvb_usb_rc_key vp7045_rc_keys[] = { +static struct dvb_usb_rc_key ir_codes_vp7045_table[] = { { 0x0016, KEY_POWER }, { 0x0010, KEY_MUTE }, { 0x0003, KEY_1 }, @@ -165,10 +165,10 @@ static int vp7045_rc_query(struct dvb_usb_device *d, u32 *event, int *state) return 0; } - for (i = 0; i < ARRAY_SIZE(vp7045_rc_keys); i++) - if (rc5_data(&vp7045_rc_keys[i]) == key) { + for (i = 0; i < ARRAY_SIZE(ir_codes_vp7045_table); i++) + if (rc5_data(&ir_codes_vp7045_table[i]) == key) { *state = REMOTE_KEY_PRESSED; - *event = vp7045_rc_keys[i].event; + *event = ir_codes_vp7045_table[i].event; break; } return 0; @@ -260,8 +260,8 @@ static struct dvb_usb_device_properties vp7045_properties = { .read_mac_address = vp7045_read_mac_addr, .rc_interval = 400, - .rc_key_map = vp7045_rc_keys, - .rc_key_map_size = ARRAY_SIZE(vp7045_rc_keys), + .rc_key_map = ir_codes_vp7045_table, + .rc_key_map_size = ARRAY_SIZE(ir_codes_vp7045_table), .rc_query = vp7045_rc_query, .num_device_descs = 2, -- cgit v1.2.3-70-g09d2 From b187913c77adbd865194c6b8072764e3474d56ea Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 11 Apr 2010 06:12:52 -0300 Subject: V4L/DVB: Add FE_CAN_PSK_8 to allow apps to identify PSK_8 capable DVB devices The enum fe_caps provides flags that allow an application to detect whether a device is capable of handling various modulation types etc. A flag for detecting PSK_8, however, is missing. This patch adds the flag FE_CAN_PSK_8 to frontend.h and implements it for the gp8psk-fe.c and cx24116.c driver (apparently the only ones with PSK_8). Only the gp8psk-fe.c has been explicitly tested, though. Signed-off-by: Klaus Schmidinger Tested-by: Derek Kelly Acked-by: Manu Abraham Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/gp8psk-fe.c | 2 +- drivers/media/dvb/frontends/cx24116.c | 2 +- include/linux/dvb/frontend.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/gp8psk-fe.c b/drivers/media/dvb/dvb-usb/gp8psk-fe.c index 7a7f1b2b681..39143805f3d 100644 --- a/drivers/media/dvb/dvb-usb/gp8psk-fe.c +++ b/drivers/media/dvb/dvb-usb/gp8psk-fe.c @@ -349,7 +349,7 @@ static struct dvb_frontend_ops gp8psk_fe_ops = { * FE_CAN_QAM_16 is for compatibility * (Myth incorrectly detects Turbo-QPSK as plain QAM-16) */ - FE_CAN_QPSK | FE_CAN_QAM_16 + FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_PSK_8 }, .release = gp8psk_fe_release, diff --git a/drivers/media/dvb/frontends/cx24116.c b/drivers/media/dvb/frontends/cx24116.c index 2410d8b59b6..13ae2c58d79 100644 --- a/drivers/media/dvb/frontends/cx24116.c +++ b/drivers/media/dvb/frontends/cx24116.c @@ -1479,7 +1479,7 @@ static struct dvb_frontend_ops cx24116_ops = { FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_2G_MODULATION | - FE_CAN_QPSK | FE_CAN_RECOVER + FE_CAN_QPSK | FE_CAN_RECOVER | FE_CAN_PSK_8 }, .release = cx24116_release, diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index b6cb5425cde..7c73f0b09e9 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h @@ -62,6 +62,7 @@ typedef enum fe_caps { FE_CAN_8VSB = 0x200000, FE_CAN_16VSB = 0x400000, FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */ + FE_CAN_PSK_8 = 0x8000000, /* frontend supports "8psk modulation" */ FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */ FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */ FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */ -- cgit v1.2.3-70-g09d2 From c683357236969c48f7b945fd718f141bf36e8ba2 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 21 Apr 2010 11:36:57 -0300 Subject: Revert "V4L/DVB: Add FE_CAN_PSK_8 to allow apps to identify PSK_8 capable DVB devices" Patch reverted per Andreas Oberritter request. It is basically not ready yet for upstream merge. This reverts commit 77b2ad374a82e3d740cb1780ff4caedc3e051b37. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/gp8psk-fe.c | 2 +- drivers/media/dvb/frontends/cx24116.c | 2 +- include/linux/dvb/frontend.h | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/gp8psk-fe.c b/drivers/media/dvb/dvb-usb/gp8psk-fe.c index 39143805f3d..7a7f1b2b681 100644 --- a/drivers/media/dvb/dvb-usb/gp8psk-fe.c +++ b/drivers/media/dvb/dvb-usb/gp8psk-fe.c @@ -349,7 +349,7 @@ static struct dvb_frontend_ops gp8psk_fe_ops = { * FE_CAN_QAM_16 is for compatibility * (Myth incorrectly detects Turbo-QPSK as plain QAM-16) */ - FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_PSK_8 + FE_CAN_QPSK | FE_CAN_QAM_16 }, .release = gp8psk_fe_release, diff --git a/drivers/media/dvb/frontends/cx24116.c b/drivers/media/dvb/frontends/cx24116.c index 13ae2c58d79..2410d8b59b6 100644 --- a/drivers/media/dvb/frontends/cx24116.c +++ b/drivers/media/dvb/frontends/cx24116.c @@ -1479,7 +1479,7 @@ static struct dvb_frontend_ops cx24116_ops = { FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_2G_MODULATION | - FE_CAN_QPSK | FE_CAN_RECOVER | FE_CAN_PSK_8 + FE_CAN_QPSK | FE_CAN_RECOVER }, .release = cx24116_release, diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index 7c73f0b09e9..b6cb5425cde 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h @@ -62,7 +62,6 @@ typedef enum fe_caps { FE_CAN_8VSB = 0x200000, FE_CAN_16VSB = 0x400000, FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */ - FE_CAN_PSK_8 = 0x8000000, /* frontend supports "8psk modulation" */ FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */ FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */ FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */ -- cgit v1.2.3-70-g09d2 From 84e2f037ce9672d0fb118e3e82cecfe6122ace3f Mon Sep 17 00:00:00 2001 From: Michael Müller Date: Mon, 26 Apr 2010 22:18:57 -0300 Subject: V4L/DVB: Add Elgato EyeTV Diversity to dibcom driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch introduces support for DVB-T for the following dibcom based card: Elgato EyeTV Diversity (USB-ID: 0fd9:0011) Support for the Elgato silver IR remote is added too (set parameter dvb_usb_dib0700_ir_proto=0) [w.sang@pengutronix.de: rebased to current linuxtv-master] Signed-off-by: Michael Müller Signed-off-by: Wolfram Sang Signed-off-by: Patrick Boettcher Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/dib0700_devices.c | 46 +++++++++++++++++++++++++++-- drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 1 + 2 files changed, 45 insertions(+), 2 deletions(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c index 2deca210d5a..800800a9649 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c @@ -794,6 +794,43 @@ static struct dvb_usb_rc_key ir_codes_dib0700_table[] = { { 0x7a13, KEY_VOLUMEDOWN }, { 0x7a40, KEY_POWER }, { 0x7a41, KEY_MUTE }, + + /* Key codes for the Elgato EyeTV Diversity silver remote, + set dvb_usb_dib0700_ir_proto=0 */ + { 0x4501, KEY_POWER }, + { 0x4502, KEY_MUTE }, + { 0x4503, KEY_1 }, + { 0x4504, KEY_2 }, + { 0x4505, KEY_3 }, + { 0x4506, KEY_4 }, + { 0x4507, KEY_5 }, + { 0x4508, KEY_6 }, + { 0x4509, KEY_7 }, + { 0x450a, KEY_8 }, + { 0x450b, KEY_9 }, + { 0x450c, KEY_LAST }, + { 0x450d, KEY_0 }, + { 0x450e, KEY_ENTER }, + { 0x450f, KEY_RED }, + { 0x4510, KEY_CHANNELUP }, + { 0x4511, KEY_GREEN }, + { 0x4512, KEY_VOLUMEDOWN }, + { 0x4513, KEY_OK }, + { 0x4514, KEY_VOLUMEUP }, + { 0x4515, KEY_YELLOW }, + { 0x4516, KEY_CHANNELDOWN }, + { 0x4517, KEY_BLUE }, + { 0x4518, KEY_LEFT }, /* Skip backwards */ + { 0x4519, KEY_PLAYPAUSE }, + { 0x451a, KEY_RIGHT }, /* Skip forward */ + { 0x451b, KEY_REWIND }, + { 0x451c, KEY_L }, /* Live */ + { 0x451d, KEY_FASTFORWARD }, + { 0x451e, KEY_STOP }, /* 'Reveal' for Teletext */ + { 0x451f, KEY_MENU }, /* KEY_TEXT for Teletext */ + { 0x4540, KEY_RECORD }, /* Font 'Size' for Teletext */ + { 0x4541, KEY_SCREEN }, /* Full screen toggle, 'Hold' for Teletext */ + { 0x4542, KEY_SELECT }, /* Select video input, 'Select' for Teletext */ }; /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */ @@ -2049,6 +2086,7 @@ struct usb_device_id dib0700_usb_id_table[] = { /* 65 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV73ESE) }, { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV282E) }, { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK8096GP) }, + { USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_DIVERSITY) }, { 0 } /* Terminating entry */ }; MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); @@ -2393,7 +2431,7 @@ struct dvb_usb_device_properties dib0700_devices[] = { } }, - .num_device_descs = 6, + .num_device_descs = 7, .devices = { { "DiBcom STK7070PD reference design", { &dib0700_usb_id_table[17], NULL }, @@ -2419,7 +2457,11 @@ struct dvb_usb_device_properties dib0700_devices[] = { { "Sony PlayTV", { &dib0700_usb_id_table[44], NULL }, { NULL }, - } + }, + { "Elgato EyeTV Diversity", + { &dib0700_usb_id_table[68], NULL }, + { NULL }, + }, }, .rc_interval = DEFAULT_RC_INTERVAL, .rc_key_map = ir_codes_dib0700_table, diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index de1f3af60d5..085c4e457e0 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h @@ -290,6 +290,7 @@ #define USB_PID_MSI_DIGI_VOX_MINI_III 0x8807 #define USB_PID_SONY_PLAYTV 0x0003 #define USB_PID_MYGICA_D689 0xd811 +#define USB_PID_ELGATO_EYETV_DIVERSITY 0x0011 #define USB_PID_ELGATO_EYETV_DTT 0x0021 #define USB_PID_ELGATO_EYETV_DTT_Dlx 0x0020 #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_COLD 0x5000 -- cgit v1.2.3-70-g09d2 From 30d81bb086c84d54cde4dd4d0c75d9455224632b Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Mon, 8 Feb 2010 20:30:44 -0300 Subject: V4L/DVB: dib7000p: reduce large stack usage This patch reduces static stack usage of one of the 2 top offenders as listed by 'make checkstack': Building with CONFIG_FRAME_WARN=2048 produces: drivers/media/dvb/frontends/dib7000p.c:1367: warning: the frame size of 2320 bytes is larger than 2048 bytes and in 'make checkstack', the stack usage goes from: 0x00002409 dib7000p_i2c_enumeration [dib7000p]: 2328 to unlisted with this patch. Also change one caller of dib7000p_i2c_enumeration() to check its return value. I don't have the hardware that is needed to test this patch. Signed-off-by: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/cxusb.c | 5 +++-- drivers/media/dvb/frontends/dib7000p.c | 36 +++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 16 deletions(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index 33a83f93e7c..0eb49088916 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c @@ -1025,8 +1025,9 @@ static int cxusb_dualdig4_rev2_frontend_attach(struct dvb_usb_adapter *adap) cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1); - dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, - &cxusb_dualdig4_rev2_config); + if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, + &cxusb_dualdig4_rev2_config) < 0) + return -ENODEV; adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &cxusb_dualdig4_rev2_config); diff --git a/drivers/media/dvb/frontends/dib7000p.c b/drivers/media/dvb/frontends/dib7000p.c index 85468a45c34..113fc1394d5 100644 --- a/drivers/media/dvb/frontends/dib7000p.c +++ b/drivers/media/dvb/frontends/dib7000p.c @@ -1324,46 +1324,54 @@ EXPORT_SYMBOL(dib7000p_pid_filter); int dib7000p_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods, u8 default_addr, struct dib7000p_config cfg[]) { - struct dib7000p_state st = { .i2c_adap = i2c }; + struct dib7000p_state *dpst; int k = 0; u8 new_addr = 0; + dpst = kzalloc(sizeof(struct dib7000p_state), GFP_KERNEL); + if (!dpst) + return -ENODEV; + + dpst->i2c_adap = i2c; + for (k = no_of_demods-1; k >= 0; k--) { - st.cfg = cfg[k]; + dpst->cfg = cfg[k]; /* designated i2c address */ new_addr = (0x40 + k) << 1; - st.i2c_addr = new_addr; - dib7000p_write_word(&st, 1287, 0x0003); /* sram lead in, rdy */ - if (dib7000p_identify(&st) != 0) { - st.i2c_addr = default_addr; - dib7000p_write_word(&st, 1287, 0x0003); /* sram lead in, rdy */ - if (dib7000p_identify(&st) != 0) { + dpst->i2c_addr = new_addr; + dib7000p_write_word(dpst, 1287, 0x0003); /* sram lead in, rdy */ + if (dib7000p_identify(dpst) != 0) { + dpst->i2c_addr = default_addr; + dib7000p_write_word(dpst, 1287, 0x0003); /* sram lead in, rdy */ + if (dib7000p_identify(dpst) != 0) { dprintk("DiB7000P #%d: not identified\n", k); + kfree(dpst); return -EIO; } } /* start diversity to pull_down div_str - just for i2c-enumeration */ - dib7000p_set_output_mode(&st, OUTMODE_DIVERSITY); + dib7000p_set_output_mode(dpst, OUTMODE_DIVERSITY); /* set new i2c address and force divstart */ - dib7000p_write_word(&st, 1285, (new_addr << 2) | 0x2); + dib7000p_write_word(dpst, 1285, (new_addr << 2) | 0x2); dprintk("IC %d initialized (to i2c_address 0x%x)", k, new_addr); } for (k = 0; k < no_of_demods; k++) { - st.cfg = cfg[k]; - st.i2c_addr = (0x40 + k) << 1; + dpst->cfg = cfg[k]; + dpst->i2c_addr = (0x40 + k) << 1; // unforce divstr - dib7000p_write_word(&st, 1285, st.i2c_addr << 2); + dib7000p_write_word(dpst, 1285, dpst->i2c_addr << 2); /* deactivate div - it was just for i2c-enumeration */ - dib7000p_set_output_mode(&st, OUTMODE_HIGH_Z); + dib7000p_set_output_mode(dpst, OUTMODE_HIGH_Z); } + kfree(dpst); return 0; } EXPORT_SYMBOL(dib7000p_i2c_enumeration); -- cgit v1.2.3-70-g09d2 From 205161ed03b53c467dd669a340ea704ce0fb6f9e Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Tue, 27 Apr 2010 18:11:20 -0300 Subject: V4L/DVB: dvb-usb: gp8psk, fix potential null derefernce Stanse found that in gp8psk_load_bcm4500fw there is missing a check for return value of kmalloc. Add one and bail out appropriatelly. Signed-off-by: Jiri Slaby Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/gp8psk.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/gp8psk.c b/drivers/media/dvb/dvb-usb/gp8psk.c index afb444db43a..45106ac4967 100644 --- a/drivers/media/dvb/dvb-usb/gp8psk.c +++ b/drivers/media/dvb/dvb-usb/gp8psk.c @@ -105,6 +105,10 @@ static int gp8psk_load_bcm4500fw(struct dvb_usb_device *d) ptr = fw->data; buf = kmalloc(64, GFP_KERNEL | GFP_DMA); + if (!buf) { + ret = -ENOMEM; + goto out_rel_fw; + } while (ptr[0] != 0xff) { u16 buflen = ptr[0] + 4; -- cgit v1.2.3-70-g09d2 From 32ec4576c3fb37316b1d11a04b220527822f3f0d Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 4 May 2010 09:14:29 -0300 Subject: V4L/DVB: media/az6027: doing dma on the stack I changed the dma buffers to use allocated memory instead of stack memory. The reason for this is documented in Documentation/DMA-API-HOWTO.txt under the section: "What memory is DMA'able?" That document was only added a couple weeks ago and there are still lots of modules which haven't been corrected yet. Btw. Smatch includes a pretty good test to find places which use stack memory as a dma buffer. That's how I found these. (http://smatch.sf.net). Signed-off-by: Dan Carpenter Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/az6027.c | 50 +++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 9 deletions(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/az6027.c b/drivers/media/dvb/dvb-usb/az6027.c index 8934788bd83..baaa301c576 100644 --- a/drivers/media/dvb/dvb-usb/az6027.c +++ b/drivers/media/dvb/dvb-usb/az6027.c @@ -417,11 +417,15 @@ static int az6027_ci_read_attribute_mem(struct dvb_ca_en50221 *ca, u16 value; u16 index; int blen; - u8 b[12]; + u8 *b; if (slot != 0) return -EINVAL; + b = kmalloc(12, GFP_KERNEL); + if (!b) + return -ENOMEM; + mutex_lock(&state->ca_mutex); req = 0xC1; @@ -438,6 +442,7 @@ static int az6027_ci_read_attribute_mem(struct dvb_ca_en50221 *ca, } mutex_unlock(&state->ca_mutex); + kfree(b); return ret; } @@ -485,11 +490,15 @@ static int az6027_ci_read_cam_control(struct dvb_ca_en50221 *ca, u16 value; u16 index; int blen; - u8 b[12]; + u8 *b; if (slot != 0) return -EINVAL; + b = kmalloc(12, GFP_KERNEL); + if (!b) + return -ENOMEM; + mutex_lock(&state->ca_mutex); req = 0xC3; @@ -510,6 +519,7 @@ static int az6027_ci_read_cam_control(struct dvb_ca_en50221 *ca, } mutex_unlock(&state->ca_mutex); + kfree(b); return ret; } @@ -556,7 +566,11 @@ static int CI_CamReady(struct dvb_ca_en50221 *ca, int slot) u16 value; u16 index; int blen; - u8 b[12]; + u8 *b; + + b = kmalloc(12, GFP_KERNEL); + if (!b) + return -ENOMEM; req = 0xC8; value = 0; @@ -570,6 +584,7 @@ static int CI_CamReady(struct dvb_ca_en50221 *ca, int slot) } else{ ret = b[0]; } + kfree(b); return ret; } @@ -667,8 +682,11 @@ static int az6027_ci_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int o u16 value; u16 index; int blen; - u8 b[12]; + u8 *b; + b = kmalloc(12, GFP_KERNEL); + if (!b) + return -ENOMEM; mutex_lock(&state->ca_mutex); req = 0xC5; @@ -692,6 +710,7 @@ static int az6027_ci_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int o } mutex_unlock(&state->ca_mutex); + kfree(b); return ret; } @@ -943,10 +962,16 @@ static int az6027_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int n u16 value; int length; u8 req; - u8 data[256]; + u8 *data; + + data = kmalloc(256, GFP_KERNEL); + if (!data) + return -ENOMEM; - if (mutex_lock_interruptible(&d->i2c_mutex) < 0) + if (mutex_lock_interruptible(&d->i2c_mutex) < 0) { + kfree(data); return -EAGAIN; + } if (num > 2) warn("more than 2 i2c messages at a time is not handled yet. TODO."); @@ -1016,6 +1041,7 @@ static int az6027_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int n } } mutex_unlock(&d->i2c_mutex); + kfree(data); return i; } @@ -1036,8 +1062,14 @@ int az6027_identify_state(struct usb_device *udev, struct dvb_usb_device_description **desc, int *cold) { - u8 b[16]; - s16 ret = usb_control_msg(udev, + u8 *b; + s16 ret; + + b = kmalloc(16, GFP_KERNEL); + if (!b) + return -ENOMEM; + + ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0xb7, USB_TYPE_VENDOR | USB_DIR_IN, @@ -1048,7 +1080,7 @@ int az6027_identify_state(struct usb_device *udev, USB_CTRL_GET_TIMEOUT); *cold = ret <= 0; - + kfree(b); deb_info("cold: %d\n", *cold); return 0; } -- cgit v1.2.3-70-g09d2 From a18e659170b9c551749e1c8cb5a969ea8d73e378 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 4 May 2010 09:31:13 -0300 Subject: V4L/DVB: media/az6027: handle -EIO failure If the az6027_usb_in_op() returns a negative errno ret is -EIO and in that case the value of b[0] may be undefined. The original code assigned 0 to ret, but since it's already 0 now we can skip that. Signed-off-by: Dan Carpenter Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/az6027.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/drivers/media/dvb/dvb-usb/az6027.c b/drivers/media/dvb/dvb-usb/az6027.c index baaa301c576..6681ac1c56e 100644 --- a/drivers/media/dvb/dvb-usb/az6027.c +++ b/drivers/media/dvb/dvb-usb/az6027.c @@ -701,10 +701,7 @@ static int az6027_ci_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int o } else ret = 0; - if (b[0] == 0) { - ret = 0; - - } else if (b[0] == 1) { + if (!ret && b[0] == 1) { ret = DVB_CA_EN50221_POLL_CAM_PRESENT | DVB_CA_EN50221_POLL_CAM_READY; } -- cgit v1.2.3-70-g09d2 From 997ea58eb92f9970b8af7aae48800d0ef43b9423 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Mon, 12 Apr 2010 13:17:25 +0200 Subject: USB: rename usb_buffer_alloc() and usb_buffer_free() users For more clearance what the functions actually do, usb_buffer_alloc() is renamed to usb_alloc_coherent() usb_buffer_free() is renamed to usb_free_coherent() They should only be used in code which really needs DMA coherency. All call sites have been changed accordingly, except for staging drivers. Signed-off-by: Daniel Mack Cc: Alan Stern Cc: Pedro Ribeiro Signed-off-by: Greg Kroah-Hartman --- Documentation/DocBook/writing_usb_driver.tmpl | 2 +- Documentation/usb/dma.txt | 4 +-- drivers/hid/usbhid/hid-core.c | 12 ++++---- drivers/hid/usbhid/usbkbd.c | 8 +++--- drivers/hid/usbhid/usbmouse.c | 6 ++-- drivers/input/joystick/xpad.c | 16 +++++------ drivers/input/misc/ati_remote.c | 12 ++++---- drivers/input/misc/ati_remote2.c | 4 +-- drivers/input/misc/cm109.c | 16 +++++------ drivers/input/misc/keyspan_remote.c | 6 ++-- drivers/input/misc/powermate.c | 8 +++--- drivers/input/misc/yealink.c | 14 ++++------ drivers/input/mouse/appletouch.c | 12 ++++---- drivers/input/mouse/bcm5974.c | 24 ++++++++-------- drivers/input/tablet/acecad.c | 6 ++-- drivers/input/tablet/aiptek.c | 14 +++++----- drivers/input/tablet/gtco.c | 12 ++++---- drivers/input/tablet/kbtab.c | 6 ++-- drivers/input/tablet/wacom_sys.c | 10 +++---- drivers/input/touchscreen/usbtouchscreen.c | 8 +++--- drivers/media/dvb/dvb-usb/usb-urb.c | 7 +++-- drivers/media/dvb/ttusb-dec/ttusb_dec.c | 6 ++-- drivers/media/video/au0828/au0828-video.c | 4 +-- drivers/media/video/cx231xx/cx231xx-core.c | 14 +++++----- drivers/media/video/em28xx/em28xx-core.c | 4 +-- drivers/media/video/gspca/benq.c | 4 +-- drivers/media/video/gspca/gspca.c | 30 ++++++++++---------- drivers/media/video/hdpvr/hdpvr-video.c | 8 +++--- drivers/media/video/tlg2300/pd-video.c | 14 +++++----- drivers/media/video/usbvision/usbvision-core.c | 16 +++++------ drivers/media/video/uvc/uvc_video.c | 4 +-- drivers/net/can/usb/ems_usb.c | 18 ++++++------ drivers/net/usb/ipheth.c | 24 +++++++--------- drivers/net/usb/kaweth.c | 12 ++++---- drivers/net/wireless/ath/ar9170/usb.c | 8 +++--- drivers/net/wireless/zd1211rw/zd_usb.c | 10 +++---- drivers/usb/class/cdc-acm.c | 22 +++++++-------- drivers/usb/class/cdc-wdm.c | 38 +++++++++++++------------- drivers/usb/class/usblp.c | 2 +- drivers/usb/misc/appledisplay.c | 6 ++-- drivers/usb/misc/ftdi-elan.c | 18 ++++++------ drivers/usb/misc/iowarrior.c | 12 ++++---- drivers/usb/misc/usblcd.c | 8 +++--- drivers/usb/misc/usbtest.c | 8 +++--- drivers/usb/storage/onetouch.c | 12 ++++---- drivers/usb/storage/usb.c | 4 +-- drivers/usb/usb-skeleton.c | 10 +++---- drivers/watchdog/pcwd_usb.c | 6 ++-- sound/usb/ua101.c | 16 +++++------ sound/usb/usbaudio.c | 18 ++++++------ sound/usb/usbmidi.c | 14 +++++----- 51 files changed, 286 insertions(+), 291 deletions(-) (limited to 'drivers/media/dvb/dvb-usb') diff --git a/Documentation/DocBook/writing_usb_driver.tmpl b/Documentation/DocBook/writing_usb_driver.tmpl index eeff19ca831..bd97a13fa5a 100644 --- a/Documentation/DocBook/writing_usb_driver.tmpl +++ b/Documentation/DocBook/writing_usb_driver.tmpl @@ -342,7 +342,7 @@ static inline void skel_delete (struct usb_skel *dev) { kfree (dev->bulk_in_buffer); if (dev->bulk_out_buffer != NULL) - usb_buffer_free (dev->udev, dev->bulk_out_size, + usb_free_coherent (dev->udev, dev->bulk_out_size, dev->bulk_out_buffer, dev->write_urb->transfer_dma); usb_free_urb (dev->write_urb); diff --git a/Documentation/usb/dma.txt b/Documentation/usb/dma.txt index cfdcd16e3ab..a37e59cf278 100644 --- a/Documentation/usb/dma.txt +++ b/Documentation/usb/dma.txt @@ -43,10 +43,10 @@ and effects like cache-trashing can impose subtle penalties. kind of addresses to store in urb->transfer_buffer and urb->transfer_dma. You'd also set URB_NO_TRANSFER_DMA_MAP in urb->transfer_flags: - void *usb_buffer_alloc (struct usb_device *dev, size_t size, + void *usb_alloc_coherent (struct usb_device *dev, size_t size, int mem_flags, dma_addr_t *dma); - void usb_buffer_free (struct usb_device *dev, size_t size, + void usb_free_coherent (struct usb_device *dev, size_t size, void *addr, dma_addr_t dma); Most drivers should *NOT* be using these primitives; they don't need diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 6a510c9675f..df619756b7a 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -783,12 +783,12 @@ static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid) { struct usbhid_device *usbhid = hid->driver_data; - usbhid->inbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL, + usbhid->inbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL, &usbhid->inbuf_dma); - usbhid->outbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL, + usbhid->outbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL, &usbhid->outbuf_dma); usbhid->cr = kmalloc(sizeof(*usbhid->cr), GFP_KERNEL); - usbhid->ctrlbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL, + usbhid->ctrlbuf = usb_alloc_coherent(dev, usbhid->bufsize, GFP_KERNEL, &usbhid->ctrlbuf_dma); if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr || !usbhid->ctrlbuf) @@ -843,10 +843,10 @@ static void hid_free_buffers(struct usb_device *dev, struct hid_device *hid) { struct usbhid_device *usbhid = hid->driver_data; - usb_buffer_free(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma); - usb_buffer_free(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma); + usb_free_coherent(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma); + usb_free_coherent(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma); kfree(usbhid->cr); - usb_buffer_free(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma); + usb_free_coherent(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma); } static int usbhid_parse(struct hid_device *hid) diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c index bdc7b09e867..bb14c8270af 100644 --- a/drivers/hid/usbhid/usbkbd.c +++ b/drivers/hid/usbhid/usbkbd.c @@ -196,11 +196,11 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd) return -1; if (!(kbd->led = usb_alloc_urb(0, GFP_KERNEL))) return -1; - if (!(kbd->new = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &kbd->new_dma))) + if (!(kbd->new = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &kbd->new_dma))) return -1; if (!(kbd->cr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL))) return -1; - if (!(kbd->leds = usb_buffer_alloc(dev, 1, GFP_ATOMIC, &kbd->leds_dma))) + if (!(kbd->leds = usb_alloc_coherent(dev, 1, GFP_ATOMIC, &kbd->leds_dma))) return -1; return 0; @@ -210,9 +210,9 @@ static void usb_kbd_free_mem(struct usb_device *dev, struct usb_kbd *kbd) { usb_free_urb(kbd->irq); usb_free_urb(kbd->led); - usb_buffer_free(dev, 8, kbd->new, kbd->new_dma); + usb_free_coherent(dev, 8, kbd->new, kbd->new_dma); kfree(kbd->cr); - usb_buffer_free(dev, 1, kbd->leds, kbd->leds_dma); + usb_free_coherent(dev, 1, kbd->leds, kbd->leds_dma); } static int usb_kbd_probe(struct usb_interface *iface, diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c index 72ab4b26809..79b2bf81a05 100644 --- a/drivers/hid/usbhid/usbmouse.c +++ b/drivers/hid/usbhid/usbmouse.c @@ -142,7 +142,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i if (!mouse || !input_dev) goto fail1; - mouse->data = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &mouse->data_dma); + mouse->data = usb_alloc_coherent(dev, 8, GFP_ATOMIC, &mouse->data_dma); if (!mouse->data) goto fail1; @@ -205,7 +205,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i fail3: usb_free_urb(mouse->irq); fail2: - usb_buffer_free(dev, 8, mouse->data, mouse->data_dma); + usb_free_coherent(dev, 8, mouse->data, mouse->data_dma); fail1: input_free_device(input_dev); kfree(mouse); @@ -221,7 +221,7 @@ static void usb_mouse_disconnect(struct usb_interface *intf) usb_kill_urb(mouse->irq); input_unregister_device(mouse->dev); usb_free_urb(mouse->irq); - usb_buffer_free(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma); + usb_free_coherent(interface_to_usbdev(intf), 8, mouse->data, mouse->data_dma); kfree(mouse); } } diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 9b3353b404d..c1087ce4cef 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -533,8 +533,8 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad) if (xpad->xtype != XTYPE_XBOX360 && xpad->xtype != XTYPE_XBOX) return 0; - xpad->odata = usb_buffer_alloc(xpad->udev, XPAD_PKT_LEN, - GFP_KERNEL, &xpad->odata_dma); + xpad->odata = usb_alloc_coherent(xpad->udev, XPAD_PKT_LEN, + GFP_KERNEL, &xpad->odata_dma); if (!xpad->odata) goto fail1; @@ -554,7 +554,7 @@ static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad) return 0; - fail2: usb_buffer_free(xpad->udev, XPAD_PKT_LEN, xpad->odata, xpad->odata_dma); + fail2: usb_free_coherent(xpad->udev, XPAD_PKT_LEN, xpad->odata, xpad->odata_dma); fail1: return error; } @@ -568,7 +568,7 @@ static void xpad_deinit_output(struct usb_xpad *xpad) { if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX) { usb_free_urb(xpad->irq_out); - usb_buffer_free(xpad->udev, XPAD_PKT_LEN, + usb_free_coherent(xpad->udev, XPAD_PKT_LEN, xpad->odata, xpad->odata_dma); } } @@ -788,8 +788,8 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id if (!xpad || !input_dev) goto fail1; - xpad->idata = usb_buffer_alloc(udev, XPAD_PKT_LEN, - GFP_KERNEL, &xpad->idata_dma); + xpad->idata = usb_alloc_coherent(udev, XPAD_PKT_LEN, + GFP_KERNEL, &xpad->idata_dma); if (!xpad->idata) goto fail1; @@ -942,7 +942,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id fail5: usb_kill_urb(xpad->irq_in); fail4: usb_free_urb(xpad->irq_in); fail3: xpad_deinit_output(xpad); - fail2: usb_buffer_free(udev, XPAD_PKT_LEN, xpad->idata, xpad->idata_dma); + fail2: usb_free_coherent(udev, XPAD_PKT_LEN, xpad->idata, xpad->idata_dma); fail1: input_free_device(input_dev); kfree(xpad); return error; @@ -964,7 +964,7 @@ static void xpad_disconnect(struct usb_interface *intf) usb_kill_urb(xpad->irq_in); } usb_free_urb(xpad->irq_in); - usb_buffer_free(xpad->udev, XPAD_PKT_LEN, + usb_free_coherent(xpad->udev, XPAD_PKT_LEN, xpad->idata, xpad->idata_dma); kfree(xpad); } diff --git a/drivers/input/misc/ati_remote.c b/drivers/input/misc/ati_remote.c index e8bbc619f6d..bce57129afb 100644 --- a/drivers/input/misc/ati_remote.c +++ b/drivers/input/misc/ati_remote.c @@ -624,13 +624,13 @@ static void ati_remote_irq_in(struct urb *urb) static int ati_remote_alloc_buffers(struct usb_device *udev, struct ati_remote *ati_remote) { - ati_remote->inbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC, - &ati_remote->inbuf_dma); + ati_remote->inbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC, + &ati_remote->inbuf_dma); if (!ati_remote->inbuf) return -1; - ati_remote->outbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, GFP_ATOMIC, - &ati_remote->outbuf_dma); + ati_remote->outbuf = usb_alloc_coherent(udev, DATA_BUFSIZE, GFP_ATOMIC, + &ati_remote->outbuf_dma); if (!ati_remote->outbuf) return -1; @@ -653,10 +653,10 @@ static void ati_remote_free_buffers(struct ati_remote *ati_remote) usb_free_urb(ati_remote->irq_urb); usb_free_urb(ati_remote->out_urb); - usb_buffer_free(ati_remote->udev, DATA_BUFSIZE, + usb_free_coherent(ati_remote->udev, DATA_BUFSIZE, ati_remote->inbuf, ati_remote->inbuf_dma); - usb_buffer_free(ati_remote->udev, DATA_BUFSIZE, + usb_free_coherent(ati_remote->udev, DATA_BUFSIZE, ati_remote->outbuf, ati_remote->outbuf_dma); } diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c index 2124b99378b..e148749b585 100644 --- a/drivers/input/misc/ati_remote2.c +++ b/drivers/input/misc/ati_remote2.c @@ -589,7 +589,7 @@ static int ati_remote2_urb_init(struct ati_remote2 *ar2) int i, pipe, maxp; for (i = 0; i < 2; i++) { - ar2->buf[i] = usb_buffer_alloc(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]); + ar2->buf[i] = usb_alloc_coherent(udev, 4, GFP_KERNEL, &ar2->buf_dma[i]); if (!ar2->buf[i]) return -ENOMEM; @@ -617,7 +617,7 @@ static void ati_remote2_urb_cleanup(struct ati_remote2 *ar2) for (i = 0; i < 2; i++) { usb_free_urb(ar2->urb[i]); - usb_buffer_free(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]); + usb_free_coherent(ar2->udev, 4, ar2->buf[i], ar2->buf_dma[i]); } } diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c index 8d2d291ee50..2b0eba6619b 100644 --- a/drivers/input/misc/cm109.c +++ b/drivers/input/misc/cm109.c @@ -630,11 +630,11 @@ static void cm109_usb_cleanup(struct cm109_dev *dev) { kfree(dev->ctl_req); if (dev->ctl_data) - usb_buffer_free(dev->udev, USB_PKT_LEN, - dev->ctl_data, dev->ctl_dma); + usb_free_coherent(dev->udev, USB_PKT_LEN, + dev->ctl_data, dev->ctl_dma); if (dev->irq_data) - usb_buffer_free(dev->udev, USB_PKT_LEN, - dev->irq_data, dev->irq_dma); + usb_free_coherent(dev->udev, USB_PKT_LEN, + dev->irq_data, dev->irq_dma); usb_free_urb(dev->urb_irq); /* parameter validation in core/urb */ usb_free_urb(dev->urb_ctl); /* parameter validation in core/urb */ @@ -683,13 +683,13 @@ static int cm109_usb_probe(struct usb_interface *intf, goto err_out; /* allocate usb buffers */ - dev->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN, - GFP_KERNEL, &dev->irq_dma); + dev->irq_data = usb_alloc_coherent(udev, USB_PKT_LEN, + GFP_KERNEL, &dev->irq_dma); if (!dev->irq_data) goto err_out; - dev->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN, - GFP_KERNEL, &dev->ctl_dma); + dev->ctl_data = usb_alloc_coherent(udev, USB_PKT_LEN, + GFP_KERNEL, &dev->ctl_dma); if (!dev->ctl_data) goto err_out; diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c index 86afdd1fdf9..a93c525475c 100644 --- a/drivers/input/misc/keyspan_remote.c +++ b/drivers/input/misc/keyspan_remote.c @@ -464,7 +464,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic remote->in_endpoint = endpoint; remote->toggle = -1; /* Set to -1 so we will always not match the toggle from the first remote message. */ - remote->in_buffer = usb_buffer_alloc(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma); + remote->in_buffer = usb_alloc_coherent(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma); if (!remote->in_buffer) { error = -ENOMEM; goto fail1; @@ -543,7 +543,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic return 0; fail3: usb_free_urb(remote->irq_urb); - fail2: usb_buffer_free(udev, RECV_SIZE, remote->in_buffer, remote->in_dma); + fail2: usb_free_coherent(udev, RECV_SIZE, remote->in_buffer, remote->in_dma); fail1: kfree(remote); input_free_device(input_dev); @@ -564,7 +564,7 @@ static void keyspan_disconnect(struct usb_interface *interface) input_unregister_device(remote->input); usb_kill_urb(remote->irq_urb); usb_free_urb(remote->irq_urb); - usb_buffer_free(remote->udev, RECV_SIZE, remote->in_buffer, remote->in_dma); + usb_free_coherent(remote->udev, RECV_SIZE, remote->in_buffer, remote->in_dma); kfree(remote); } } diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c index 7ba4b5f53fc..bf170f6b442 100644 --- a/drivers/input/misc/powermate.c +++ b/drivers/input/misc/powermate.c @@ -273,8 +273,8 @@ static int powermate_input_event(struct input_dev *dev, unsigned int type, unsig static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_device *pm) { - pm->data = usb_buffer_alloc(udev, POWERMATE_PAYLOAD_SIZE_MAX, - GFP_ATOMIC, &pm->data_dma); + pm->data = usb_alloc_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX, + GFP_ATOMIC, &pm->data_dma); if (!pm->data) return -1; @@ -287,8 +287,8 @@ static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_dev static void powermate_free_buffers(struct usb_device *udev, struct powermate_device *pm) { - usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX, - pm->data, pm->data_dma); + usb_free_coherent(udev, POWERMATE_PAYLOAD_SIZE_MAX, + pm->data, pm->data_dma); kfree(pm->configcr); } diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c index 2828328e9dd..41201c6b5e6 100644 --- a/drivers/input/misc/yealink.c +++ b/drivers/input/misc/yealink.c @@ -836,10 +836,8 @@ static int usb_cleanup(struct yealink_dev *yld, int err) usb_free_urb(yld->urb_ctl); kfree(yld->ctl_req); - usb_buffer_free(yld->udev, USB_PKT_LEN, - yld->ctl_data, yld->ctl_dma); - usb_buffer_free(yld->udev, USB_PKT_LEN, - yld->irq_data, yld->irq_dma); + usb_free_coherent(yld->udev, USB_PKT_LEN, yld->ctl_data, yld->ctl_dma); + usb_free_coherent(yld->udev, USB_PKT_LEN, yld->irq_data, yld->irq_dma); kfree(yld); return err; @@ -884,13 +882,13 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) return usb_cleanup(yld, -ENOMEM); /* allocate usb buffers */ - yld->irq_data = usb_buffer_alloc(udev, USB_PKT_LEN, - GFP_ATOMIC, &yld->irq_dma); + yld->irq_data = usb_alloc_coherent(udev, USB_PKT_LEN, + GFP_ATOMIC, &yld->irq_dma); if (yld->irq_data == NULL) return usb_cleanup(yld, -ENOMEM); - yld->ctl_data = usb_buffer_alloc(udev, USB_PKT_LEN, - GFP_ATOMIC, &yld->ctl_dma); + yld->ctl_data = usb_alloc_coherent(udev, USB_PKT_LEN, + GFP_ATOMIC, &yld->ctl_dma); if (!yld->ctl_data) return usb_cleanup(yld, -ENOMEM); diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index 53ec7ddd182..05edd75abca 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -806,8 +806,8 @@ static int atp_probe(struct usb_interface *iface, if (!dev->urb) goto err_free_devs; - dev->data = usb_buffer_alloc(dev->udev, dev->info->datalen, GFP_KERNEL, - &dev->urb->transfer_dma); + dev->data = usb_alloc_coherent(dev->udev, dev->info->datalen, GFP_KERNEL, + &dev->urb->transfer_dma); if (!dev->data) goto err_free_urb; @@ -862,8 +862,8 @@ static int atp_probe(struct usb_interface *iface, return 0; err_free_buffer: - usb_buffer_free(dev->udev, dev->info->datalen, - dev->data, dev->urb->transfer_dma); + usb_free_coherent(dev->udev, dev->info->datalen, + dev->data, dev->urb->transfer_dma); err_free_urb: usb_free_urb(dev->urb); err_free_devs: @@ -881,8 +881,8 @@ static void atp_disconnect(struct usb_interface *iface) if (dev) { usb_kill_urb(dev->urb); input_unregister_device(dev->input); - usb_buffer_free(dev->udev, dev->info->datalen, - dev->data, dev->urb->transfer_dma); + usb_free_coherent(dev->udev, dev->info->datalen, + dev->data, dev->urb->transfer_dma); usb_free_urb(dev->urb); kfree(dev); } diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index b89879bd860..6dedded2722 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -715,15 +715,15 @@ static int bcm5974_probe(struct usb_interface *iface, if (!dev->tp_urb) goto err_free_bt_urb; - dev->bt_data = usb_buffer_alloc(dev->udev, - dev->cfg.bt_datalen, GFP_KERNEL, - &dev->bt_urb->transfer_dma); + dev->bt_data = usb_alloc_coherent(dev->udev, + dev->cfg.bt_datalen, GFP_KERNEL, + &dev->bt_urb->transfer_dma); if (!dev->bt_data) goto err_free_urb; - dev->tp_data = usb_buffer_alloc(dev->udev, - dev->cfg.tp_datalen, GFP_KERNEL, - &dev->tp_urb->transfer_dma); + dev->tp_data = usb_alloc_coherent(dev->udev, + dev->cfg.tp_datalen, GFP_KERNEL, + &dev->tp_urb->transfer_dma); if (!dev->tp_data) goto err_free_bt_buffer; @@ -765,10 +765,10 @@ static int bcm5974_probe(struct usb_interface *iface, return 0; err_free_buffer: - usb_buffer_free(dev->udev, dev->cfg.tp_datalen, + usb_free_coherent(dev->udev, dev->cfg.tp_datalen, dev->tp_data, dev->tp_urb->transfer_dma); err_free_bt_buffer: - usb_buffer_free(dev->udev, dev->cfg.bt_datalen, + usb_free_coherent(dev->udev, dev->cfg.bt_datalen, dev->bt_data, dev->bt_urb->transfer_dma); err_free_urb: usb_free_urb(dev->tp_urb); @@ -788,10 +788,10 @@ static void bcm5974_disconnect(struct usb_interface *iface) usb_set_intfdata(iface, NULL); input_unregister_device(dev->input); - usb_buffer_free(dev->udev, dev->cfg.tp_datalen, - dev->tp_data, dev->tp_urb->transfer_dma); - usb_buffer_free(dev->udev, dev->cfg.bt_datalen, - dev->bt_data, dev->bt_urb->transfer_dma); + usb_free_coherent(dev->udev, dev->cfg.tp_datalen, + dev->tp_data, dev->tp_urb->transfer_dma); + usb_free_coherent(dev->udev, dev->cfg.bt_datalen, + dev->bt_data, dev->bt_urb->transfer_dma); usb_free_urb(dev->tp_urb); usb_free_urb(dev->bt_urb); kfree(dev); diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c index 670c61c5a51..c0470163dc6 100644 --- a/drivers/input/tablet/acecad.c +++ b/drivers/input/tablet/acecad.c @@ -155,7 +155,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ goto fail1; } - acecad->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &acecad->data_dma); + acecad->data = usb_alloc_coherent(dev, 8, GFP_KERNEL, &acecad->data_dma); if (!acecad->data) { err= -ENOMEM; goto fail1; @@ -241,7 +241,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ return 0; - fail2: usb_buffer_free(dev, 8, acecad->data, acecad->data_dma); + fail2: usb_free_coherent(dev, 8, acecad->data, acecad->data_dma); fail1: input_free_device(input_dev); kfree(acecad); return err; @@ -256,7 +256,7 @@ static void usb_acecad_disconnect(struct usb_interface *intf) usb_kill_urb(acecad->irq); input_unregister_device(acecad->input); usb_free_urb(acecad->irq); - usb_buffer_free(interface_to_usbdev(intf), 10, acecad->data, acecad->data_dma); + usb_free_coherent(interface_to_usbdev(intf), 10, acecad->data, acecad->data_dma); kfree(acecad); } } diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index 4be039d7dca..51b80b08d46 100644 --- a/drivers/input/tablet/aiptek.c +++ b/drivers/input/tablet/aiptek.c @@ -1711,8 +1711,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) goto fail1; } - aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH, - GFP_ATOMIC, &aiptek->data_dma); + aiptek->data = usb_alloc_coherent(usbdev, AIPTEK_PACKET_LENGTH, + GFP_ATOMIC, &aiptek->data_dma); if (!aiptek->data) { dev_warn(&intf->dev, "cannot allocate usb buffer\n"); goto fail1; @@ -1884,8 +1884,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) fail4: sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group); fail3: usb_free_urb(aiptek->urb); - fail2: usb_buffer_free(usbdev, AIPTEK_PACKET_LENGTH, aiptek->data, - aiptek->data_dma); + fail2: usb_free_coherent(usbdev, AIPTEK_PACKET_LENGTH, aiptek->data, + aiptek->data_dma); fail1: usb_set_intfdata(intf, NULL); input_free_device(inputdev); kfree(aiptek); @@ -1909,9 +1909,9 @@ static void aiptek_disconnect(struct usb_interface *intf) input_unregister_device(aiptek->inputdev); sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group); usb_free_urb(aiptek->urb); - usb_buffer_free(interface_to_usbdev(intf), - AIPTEK_PACKET_LENGTH, - aiptek->data, aiptek->data_dma); + usb_free_coherent(interface_to_usbdev(intf), + AIPTEK_PACKET_LENGTH, + aiptek->data, aiptek->data_dma); kfree(aiptek); } } diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c index 866a9ee1af1..8ea6afe2e99 100644 --- a/drivers/input/tablet/gtco.c +++ b/drivers/input/tablet/gtco.c @@ -850,8 +850,8 @@ static int gtco_probe(struct usb_interface *usbinterface, gtco->usbdev = usb_get_dev(interface_to_usbdev(usbinterface)); /* Allocate some data for incoming reports */ - gtco->buffer = usb_buffer_alloc(gtco->usbdev, REPORT_MAX_SIZE, - GFP_KERNEL, >co->buf_dma); + gtco->buffer = usb_alloc_coherent(gtco->usbdev, REPORT_MAX_SIZE, + GFP_KERNEL, >co->buf_dma); if (!gtco->buffer) { err("No more memory for us buffers"); error = -ENOMEM; @@ -982,8 +982,8 @@ static int gtco_probe(struct usb_interface *usbinterface, err_free_urb: usb_free_urb(gtco->urbinfo); err_free_buf: - usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE, - gtco->buffer, gtco->buf_dma); + usb_free_coherent(gtco->usbdev, REPORT_MAX_SIZE, + gtco->buffer, gtco->buf_dma); err_free_devs: input_free_device(input_dev); kfree(gtco); @@ -1005,8 +1005,8 @@ static void gtco_disconnect(struct usb_interface *interface) input_unregister_device(gtco->inputdevice); usb_kill_urb(gtco->urbinfo); usb_free_urb(gtco->urbinfo); - usb_buffer_free(gtco->usbdev, REPORT_MAX_SIZE, - gtco->buffer, gtco->buf_dma); + usb_free_coherent(gtco->usbdev, REPORT_MAX_SIZE, + gtco->buffer, gtco->buf_dma); kfree(gtco); } diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c index 6682b17bf84..d31b9c79355 100644 --- a/drivers/input/tablet/kbtab.c +++ b/drivers/input/tablet/kbtab.c @@ -129,7 +129,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i if (!kbtab || !input_dev) goto fail1; - kbtab->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &kbtab->data_dma); + kbtab->data = usb_alloc_coherent(dev, 8, GFP_KERNEL, &kbtab->data_dma); if (!kbtab->data) goto fail1; @@ -182,7 +182,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i return 0; fail3: usb_free_urb(kbtab->irq); - fail2: usb_buffer_free(dev, 10, kbtab->data, kbtab->data_dma); + fail2: usb_free_coherent(dev, 10, kbtab->data, kbtab->data_dma); fail1: input_free_device(input_dev); kfree(kbtab); return error; @@ -197,7 +197,7 @@ static void kbtab_disconnect(struct usb_interface *intf) usb_kill_urb(kbtab->irq); input_unregister_device(kbtab->dev); usb_free_urb(kbtab->irq); - usb_buffer_free(interface_to_usbdev(intf), 10, kbtab->data, kbtab->data_dma); + usb_free_coherent(interface_to_usbdev(intf), 10, kbtab->data, kbtab->data_dma); kfree(kbtab); } } diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index f46502589e4..191197cd83e 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c @@ -556,8 +556,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i goto fail1; } - wacom_wac->data = usb_buffer_alloc(dev, WACOM_PKGLEN_MAX, - GFP_KERNEL, &wacom->data_dma); + wacom_wac->data = usb_alloc_coherent(dev, WACOM_PKGLEN_MAX, + GFP_KERNEL, &wacom->data_dma); if (!wacom_wac->data) { error = -ENOMEM; goto fail1; @@ -633,7 +633,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i return 0; fail3: usb_free_urb(wacom->irq); - fail2: usb_buffer_free(dev, WACOM_PKGLEN_MAX, wacom_wac->data, wacom->data_dma); + fail2: usb_free_coherent(dev, WACOM_PKGLEN_MAX, wacom_wac->data, wacom->data_dma); fail1: input_free_device(input_dev); kfree(wacom); kfree(wacom_wac); @@ -649,8 +649,8 @@ static void wacom_disconnect(struct usb_interface *intf) usb_kill_urb(wacom->irq); input_unregister_device(wacom->dev); usb_free_urb(wacom->irq); - usb_buffer_free(interface_to_usbdev(intf), WACOM_PKGLEN_MAX, - wacom->wacom_wac->data, wacom->data_dma); + usb_free_coherent(interface_to_usbdev(intf), WACOM_PKGLEN_MAX, + wacom->wacom_wac->data, wacom->data_dma); kfree(wacom->wacom_wac); kfree(wacom); } diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 99330bbdbac..ea41a851ddf 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c @@ -1291,8 +1291,8 @@ static void usbtouch_close(struct input_dev *input) static void usbtouch_free_buffers(struct usb_device *udev, struct usbtouch_usb *usbtouch) { - usb_buffer_free(udev, usbtouch->type->rept_size, - usbtouch->data, usbtouch->data_dma); + usb_free_coherent(udev, usbtouch->type->rept_size, + usbtouch->data, usbtouch->data_dma); kfree(usbtouch->buffer); } @@ -1336,8 +1336,8 @@ static int usbtouch_probe(struct usb_interface *intf, if (!type->process_pkt) type->process_pkt = usbtouch_process_pkt; - usbtouch->data = usb_buffer_alloc(udev, type->rept_size, - GFP_KERNEL, &usbtouch->data_dma); + usbtouch->data = usb_alloc_coherent(udev, type->rept_size, + GFP_KERNEL, &usbtouch->data_dma); if (!usbtouch->data) goto out_free; diff --git a/drivers/media/dvb/dvb-usb/usb-urb.c b/drivers/media/dvb/dvb-usb/usb-urb.c index f9702e3756b..86d68933b6b 100644 --- a/drivers/media/dvb/dvb-usb/usb-urb.c +++ b/drivers/media/dvb/dvb-usb/usb-urb.c @@ -96,8 +96,9 @@ static int usb_free_stream_buffers(struct usb_data_stream *stream) while (stream->buf_num) { stream->buf_num--; deb_mem("freeing buffer %d\n",stream->buf_num); - usb_buffer_free(stream->udev, stream->buf_size, - stream->buf_list[stream->buf_num], stream->dma_addr[stream->buf_num]); + usb_free_coherent(stream->udev, stream->buf_size, + stream->buf_list[stream->buf_num], + stream->dma_addr[stream->buf_num]); } } @@ -116,7 +117,7 @@ static int usb_allocate_stream_buffers(struct usb_data_stream *stream, int num, for (stream->buf_num = 0; stream->buf_num < num; stream->buf_num++) { deb_mem("allocating buffer %d\n",stream->buf_num); if (( stream->buf_list[stream->buf_num] = - usb_buffer_alloc(stream->udev, size, GFP_ATOMIC, + usb_alloc_coherent(stream->udev, size, GFP_ATOMIC, &stream->dma_addr[stream->buf_num]) ) == NULL) { deb_mem("not enough memory for urb-buffer allocation.\n"); usb_free_stream_buffers(stream); diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c index 53baccbab17..fe1b8037b24 100644 --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c @@ -1257,7 +1257,7 @@ static int ttusb_dec_init_usb(struct ttusb_dec *dec) if(!dec->irq_urb) { return -ENOMEM; } - dec->irq_buffer = usb_buffer_alloc(dec->udev,IRQ_PACKET_SIZE, + dec->irq_buffer = usb_alloc_coherent(dec->udev,IRQ_PACKET_SIZE, GFP_ATOMIC, &dec->irq_dma_handle); if(!dec->irq_buffer) { usb_free_urb(dec->irq_urb); @@ -1550,8 +1550,8 @@ static void ttusb_dec_exit_rc(struct ttusb_dec *dec) usb_free_urb(dec->irq_urb); - usb_buffer_free(dec->udev,IRQ_PACKET_SIZE, - dec->irq_buffer, dec->irq_dma_handle); + usb_free_coherent(dec->udev,IRQ_PACKET_SIZE, + dec->irq_buffer, dec->irq_dma_handle); if (dec->rc_input_dev) { input_unregister_device(dec->rc_input_dev); diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c index 8c140c01c5e..a2a0f79a84f 100644 --- a/drivers/media/video/au0828/au0828-video.c +++ b/drivers/media/video/au0828/au0828-video.c @@ -177,7 +177,7 @@ void au0828_uninit_isoc(struct au0828_dev *dev) usb_unlink_urb(urb); if (dev->isoc_ctl.transfer_buffer[i]) { - usb_buffer_free(dev->usbdev, + usb_free_coherent(dev->usbdev, urb->transfer_buffer_length, dev->isoc_ctl.transfer_buffer[i], urb->transfer_dma); @@ -247,7 +247,7 @@ int au0828_init_isoc(struct au0828_dev *dev, int max_packets, } dev->isoc_ctl.urb[i] = urb; - dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->usbdev, + dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->usbdev, sb_size, GFP_KERNEL, &urb->transfer_dma); if (!dev->isoc_ctl.transfer_buffer[i]) { printk("unable to allocate %i bytes for transfer" diff --git a/drivers/media/video/cx231xx/cx231xx-core.c b/drivers/media/video/cx231xx/cx231xx-core.c index b24eee115e7..6ccd87d5fb9 100644 --- a/drivers/media/video/cx231xx/cx231xx-core.c +++ b/drivers/media/video/cx231xx/cx231xx-core.c @@ -679,11 +679,11 @@ void cx231xx_uninit_isoc(struct cx231xx *dev) usb_unlink_urb(urb); if (dev->video_mode.isoc_ctl.transfer_buffer[i]) { - usb_buffer_free(dev->udev, - urb->transfer_buffer_length, - dev->video_mode.isoc_ctl. - transfer_buffer[i], - urb->transfer_dma); + usb_free_coherent(dev->udev, + urb->transfer_buffer_length, + dev->video_mode.isoc_ctl. + transfer_buffer[i], + urb->transfer_dma); } usb_free_urb(urb); dev->video_mode.isoc_ctl.urb[i] = NULL; @@ -770,8 +770,8 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets, dev->video_mode.isoc_ctl.urb[i] = urb; dev->video_mode.isoc_ctl.transfer_buffer[i] = - usb_buffer_alloc(dev->udev, sb_size, GFP_KERNEL, - &urb->transfer_dma); + usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL, + &urb->transfer_dma); if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) { cx231xx_err("unable to allocate %i bytes for transfer" " buffer %i%s\n", diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index a41cc556677..d4a95546504 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c @@ -966,7 +966,7 @@ void em28xx_uninit_isoc(struct em28xx *dev) usb_unlink_urb(urb); if (dev->isoc_ctl.transfer_buffer[i]) { - usb_buffer_free(dev->udev, + usb_free_coherent(dev->udev, urb->transfer_buffer_length, dev->isoc_ctl.transfer_buffer[i], urb->transfer_dma); @@ -1041,7 +1041,7 @@ int em28xx_init_isoc(struct em28xx *dev, int max_packets, } dev->isoc_ctl.urb[i] = urb; - dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->udev, + dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL, &urb->transfer_dma); if (!dev->isoc_ctl.transfer_buffer[i]) { em28xx_err("unable to allocate %i bytes for transfer" diff --git a/drivers/media/video/gspca/benq.c b/drivers/media/video/gspca/benq.c index 43ac4af8d3e..fce8d949264 100644 --- a/drivers/media/video/gspca/benq.c +++ b/drivers/media/video/gspca/benq.c @@ -117,13 +117,13 @@ static int sd_start(struct gspca_dev *gspca_dev) return -ENOMEM; } gspca_dev->urb[n] = urb; - urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev, + urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev, SD_PKT_SZ * SD_NPKT, GFP_KERNEL, &urb->transfer_dma); if (urb->transfer_buffer == NULL) { - err("usb_buffer_alloc failed"); + err("usb_alloc_coherent failed"); return -ENOMEM; } urb->dev = gspca_dev->dev; diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 222af479150..00713f81d1e 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c @@ -213,7 +213,7 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev, goto error; } - buffer = usb_buffer_alloc(dev, ep->wMaxPacketSize, + buffer = usb_alloc_coherent(dev, ep->wMaxPacketSize, GFP_KERNEL, &urb->transfer_dma); if (!buffer) { ret = -ENOMEM; @@ -232,10 +232,10 @@ static int alloc_and_submit_int_urb(struct gspca_dev *gspca_dev, return ret; error_submit: - usb_buffer_free(dev, - urb->transfer_buffer_length, - urb->transfer_buffer, - urb->transfer_dma); + usb_free_coherent(dev, + urb->transfer_buffer_length, + urb->transfer_buffer, + urb->transfer_dma); error_buffer: usb_free_urb(urb); error: @@ -272,10 +272,10 @@ static void gspca_input_destroy_urb(struct gspca_dev *gspca_dev) if (urb) { gspca_dev->int_urb = NULL; usb_kill_urb(urb); - usb_buffer_free(gspca_dev->dev, - urb->transfer_buffer_length, - urb->transfer_buffer, - urb->transfer_dma); + usb_free_coherent(gspca_dev->dev, + urb->transfer_buffer_length, + urb->transfer_buffer, + urb->transfer_dma); usb_free_urb(urb); } } @@ -597,10 +597,10 @@ static void destroy_urbs(struct gspca_dev *gspca_dev) gspca_dev->urb[i] = NULL; usb_kill_urb(urb); if (urb->transfer_buffer != NULL) - usb_buffer_free(gspca_dev->dev, - urb->transfer_buffer_length, - urb->transfer_buffer, - urb->transfer_dma); + usb_free_coherent(gspca_dev->dev, + urb->transfer_buffer_length, + urb->transfer_buffer, + urb->transfer_dma); usb_free_urb(urb); } } @@ -721,13 +721,13 @@ static int create_urbs(struct gspca_dev *gspca_dev, return -ENOMEM; } gspca_dev->urb[n] = urb; - urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev, + urb->transfer_buffer = usb_alloc_coherent(gspca_dev->dev, bsize, GFP_KERNEL, &urb->transfer_dma); if (urb->transfer_buffer == NULL) { - err("usb_buffer_alloc failed"); + err("usb_alloc_coherent failed"); return -ENOMEM; } urb->dev = gspca_dev->dev; diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c index 196f82de48f..b65efe25b31 100644 --- a/drivers/media/video/hdpvr/hdpvr-video.c +++ b/drivers/media/video/hdpvr/hdpvr-video.c @@ -92,8 +92,8 @@ static int hdpvr_free_queue(struct list_head *q) buf = list_entry(p, struct hdpvr_buffer, buff_list); urb = buf->urb; - usb_buffer_free(urb->dev, urb->transfer_buffer_length, - urb->transfer_buffer, urb->transfer_dma); + usb_free_coherent(urb->dev, urb->transfer_buffer_length, + urb->transfer_buffer, urb->transfer_dma); usb_free_urb(urb); tmp = p->next; list_del(p); @@ -143,8 +143,8 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count) } buf->urb = urb; - mem = usb_buffer_alloc(dev->udev, dev->bulk_in_size, GFP_KERNEL, - &urb->transfer_dma); + mem = usb_alloc_coherent(dev->udev, dev->bulk_in_size, GFP_KERNEL, + &urb->transfer_dma); if (!mem) { v4l2_err(&dev->v4l2_dev, "cannot allocate usb transfer buffer\n"); diff --git a/drivers/media/video/tlg2300/pd-video.c b/drivers/media/video/tlg2300/pd-video.c index cf8f18c007e..7bc29065e1a 100644 --- a/drivers/media/video/tlg2300/pd-video.c +++ b/drivers/media/video/tlg2300/pd-video.c @@ -476,10 +476,10 @@ static int prepare_iso_urb(struct video_data *video) goto out; video->urb_array[i] = urb; - mem = usb_buffer_alloc(udev, - ISO_PKT_SIZE * PK_PER_URB, - GFP_KERNEL, - &urb->transfer_dma); + mem = usb_alloc_coherent(udev, + ISO_PKT_SIZE * PK_PER_URB, + GFP_KERNEL, + &urb->transfer_dma); urb->complete = urb_complete_iso; /* handler */ urb->dev = udev; @@ -519,8 +519,8 @@ int alloc_bulk_urbs_generic(struct urb **urb_array, int num, if (urb == NULL) return i; - mem = usb_buffer_alloc(udev, buf_size, gfp_flags, - &urb->transfer_dma); + mem = usb_alloc_coherent(udev, buf_size, gfp_flags, + &urb->transfer_dma); if (mem == NULL) return i; @@ -540,7 +540,7 @@ void free_all_urb_generic(struct urb **urb_array, int num) for (i = 0; i < num; i++) { urb = urb_array[i]; if (urb) { - usb_buffer_free(urb->dev, + usb_free_coherent(urb->dev, urb->transfer_buffer_length, urb->transfer_buffer, urb->transfer_dma); diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c index f7aae229375..b9dd74fde21 100644 --- a/drivers/media/video/usbvision/usbvision-core.c +++ b/drivers/media/video/usbvision/usbvision-core.c @@ -2493,10 +2493,10 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision) } usbvision->sbuf[bufIdx].urb = urb; usbvision->sbuf[bufIdx].data = - usb_buffer_alloc(usbvision->dev, - sb_size, - GFP_KERNEL, - &urb->transfer_dma); + usb_alloc_coherent(usbvision->dev, + sb_size, + GFP_KERNEL, + &urb->transfer_dma); urb->dev = dev; urb->context = usbvision; urb->pipe = usb_rcvisocpipe(dev, usbvision->video_endp); @@ -2552,10 +2552,10 @@ void usbvision_stop_isoc(struct usb_usbvision *usbvision) for (bufIdx = 0; bufIdx < USBVISION_NUMSBUF; bufIdx++) { usb_kill_urb(usbvision->sbuf[bufIdx].urb); if (usbvision->sbuf[bufIdx].data){ - usb_buffer_free(usbvision->dev, - sb_size, - usbvision->sbuf[bufIdx].data, - usbvision->sbuf[bufIdx].urb->transfer_dma); + usb_free_coherent(usbvision->dev, + sb_size, + usbvision->sbuf[bufIdx].data, + usbvision->sbuf[bufIdx].urb->transfer_dma); } usb_free_urb(usbvision->sbuf[bufIdx].urb); usbvision->sbuf[bufIdx].urb = NULL; diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c index 821a9969b7b..53f3ef4635e 100644 --- a/drivers/media/video/uvc/uvc_video.c +++ b/drivers/media/video/uvc/uvc_video.c @@ -739,7 +739,7 @@ static void uvc_free_urb_buffers(struct uvc_streaming *stream) for (i = 0; i < UVC_URBS; ++i) { if (stream->urb_buffer[i]) { - usb_buffer_free(stream->dev->udev, stream->urb_size, + usb_free_coherent(stream->dev->udev, stream->urb_size, stream->urb_buffer[i], stream->urb_dma[i]); stream->urb_buffer[i] = NULL; } @@ -780,7 +780,7 @@ static int uvc_alloc_urb_buffers(struct uvc_streaming *stream, for (; npackets > 1; npackets /= 2) { for (i = 0; i < UVC_URBS; ++i) { stream->urb_size = psize * npackets; - stream->urb_buffer[i] = usb_buffer_alloc( + stream->urb_buffer[i] = usb_alloc_coherent( stream->dev->udev, stream->urb_size, gfp_flags | __GFP_NOWARN, &stream->urb_dma[i]); if (!stream->urb_buffer[i]) { diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c index d800b598ae3..25a5c7eea94 100644 --- a/drivers/net/can/usb/ems_usb.c +++ b/drivers/net/can/usb/ems_usb.c @@ -516,8 +516,8 @@ static void ems_usb_write_bulk_callback(struct urb *urb) netdev = dev->netdev; /* free up our allocated buffer */ - usb_buffer_free(urb->dev, urb->transfer_buffer_length, - urb->transfer_buffer, urb->transfer_dma); + usb_free_coherent(urb->dev, urb->transfer_buffer_length, + urb->transfer_buffer, urb->transfer_dma); atomic_dec(&dev->active_tx_urbs); @@ -614,8 +614,8 @@ static int ems_usb_start(struct ems_usb *dev) return -ENOMEM; } - buf = usb_buffer_alloc(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL, - &urb->transfer_dma); + buf = usb_alloc_coherent(dev->udev, RX_BUFFER_SIZE, GFP_KERNEL, + &urb->transfer_dma); if (!buf) { dev_err(netdev->dev.parent, "No memory left for USB buffer\n"); @@ -635,8 +635,8 @@ static int ems_usb_start(struct ems_usb *dev) netif_device_detach(dev->netdev); usb_unanchor_urb(urb); - usb_buffer_free(dev->udev, RX_BUFFER_SIZE, buf, - urb->transfer_dma); + usb_free_coherent(dev->udev, RX_BUFFER_SIZE, buf, + urb->transfer_dma); break; } @@ -777,7 +777,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne goto nomem; } - buf = usb_buffer_alloc(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma); + buf = usb_alloc_coherent(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma); if (!buf) { dev_err(netdev->dev.parent, "No memory left for USB buffer\n"); usb_free_urb(urb); @@ -820,7 +820,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne */ if (!context) { usb_unanchor_urb(urb); - usb_buffer_free(dev->udev, size, buf, urb->transfer_dma); + usb_free_coherent(dev->udev, size, buf, urb->transfer_dma); dev_warn(netdev->dev.parent, "couldn't find free context\n"); @@ -845,7 +845,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne can_free_echo_skb(netdev, context->echo_index); usb_unanchor_urb(urb); - usb_buffer_free(dev->udev, size, buf, urb->transfer_dma); + usb_free_coherent(dev->udev, size, buf, urb->transfer_dma); dev_kfree_skb(skb); atomic_dec(&dev->active_tx_urbs); diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c index 418825d26f9..197c352c47f 100644 --- a/drivers/net/usb/ipheth.c +++ b/drivers/net/usb/ipheth.c @@ -128,17 +128,13 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone) if (rx_urb == NULL) goto free_tx_urb; - tx_buf = usb_buffer_alloc(iphone->udev, - IPHETH_BUF_SIZE, - GFP_KERNEL, - &tx_urb->transfer_dma); + tx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE, + GFP_KERNEL, &tx_urb->transfer_dma); if (tx_buf == NULL) goto free_rx_urb; - rx_buf = usb_buffer_alloc(iphone->udev, - IPHETH_BUF_SIZE, - GFP_KERNEL, - &rx_urb->transfer_dma); + rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE, + GFP_KERNEL, &rx_urb->transfer_dma); if (rx_buf == NULL) goto free_tx_buf; @@ -150,8 +146,8 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone) return 0; free_tx_buf: - usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, tx_buf, - tx_urb->transfer_dma); + usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, tx_buf, + tx_urb->transfer_dma); free_rx_urb: usb_free_urb(rx_urb); free_tx_urb: @@ -162,10 +158,10 @@ error_nomem: static void ipheth_free_urbs(struct ipheth_device *iphone) { - usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf, - iphone->rx_urb->transfer_dma); - usb_buffer_free(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf, - iphone->tx_urb->transfer_dma); + usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf, + iphone->rx_urb->transfer_dma); + usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf, + iphone->tx_urb->transfer_dma); usb_free_urb(iphone->rx_urb); usb_free_urb(iphone->tx_urb); } diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index c4c334d9770..a3eb7be51d5 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c @@ -1156,13 +1156,13 @@ err_fw: if (!kaweth->irq_urb) goto err_tx_and_rx; - kaweth->intbuffer = usb_buffer_alloc( kaweth->dev, + kaweth->intbuffer = usb_alloc_coherent( kaweth->dev, INTBUFFERSIZE, GFP_KERNEL, &kaweth->intbufferhandle); if (!kaweth->intbuffer) goto err_tx_and_rx_and_irq; - kaweth->rx_buf = usb_buffer_alloc( kaweth->dev, + kaweth->rx_buf = usb_alloc_coherent( kaweth->dev, KAWETH_BUF_SIZE, GFP_KERNEL, &kaweth->rxbufferhandle); @@ -1203,9 +1203,9 @@ err_fw: err_intfdata: usb_set_intfdata(intf, NULL); - usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle); + usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle); err_all_but_rxbuf: - usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle); + usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle); err_tx_and_rx_and_irq: usb_free_urb(kaweth->irq_urb); err_tx_and_rx: @@ -1242,8 +1242,8 @@ static void kaweth_disconnect(struct usb_interface *intf) usb_free_urb(kaweth->tx_urb); usb_free_urb(kaweth->irq_urb); - usb_buffer_free(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle); - usb_buffer_free(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle); + usb_free_coherent(kaweth->dev, KAWETH_BUF_SIZE, (void *)kaweth->rx_buf, kaweth->rxbufferhandle); + usb_free_coherent(kaweth->dev, INTBUFFERSIZE, (void *)kaweth->intbuffer, kaweth->intbufferhandle); free_netdev(netdev); } diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c index e1c2fcaa8be..a1f5444f7cc 100644 --- a/drivers/net/wireless/ath/ar9170/usb.c +++ b/drivers/net/wireless/ath/ar9170/usb.c @@ -202,7 +202,7 @@ resubmit: return; free: - usb_buffer_free(aru->udev, 64, urb->transfer_buffer, urb->transfer_dma); + usb_free_coherent(aru->udev, 64, urb->transfer_buffer, urb->transfer_dma); } static void ar9170_usb_rx_completed(struct urb *urb) @@ -283,7 +283,7 @@ static int ar9170_usb_alloc_rx_irq_urb(struct ar9170_usb *aru) if (!urb) goto out; - ibuf = usb_buffer_alloc(aru->udev, 64, GFP_KERNEL, &urb->transfer_dma); + ibuf = usb_alloc_coherent(aru->udev, 64, GFP_KERNEL, &urb->transfer_dma); if (!ibuf) goto out; @@ -296,8 +296,8 @@ static int ar9170_usb_alloc_rx_irq_urb(struct ar9170_usb *aru) err = usb_submit_urb(urb, GFP_KERNEL); if (err) { usb_unanchor_urb(urb); - usb_buffer_free(aru->udev, 64, urb->transfer_buffer, - urb->transfer_dma); + usb_free_coherent(aru->udev, 64, urb->transfer_buffer, + urb->transfer_dma); } out: diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index d91ad1a612a..c257940b71b 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c @@ -664,15 +664,15 @@ static struct urb *alloc_rx_urb(struct zd_usb *usb) urb = usb_alloc_urb(0, GFP_KERNEL); if (!urb) return NULL; - buffer = usb_buffer_alloc(udev, USB_MAX_RX_SIZE, GFP_KERNEL, - &urb->transfer_dma); + buffer = usb_alloc_coherent(udev, USB_MAX_RX_SIZE, GFP_KERNEL, + &urb->transfer_dma); if (!buffer) { usb_free_urb(urb); return NULL; } usb_fill_bulk_urb(urb, udev, usb_rcvbulkpipe(udev, EP_DATA_IN), - buffer, USB_MAX_RX_SIZE, + buffer, USB_MAX_RX_SIZE, rx_urb_complete, usb); urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; @@ -683,8 +683,8 @@ static void free_rx_urb(struct urb *urb) { if (!urb) return; - usb_buffer_free(urb->dev, urb->transfer_buffer_length, - urb->transfer_buffer, urb->transfer_dma); + usb_free_coherent(urb->dev, urb->transfer_buffer_length, + urb->transfer_buffer, urb->transfer_dma); usb_free_urb(urb); } diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 5e1a253b08a..0c2f14ff969 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -892,7 +892,7 @@ static void acm_write_buffers_free(struct acm *acm) struct usb_device *usb_dev = interface_to_usbdev(acm->control); for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) - usb_buffer_free(usb_dev, acm->writesize, wb->buf, wb->dmah); + usb_free_coherent(usb_dev, acm->writesize, wb->buf, wb->dmah); } static void acm_read_buffers_free(struct acm *acm) @@ -901,8 +901,8 @@ static void acm_read_buffers_free(struct acm *acm) int i, n = acm->rx_buflimit; for (i = 0; i < n; i++) - usb_buffer_free(usb_dev, acm->readsize, - acm->rb[i].base, acm->rb[i].dma); + usb_free_coherent(usb_dev, acm->readsize, + acm->rb[i].base, acm->rb[i].dma); } /* Little helper: write buffers allocate */ @@ -912,13 +912,13 @@ static int acm_write_buffers_alloc(struct acm *acm) struct acm_wb *wb; for (wb = &acm->wb[0], i = 0; i < ACM_NW; i++, wb++) { - wb->buf = usb_buffer_alloc(acm->dev, acm->writesize, GFP_KERNEL, + wb->buf = usb_alloc_coherent(acm->dev, acm->writesize, GFP_KERNEL, &wb->dmah); if (!wb->buf) { while (i != 0) { --i; --wb; - usb_buffer_free(acm->dev, acm->writesize, + usb_free_coherent(acm->dev, acm->writesize, wb->buf, wb->dmah); } return -ENOMEM; @@ -1177,7 +1177,7 @@ made_compressed_probe: tty_port_init(&acm->port); acm->port.ops = &acm_port_ops; - buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma); + buf = usb_alloc_coherent(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma); if (!buf) { dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)\n"); goto alloc_fail2; @@ -1210,11 +1210,11 @@ made_compressed_probe: for (i = 0; i < num_rx_buf; i++) { struct acm_rb *rb = &(acm->rb[i]); - rb->base = usb_buffer_alloc(acm->dev, readsize, + rb->base = usb_alloc_coherent(acm->dev, readsize, GFP_KERNEL, &rb->dma); if (!rb->base) { dev_dbg(&intf->dev, - "out of memory (read bufs usb_buffer_alloc)\n"); + "out of memory (read bufs usb_alloc_coherent)\n"); goto alloc_fail7; } } @@ -1306,7 +1306,7 @@ alloc_fail7: alloc_fail5: acm_write_buffers_free(acm); alloc_fail4: - usb_buffer_free(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma); + usb_free_coherent(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma); alloc_fail2: kfree(acm); alloc_fail: @@ -1356,8 +1356,8 @@ static void acm_disconnect(struct usb_interface *intf) stop_data_traffic(acm); acm_write_buffers_free(acm); - usb_buffer_free(usb_dev, acm->ctrlsize, acm->ctrl_buffer, - acm->ctrl_dma); + usb_free_coherent(usb_dev, acm->ctrlsize, acm->ctrl_buffer, + acm->ctrl_dma); acm_read_buffers_free(acm); if (!acm->combined_interfaces) diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 189141ca4e0..094c76b5de1 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -276,14 +276,14 @@ static void free_urbs(struct wdm_device *desc) static void cleanup(struct wdm_device *desc) { - usb_buffer_free(interface_to_usbdev(desc->intf), - desc->wMaxPacketSize, - desc->sbuf, - desc->validity->transfer_dma); - usb_buffer_free(interface_to_usbdev(desc->intf), - desc->wMaxCommand, - desc->inbuf, - desc->response->transfer_dma); + usb_free_coherent(interface_to_usbdev(desc->intf), + desc->wMaxPacketSize, + desc->sbuf, + desc->validity->transfer_dma); + usb_free_coherent(interface_to_usbdev(desc->intf), + desc->wMaxCommand, + desc->inbuf, + desc->response->transfer_dma); kfree(desc->orq); kfree(desc->irq); kfree(desc->ubuf); @@ -705,17 +705,17 @@ next_desc: if (!desc->ubuf) goto err; - desc->sbuf = usb_buffer_alloc(interface_to_usbdev(intf), + desc->sbuf = usb_alloc_coherent(interface_to_usbdev(intf), desc->wMaxPacketSize, GFP_KERNEL, &desc->validity->transfer_dma); if (!desc->sbuf) goto err; - desc->inbuf = usb_buffer_alloc(interface_to_usbdev(intf), - desc->bMaxPacketSize0, - GFP_KERNEL, - &desc->response->transfer_dma); + desc->inbuf = usb_alloc_coherent(interface_to_usbdev(intf), + desc->bMaxPacketSize0, + GFP_KERNEL, + &desc->response->transfer_dma); if (!desc->inbuf) goto err2; @@ -742,15 +742,15 @@ out: return rv; err3: usb_set_intfdata(intf, NULL); - usb_buffer_free(interface_to_usbdev(desc->intf), - desc->bMaxPacketSize0, + usb_free_coherent(interface_to_usbdev(desc->intf), + desc->bMaxPacketSize0, desc->inbuf, desc->response->transfer_dma); err2: - usb_buffer_free(interface_to_usbdev(desc->intf), - desc->wMaxPacketSize, - desc->sbuf, - desc->validity->transfer_dma); + usb_free_coherent(interface_to_usbdev(desc->intf), + desc->wMaxPacketSize, + desc->sbuf, + desc->validity->transfer_dma); err: free_urbs(desc); kfree(desc->ubuf); diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 93b5f85d7ce..2250095db0a 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c @@ -27,7 +27,7 @@ * v0.11 - add proto_bias option (Pete Zaitcev) * v0.12 - add hpoj.sourceforge.net ioctls (David Paschal) * v0.13 - alloc space for statusbuf ( not on stack); - * use usb_buffer_alloc() for read buf & write buf; + * use usb_alloc_coherent() for read buf & write buf; * none - Maintained in Linux kernel after v0.13 */ diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index 094f91cbc57..1fa6ce3e4a2 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c @@ -259,7 +259,7 @@ static int appledisplay_probe(struct usb_interface *iface, } /* Allocate buffer for interrupt data */ - pdata->urbdata = usb_buffer_alloc(pdata->udev, ACD_URB_BUFFER_LEN, + pdata->urbdata = usb_alloc_coherent(pdata->udev, ACD_URB_BUFFER_LEN, GFP_KERNEL, &pdata->urb->transfer_dma); if (!pdata->urbdata) { retval = -ENOMEM; @@ -316,7 +316,7 @@ error: if (pdata->urb) { usb_kill_urb(pdata->urb); if (pdata->urbdata) - usb_buffer_free(pdata->udev, ACD_URB_BUFFER_LEN, + usb_free_coherent(pdata->udev, ACD_URB_BUFFER_LEN, pdata->urbdata, pdata->urb->transfer_dma); usb_free_urb(pdata->urb); } @@ -337,7 +337,7 @@ static void appledisplay_disconnect(struct usb_interface *iface) usb_kill_urb(pdata->urb); cancel_delayed_work(&pdata->work); backlight_device_unregister(pdata->bd); - usb_buffer_free(pdata->udev, ACD_URB_BUFFER_LEN, + usb_free_coherent(pdata->udev, ACD_URB_BUFFER_LEN, pdata->urbdata, pdata->urb->transfer_dma); usb_free_urb(pdata->urb); kfree(pdata->msgdata); diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c index 2300a51d48b..82e16630a78 100644 --- a/drivers/usb/misc/ftdi-elan.c +++ b/drivers/usb/misc/ftdi-elan.c @@ -734,7 +734,7 @@ static void ftdi_elan_write_bulk_callback(struct urb *urb) dev_err(&ftdi->udev->dev, "urb=%p write bulk status received: %" "d\n", urb, status); } - usb_buffer_free(urb->dev, urb->transfer_buffer_length, + usb_free_coherent(urb->dev, urb->transfer_buffer_length, urb->transfer_buffer, urb->transfer_dma); } @@ -795,7 +795,7 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi) total_size); return -ENOMEM; } - buf = usb_buffer_alloc(ftdi->udev, total_size, GFP_KERNEL, + buf = usb_alloc_coherent(ftdi->udev, total_size, GFP_KERNEL, &urb->transfer_dma); if (!buf) { dev_err(&ftdi->udev->dev, "could not get a buffer to write %d c" @@ -829,7 +829,7 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi) dev_err(&ftdi->udev->dev, "failed %d to submit urb %p to write " "%d commands totaling %d bytes to the Uxxx\n", retval, urb, command_size, total_size); - usb_buffer_free(ftdi->udev, total_size, buf, urb->transfer_dma); + usb_free_coherent(ftdi->udev, total_size, buf, urb->transfer_dma); usb_free_urb(urb); return retval; } @@ -1167,7 +1167,7 @@ static ssize_t ftdi_elan_write(struct file *file, retval = -ENOMEM; goto error_1; } - buf = usb_buffer_alloc(ftdi->udev, count, GFP_KERNEL, + buf = usb_alloc_coherent(ftdi->udev, count, GFP_KERNEL, &urb->transfer_dma); if (!buf) { retval = -ENOMEM; @@ -1192,7 +1192,7 @@ static ssize_t ftdi_elan_write(struct file *file, exit: return count; error_3: - usb_buffer_free(ftdi->udev, count, buf, urb->transfer_dma); + usb_free_coherent(ftdi->udev, count, buf, urb->transfer_dma); error_2: usb_free_urb(urb); error_1: @@ -1968,7 +1968,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi) "ence\n"); return -ENOMEM; } - buf = usb_buffer_alloc(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma); + buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma); if (!buf) { dev_err(&ftdi->udev->dev, "could not get a buffer for flush seq" "uence\n"); @@ -1985,7 +1985,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi) if (retval) { dev_err(&ftdi->udev->dev, "failed to submit urb containing the " "flush sequence\n"); - usb_buffer_free(ftdi->udev, i, buf, urb->transfer_dma); + usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma); usb_free_urb(urb); return -ENOMEM; } @@ -2011,7 +2011,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi) "quence\n"); return -ENOMEM; } - buf = usb_buffer_alloc(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma); + buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma); if (!buf) { dev_err(&ftdi->udev->dev, "could not get a buffer for the reset" " sequence\n"); @@ -2030,7 +2030,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi) if (retval) { dev_err(&ftdi->udev->dev, "failed to submit urb containing the " "reset sequence\n"); - usb_buffer_free(ftdi->udev, i, buf, urb->transfer_dma); + usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma); usb_free_urb(urb); return -ENOMEM; } diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index d3c85236388..7dc9d3c6998 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -239,8 +239,8 @@ static void iowarrior_write_callback(struct urb *urb) __func__, status); } /* free up our allocated buffer */ - usb_buffer_free(urb->dev, urb->transfer_buffer_length, - urb->transfer_buffer, urb->transfer_dma); + usb_free_coherent(urb->dev, urb->transfer_buffer_length, + urb->transfer_buffer, urb->transfer_dma); /* tell a waiting writer the interrupt-out-pipe is available again */ atomic_dec(&dev->write_busy); wake_up_interruptible(&dev->write_wait); @@ -421,8 +421,8 @@ static ssize_t iowarrior_write(struct file *file, dbg("%s Unable to allocate urb ", __func__); goto error_no_urb; } - buf = usb_buffer_alloc(dev->udev, dev->report_size, - GFP_KERNEL, &int_out_urb->transfer_dma); + buf = usb_alloc_coherent(dev->udev, dev->report_size, + GFP_KERNEL, &int_out_urb->transfer_dma); if (!buf) { retval = -ENOMEM; dbg("%s Unable to allocate buffer ", __func__); @@ -459,8 +459,8 @@ static ssize_t iowarrior_write(struct file *file, break; } error: - usb_buffer_free(dev->udev, dev->report_size, buf, - int_out_urb->transfer_dma); + usb_free_coherent(dev->udev, dev->report_size, buf, + int_out_urb->transfer_dma); error_no_buffer: usb_free_urb(int_out_urb); error_no_urb: diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c index 90aede90553..7828c764b32 100644 --- a/drivers/usb/misc/usblcd.c +++ b/drivers/usb/misc/usblcd.c @@ -205,8 +205,8 @@ static void lcd_write_bulk_callback(struct urb *urb) } /* free up our allocated buffer */ - usb_buffer_free(urb->dev, urb->transfer_buffer_length, - urb->transfer_buffer, urb->transfer_dma); + usb_free_coherent(urb->dev, urb->transfer_buffer_length, + urb->transfer_buffer, urb->transfer_dma); up(&dev->limit_sem); } @@ -234,7 +234,7 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, siz goto err_no_buf; } - buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma); + buf = usb_alloc_coherent(dev->udev, count, GFP_KERNEL, &urb->transfer_dma); if (!buf) { retval = -ENOMEM; goto error; @@ -268,7 +268,7 @@ exit: error_unanchor: usb_unanchor_urb(urb); error: - usb_buffer_free(dev->udev, count, buf, urb->transfer_dma); + usb_free_coherent(dev->udev, count, buf, urb->transfer_dma); usb_free_urb(urb); err_no_buf: up(&dev->limit_sem); diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 9dcc82337ce..16dffe99d9f 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -202,7 +202,7 @@ static struct urb *simple_alloc_urb ( urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; if (usb_pipein (pipe)) urb->transfer_flags |= URB_SHORT_NOT_OK; - urb->transfer_buffer = usb_buffer_alloc (udev, bytes, GFP_KERNEL, + urb->transfer_buffer = usb_alloc_coherent (udev, bytes, GFP_KERNEL, &urb->transfer_dma); if (!urb->transfer_buffer) { usb_free_urb (urb); @@ -272,8 +272,8 @@ static inline int simple_check_buf(struct usbtest_dev *tdev, struct urb *urb) static void simple_free_urb (struct urb *urb) { - usb_buffer_free (urb->dev, urb->transfer_buffer_length, - urb->transfer_buffer, urb->transfer_dma); + usb_free_coherent(urb->dev, urb->transfer_buffer_length, + urb->transfer_buffer, urb->transfer_dma); usb_free_urb (urb); } @@ -1416,7 +1416,7 @@ static struct urb *iso_alloc_urb ( urb->number_of_packets = packets; urb->transfer_buffer_length = bytes; - urb->transfer_buffer = usb_buffer_alloc (udev, bytes, GFP_KERNEL, + urb->transfer_buffer = usb_alloc_coherent (udev, bytes, GFP_KERNEL, &urb->transfer_dma); if (!urb->transfer_buffer) { usb_free_urb (urb); diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c index 198bb3ed95b..1943be5a291 100644 --- a/drivers/usb/storage/onetouch.c +++ b/drivers/usb/storage/onetouch.c @@ -201,8 +201,8 @@ static int onetouch_connect_input(struct us_data *ss) if (!onetouch || !input_dev) goto fail1; - onetouch->data = usb_buffer_alloc(udev, ONETOUCH_PKT_LEN, - GFP_KERNEL, &onetouch->data_dma); + onetouch->data = usb_alloc_coherent(udev, ONETOUCH_PKT_LEN, + GFP_KERNEL, &onetouch->data_dma); if (!onetouch->data) goto fail1; @@ -264,8 +264,8 @@ static int onetouch_connect_input(struct us_data *ss) return 0; fail3: usb_free_urb(onetouch->irq); - fail2: usb_buffer_free(udev, ONETOUCH_PKT_LEN, - onetouch->data, onetouch->data_dma); + fail2: usb_free_coherent(udev, ONETOUCH_PKT_LEN, + onetouch->data, onetouch->data_dma); fail1: kfree(onetouch); input_free_device(input_dev); return error; @@ -279,8 +279,8 @@ static void onetouch_release_input(void *onetouch_) usb_kill_urb(onetouch->irq); input_unregister_device(onetouch->dev); usb_free_urb(onetouch->irq); - usb_buffer_free(onetouch->udev, ONETOUCH_PKT_LEN, - onetouch->data, onetouch->data_dma); + usb_free_coherent(onetouch->udev, ONETOUCH_PKT_LEN, + onetouch->data, onetouch->data_dma); } } diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index c54a370c76c..e2798ef2dd1 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -414,7 +414,7 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf) return -ENOMEM; } - us->iobuf = usb_buffer_alloc(us->pusb_dev, US_IOBUF_SIZE, + us->iobuf = usb_alloc_coherent(us->pusb_dev, US_IOBUF_SIZE, GFP_KERNEL, &us->iobuf_dma); if (!us->iobuf) { US_DEBUGP("I/O buffer allocation failed\n"); @@ -758,7 +758,7 @@ static void dissociate_dev(struct us_data *us) /* Free the buffers */ kfree(us->cr); - usb_buffer_free(us->pusb_dev, US_IOBUF_SIZE, us->iobuf, us->iobuf_dma); + usb_free_coherent(us->pusb_dev, US_IOBUF_SIZE, us->iobuf, us->iobuf_dma); /* Remove our private data from the interface */ usb_set_intfdata(us->pusb_intf, NULL); diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c index 61522787f39..d110588b56f 100644 --- a/drivers/usb/usb-skeleton.c +++ b/drivers/usb/usb-skeleton.c @@ -387,8 +387,8 @@ static void skel_write_bulk_callback(struct urb *urb) } /* free up our allocated buffer */ - usb_buffer_free(urb->dev, urb->transfer_buffer_length, - urb->transfer_buffer, urb->transfer_dma); + usb_free_coherent(urb->dev, urb->transfer_buffer_length, + urb->transfer_buffer, urb->transfer_dma); up(&dev->limit_sem); } @@ -442,8 +442,8 @@ static ssize_t skel_write(struct file *file, const char *user_buffer, goto error; } - buf = usb_buffer_alloc(dev->udev, writesize, GFP_KERNEL, - &urb->transfer_dma); + buf = usb_alloc_coherent(dev->udev, writesize, GFP_KERNEL, + &urb->transfer_dma); if (!buf) { retval = -ENOMEM; goto error; @@ -491,7 +491,7 @@ error_unanchor: usb_unanchor_urb(urb); error: if (urb) { - usb_buffer_free(dev->udev, writesize, buf, urb->transfer_dma); + usb_free_coherent(dev->udev, writesize, buf, urb->transfer_dma); usb_free_urb(urb); } up(&dev->limit_sem); diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c index 8e4eacc5bb5..748a74bd85e 100644 --- a/drivers/watchdog/pcwd_usb.c +++ b/drivers/watchdog/pcwd_usb.c @@ -600,8 +600,8 @@ static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd) { usb_free_urb(usb_pcwd->intr_urb); if (usb_pcwd->intr_buffer != NULL) - usb_buffer_free(usb_pcwd->udev, usb_pcwd->intr_size, - usb_pcwd->intr_buffer, usb_pcwd->intr_dma); + usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size, + usb_pcwd->intr_buffer, usb_pcwd->intr_dma); kfree(usb_pcwd); } @@ -671,7 +671,7 @@ static int usb_pcwd_probe(struct usb_interface *interface, le16_to_cpu(endpoint->wMaxPacketSize) : 8); /* set up the memory buffer's */ - usb_pcwd->intr_buffer = usb_buffer_alloc(udev, usb_pcwd->intr_size, + usb_pcwd->intr_buffer = usb_alloc_coherent(udev, usb_pcwd->intr_size, GFP_ATOMIC, &usb_pcwd->intr_dma); if (!usb_pcwd->intr_buffer) { printk(KERN_ERR PFX "Out of memory\n"); diff --git a/sound/usb/ua101.c b/sound/usb/ua101.c index 3d458d3b996..d700e32dee2 100644 --- a/sound/usb/ua101.c +++ b/sound/usb/ua101.c @@ -41,7 +41,7 @@ MODULE_SUPPORTED_DEVICE("{{Edirol,UA-101},{Edirol,UA-1000}}"); /* * This magic value optimizes memory usage efficiency for the UA-101's packet * sizes at all sample rates, taking into account the stupid cache pool sizes - * that usb_buffer_alloc() uses. + * that usb_alloc_coherent() uses. */ #define DEFAULT_QUEUE_LENGTH 21 @@ -1056,7 +1056,7 @@ static int alloc_stream_buffers(struct ua101 *ua, struct ua101_stream *stream) (unsigned int)MAX_QUEUE_LENGTH); /* - * The cache pool sizes used by usb_buffer_alloc() (128, 512, 2048) are + * The cache pool sizes used by usb_alloc_coherent() (128, 512, 2048) are * quite bad when used with the packet sizes of this device (e.g. 280, * 520, 624). Therefore, we allocate and subdivide entire pages, using * a smaller buffer only for the last chunk. @@ -1067,8 +1067,8 @@ static int alloc_stream_buffers(struct ua101 *ua, struct ua101_stream *stream) packets = min(remaining_packets, packets_per_page); size = packets * stream->max_packet_bytes; stream->buffers[i].addr = - usb_buffer_alloc(ua->dev, size, GFP_KERNEL, - &stream->buffers[i].dma); + usb_alloc_coherent(ua->dev, size, GFP_KERNEL, + &stream->buffers[i].dma); if (!stream->buffers[i].addr) return -ENOMEM; stream->buffers[i].size = size; @@ -1088,10 +1088,10 @@ static void free_stream_buffers(struct ua101 *ua, struct ua101_stream *stream) unsigned int i; for (i = 0; i < ARRAY_SIZE(stream->buffers); ++i) - usb_buffer_free(ua->dev, - stream->buffers[i].size, - stream->buffers[i].addr, - stream->buffers[i].dma); + usb_free_coherent(ua->dev, + stream->buffers[i].size, + stream->buffers[i].addr, + stream->buffers[i].dma); } static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream, diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 11b0826b8fe..9d2274ce01d 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c @@ -985,9 +985,9 @@ static void release_urb_ctx(struct snd_urb_ctx *u) { if (u->urb) { if (u->buffer_size) - usb_buffer_free(u->subs->dev, u->buffer_size, - u->urb->transfer_buffer, - u->urb->transfer_dma); + usb_free_coherent(u->subs->dev, u->buffer_size, + u->urb->transfer_buffer, + u->urb->transfer_dma); usb_free_urb(u->urb); u->urb = NULL; } @@ -1008,8 +1008,8 @@ static void release_substream_urbs(struct snd_usb_substream *subs, int force) release_urb_ctx(&subs->dataurb[i]); for (i = 0; i < SYNC_URBS; i++) release_urb_ctx(&subs->syncurb[i]); - usb_buffer_free(subs->dev, SYNC_URBS * 4, - subs->syncbuf, subs->sync_dma); + usb_free_coherent(subs->dev, SYNC_URBS * 4, + subs->syncbuf, subs->sync_dma); subs->syncbuf = NULL; subs->nurbs = 0; } @@ -1113,8 +1113,8 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri if (!u->urb) goto out_of_memory; u->urb->transfer_buffer = - usb_buffer_alloc(subs->dev, u->buffer_size, GFP_KERNEL, - &u->urb->transfer_dma); + usb_alloc_coherent(subs->dev, u->buffer_size, GFP_KERNEL, + &u->urb->transfer_dma); if (!u->urb->transfer_buffer) goto out_of_memory; u->urb->pipe = subs->datapipe; @@ -1126,8 +1126,8 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri if (subs->syncpipe) { /* allocate and initialize sync urbs */ - subs->syncbuf = usb_buffer_alloc(subs->dev, SYNC_URBS * 4, - GFP_KERNEL, &subs->sync_dma); + subs->syncbuf = usb_alloc_coherent(subs->dev, SYNC_URBS * 4, + GFP_KERNEL, &subs->sync_dma); if (!subs->syncbuf) goto out_of_memory; for (i = 0; i < SYNC_URBS; i++) { diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c index 9e28b20cb2c..61b2d8fd033 100644 --- a/sound/usb/usbmidi.c +++ b/sound/usb/usbmidi.c @@ -1047,8 +1047,8 @@ static struct snd_rawmidi_ops snd_usbmidi_input_ops = { static void free_urb_and_buffer(struct snd_usb_midi *umidi, struct urb *urb, unsigned int buffer_length) { - usb_buffer_free(umidi->dev, buffer_length, - urb->transfer_buffer, urb->transfer_dma); + usb_free_coherent(umidi->dev, buffer_length, + urb->transfer_buffer, urb->transfer_dma); usb_free_urb(urb); } @@ -1099,8 +1099,8 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi* umidi, pipe = usb_rcvbulkpipe(umidi->dev, ep_info->in_ep); length = usb_maxpacket(umidi->dev, pipe, 0); for (i = 0; i < INPUT_URBS; ++i) { - buffer = usb_buffer_alloc(umidi->dev, length, GFP_KERNEL, - &ep->urbs[i]->transfer_dma); + buffer = usb_alloc_coherent(umidi->dev, length, GFP_KERNEL, + &ep->urbs[i]->transfer_dma); if (!buffer) { snd_usbmidi_in_endpoint_delete(ep); return -ENOMEM; @@ -1190,9 +1190,9 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi* umidi, break; } for (i = 0; i < OUTPUT_URBS; ++i) { - buffer = usb_buffer_alloc(umidi->dev, - ep->max_transfer, GFP_KERNEL, - &ep->urbs[i].urb->transfer_dma); + buffer = usb_alloc_coherent(umidi->dev, + ep->max_transfer, GFP_KERNEL, + &ep->urbs[i].urb->transfer_dma); if (!buffer) { snd_usbmidi_out_endpoint_delete(ep); return -ENOMEM; -- cgit v1.2.3-70-g09d2