fb_ddc: Allow I2C adapters without SCL read capability
Subsystems (2)
PATCH v2 1/2 fb_ddc: Allow I2C adapters without SCL read capability
i2c-algo-bit allows I2C adapters without SCL read capability to work but fb_ddc_read fails to work on them.
Fix fb_ddc_read to work with I2C adapters not capable of reading SCL.
Signed-off-by Ondrej Zary <[email protected]>
--- drivers/video/fbdev/core/fb_ddc.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-)
drivers/video/fbdev/core/fb_ddc.c +18 -10
@@ -67,13 +67,17 @@ unsigned char *fb_ddc_read(struct i2c_adapter *adapter)msleep (13 ); algo_data->setscl (algo_data->data,1 ); -for (j =0 ; j <5 ; j++) { -msleep (10 ); -if (algo_data->getscl (algo_data->data)) -break ; +if (algo_data->getscl) { +for (j =0 ; j <5 ; j++) { +msleep (10 ); +if (algo_data->getscl (algo_data->data)) +break ; + } +if (j =5 ) +continue ; + }else { +udelay (algo_data->udelay); } -if (j =5 ) -continue ; algo_data->setsda (algo_data->data,0 );msleep (15 );
@@ -89,10 +93,14 @@ unsigned char *fb_ddc_read(struct i2c_adapter *adapter)msleep (15 ); algo_data->setscl (algo_data->data,1 ); -for (j =0 ; j <10 ; j++) { -msleep (10 ); -if (algo_data->getscl (algo_data->data)) -break ; +if (algo_data->getscl) { +for (j =0 ; j <10 ; j++) { +msleep (10 ); +if (algo_data->getscl (algo_data->data)) +break ; + } + }else { +udelay (algo_data->udelay); } algo_data->setsda (algo_data->data,1 );
Signature · 1 line
Ondrej Zary
PATCH v2 2/2 tridentfb: Add DDC support
Add DDC support for Trident cards.
Tested on TGUI9440, TGUI9680, 3DImage 9750, Blade3D 9880 and Blade XP.
Signed-off-by Ondrej Zary <[email protected]>
--- drivers/video/fbdev/Kconfig | 2 + drivers/video/fbdev/tridentfb.c | 182 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 179 insertions(+), 5 deletions(-)
drivers/video/fbdev/Kconfig +2 -0
@@ -1666,6 +1666,8 @@ config FB_TRIDENT select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT + select FB_DDC + select FB_MODE_HELPERS ---help--- This is the frame buffer device driver for Trident PCI/AGP chipsets. Supported chipset families are TGUI 9440/96XX, 3DImage, Blade3D
drivers/video/fbdev/tridentfb.c +177 -5
237 lines not on this page · raw message
Signature · 1 line
Ondrej Zary
Quoted 9 lines · Ondrej Zary
i2c-algo-bit allows I2C adapters without SCL read capability to work but
fb_ddc_readfails to work on them.Fix
fb_ddc_readto work with I2C adapters not capable of reading SCL.Signed-off-by Ondrej Zary <[email protected]>--- drivers/video/fbdev/core/fb_ddc.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-)
Thanks, queued this and the 2/2 patch for 4.4.
Tomi