Re: [PATCHv6] staging/iio/adc: change the MXS touchscreen driver implementation
Hi Alexandre, On Thursday 09 January 2014 14:31:22 Alexandre Belloni wrote: > Sorry to chime in only now but it seems that this series is breaking the > touchscreen calibration on 3.13 (and -rc7 is out so it might be too > late). > > At first, I though I became a terrible clicker ;) but I found some > evidences: > > xinput_calibrator is complaining about misclicks, debug output: > DEBUG: Adding click 0 (X=105, Y=59) > DEBUG: Not adding click 1 (X=100, Y=59): within 7 pixels of previous click > DEBUG: Adding click 1 (X=696, Y=58) > DEBUG: Not adding click 2 (X=700, Y=55): within 7 pixels of previous click > DEBUG: Adding click 2 (X=103, Y=422) > DEBUG: Mis-click detected, click 3 (X=438, Y=415) not aligned with click 1 > (X=696, Y=58) or click 2 (X=103, Y=422) (threshold=15) > DEBUG: Adding click 0 (X=424, Y=411) > > Do you see the confusion ? At some point one of the coordinates is not > updated. Successful calibration with 3.12.6 gives: > DEBUG: Adding click 0 (X=126, Y=405) > DEBUG: Adding click 1 (X=684, Y=399) > DEBUG: Adding click 2 (X=128, Y=77) > DEBUG: Adding click 3 (X=683, Y=77) > > > With ts_calibrate: > xres = 800, yres = 480 > Took 1 samples... > Top left : X = 435 Y = 3572 > Took 2 samples... > Top right : X = 2094 Y = 3553 > Took 2 samples... > Bot right : X = 2939 Y = 2077 > Took 2 samples... > Bot left : X = 2060 Y = 644 > Took 2 samples... > Center : X = 1279 Y = 1346 > > We experience the same thing, when changing position on an axis, we get > an average between the previous and the new position (probably because > we got 2 samples): > - Top Left is ok > - Top right is almost ok: X should be around 3500/3700 > - Bot right is starting to get really wrong: X is getting better (it >should still be around 3500/3700) but Y should be quite lower > - Bot left: Y is ok but X should be lower > - Center is completely wrong, both values should be around 2000 > > Last test with evtest which is always difficult because it outputs a lot > of debug. Two separate touchs, bottom left and then top right (note that > this is with fsl,ave-ctrl = <8>;): > > Event: time 1389210862.451000, type 3 (Absolute), code 0 (X), value 2183 > Event: time 1389210862.451000, type 3 (Absolute), code 1 (Y), value 720 > Event: time 1389210862.451000, type 3 (Absolute), code 24 (Pressure), value 6 > Event: time 1389210862.451000, type 1 (Key), code 330 (Touch), value 1 > Event: time 1389210862.451000, -- Report Sync > Event: time 1389210862.477721, type 3 (Absolute), code 0 (X), value 448 > Event: time 1389210862.477721, type 3 (Absolute), code 1 (Y), value 667 > Event: time 1389210862.477721, type 3 (Absolute), code 24 (Pressure), value > 595 > Event: time 1389210862.477721, -- Report Sync > Event: time 1389210862.504718, type 3 (Absolute), code 0 (X), value 434 > Event: time 1389210862.504718, type 3 (Absolute), code 1 (Y), value 704 > Event: time 1389210862.504718, type 3 (Absolute), code 24 (Pressure), value > 580 > Event: time 1389210862.504718, -- Report Sync > Event: time 1389210862.536688, type 1 (Key), code 330 (Touch), value 0 > Event: time 1389210862.536688, -- Report Sync > Event: time 1389210863.359697, type 3 (Absolute), code 0 (X), value 432 > Event: time 1389210863.359697, type 3 (Absolute), code 1 (Y), value 726 > Event: time 1389210863.359697, type 3 (Absolute), code 24 (Pressure), value > 210 > Event: time 1389210863.359697, type 1 (Key), code 330 (Touch), value 1 > Event: time 1389210863.359697, -- Report Sync > Event: time 1389210863.391687, type 1 (Key), code 330 (Touch), value 0 > Event: time 1389210863.391687, -- Report Sync > > We get 3 reports for bottom left, then pen up, then one report for top > right that is almost exactly the same a bottom left ! > > Output from 3.12: > Event: time 1389210022.146809, type 3 (Absolute), code 0 (X), value 286 > Event: time 1389210022.146809, type 3 (Absolute), code 1 (Y), value 504 > Event: time 1389210022.146809, type 3 (Absolute), code 24 (Pressure), value > 3045 > Event: time 1389210022.146809, type 1 (Key), code 330 (Touch), value 1 > Event: time 1389210022.146809, -- Report Sync > Event: time 1389210022.166830, type 3 (Absolute), code 0 (X), value 256 > Event: time 1389210022.166830, type 3 (Absolute), code 1 (Y), value 489 > Event: time 1389210022.166830, type 3 (Absolute), code 24 (Pressure), value > 3033 > Event: time 1389210022.166830, -- Report Sync > Event: time 1389210022.186812, type 3 (Absolute), code 24 (Pressure), value 0 > Event: time 1389210022.186812, type 1 (Key), code 330 (Touch), value 0 > Event: time 1389210022.186812, -- Report Sync > Event: time 1389210025.196808, type 3 (Absolute), code 0 (X), value 3812 > Event: time 1389210025.196808, type 3 (Absolute), code 1 (Y), value 3637 > Event: time 1
Re: [PATCH 1/1] Drivers: hv: Implement the file copy service
On Thu, Jan 09, 2014 at 09:05:05PM +, KY Srinivasan wrote: > > > > We've had this discussion before where you urge me to trust the host... > > I am just implementing the protocol specification given by the host. If I > cannot trust the > specified protocol, I am not sure what else can be done here. I'm sorry I got too upset and we're not communicating correctly. Anyway, looking at the code, there is actually locking in process_chn_event() which protect ->fcopy_context. It's still sucky to only store the last message in the queue but that's ok. +static int fcopy_handle_handshake(int op) +{ + int ret = 1; + + pr_info("FCP: user-mode registering done.\n"); + fcopy_transaction.active = false; + set_channel_read_state((struct vmbus_channel *) + fcopy_transaction.fcopy_context, ^^^ Dereferenced inside the call to set_channel_read_state() + true); + + if (fcopy_transaction.fcopy_context) ^^^ Checked for NULL. + hv_fcopy_onchannelcallback(fcopy_transaction.fcopy_context); + + in_hand_shake = false; + return ret; +} regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: comedi: amcc_s5933: "no space before tabs" coding style fixes.
On 2014-01-09 22:58, Michal Kwiatkowski wrote: Fixed a coding style issues. Signed-off-by: Michal Kwiatkowski --- drivers/staging/comedi/drivers/amcc_s5933.h |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/amcc_s5933.h b/drivers/staging/comedi/drivers/amcc_s5933.h index b810d5f..2ba7364 100644 --- a/drivers/staging/comedi/drivers/amcc_s5933.h +++ b/drivers/staging/comedi/drivers/amcc_s5933.h @@ -145,12 +145,12 @@ #define AINT_READ_COMPL 0x8000 #define AINT_WRITE_COMPL 0x4000 -#define AINT_OMB_ENABLE0x1000 -#define AINT_OMB_SELECT0x0c00 +#define AINT_OMB_ENABLE0x1000 +#define AINT_OMB_SELECT0x0c00 #define AINT_OMB_BYTE 0x0300 -#define AINT_IMB_ENABLE0x0010 -#define AINT_IMB_SELECT0x000c +#define AINT_IMB_ENABLE0x0010 +#define AINT_IMB_SELECT0x000c #define AINT_IMB_BYTE 0x0003 /* these are bits from various different registers, needs cleanup XXX */ Harmless. (Good!) Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] comedi: Humusoft MF634 and MF624 DAQ cards driver
On 2014-01-09 22:46, Rostislav Lisovy wrote: This patch adds Comedi driver for Humusoft MF634 (PCIe) and MF624 (PCI) data acquisition cards. The legacy card Humusoft MF614 is not supported. More info about the cards may be found at http://humusoft.cz/produkty/datacq/ The driver was tested with both cards. Everything seems to work properly. Just the basic functionality of the card (DIO, ADC, DAC) is supported by this driver. Signed-off-by: Rostislav Lisovy --- create mode 100644 drivers/staging/comedi/drivers/mf6x4.c diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig index bfa27e7..89e25b4 100644 --- a/drivers/staging/comedi/Kconfig +++ b/drivers/staging/comedi/Kconfig @@ -884,6 +884,12 @@ config COMEDI_GSC_HPDI To compile this driver as a module, choose M here: the module will be called gsc_hpdi. +config COMEDI_MF6X4 + tristate "Humusoft MF634 and MF624 DAQ Card support" + ---help--- + This driver supports both Humusoft MF634 and MF624 Data acquisition + cards. The legacy Humusoft MF614 card is not supported. + config COMEDI_ICP_MULTI tristate "Inova ICP_MULTI support" ---help--- diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index 143be80..161bdd2 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -410,6 +410,7 @@ void comedi_driver_unregister(struct comedi_driver *); #define PCI_VENDOR_ID_IOTECH 0x1616 #define PCI_VENDOR_ID_CONTEC 0x1221 #define PCI_VENDOR_ID_RTD 0x1435 +#define PCI_VENDOR_ID_HUMUSOFT 0x186c struct pci_dev; struct pci_driver; diff --git a/drivers/staging/comedi/drivers/Makefile b/drivers/staging/comedi/drivers/Makefile index 94cbd26..9e979a9 100644 --- a/drivers/staging/comedi/drivers/Makefile +++ b/drivers/staging/comedi/drivers/Makefile @@ -110,6 +110,7 @@ obj-$(CONFIG_COMEDI_NI_PCIMIO) += ni_pcimio.o obj-$(CONFIG_COMEDI_RTD520)+= rtd520.o obj-$(CONFIG_COMEDI_S626) += s626.o obj-$(CONFIG_COMEDI_SSV_DNP) += ssv_dnp.o +obj-$(CONFIG_COMEDI_MF6X4) += mf6x4.o # Comedi PCMCIA drivers obj-$(CONFIG_COMEDI_CB_DAS16_CS) += cb_das16_cs.o diff --git a/drivers/staging/comedi/drivers/mf6x4.c b/drivers/staging/comedi/drivers/mf6x4.c new file mode 100644 index 000..81b78e0 --- /dev/null +++ b/drivers/staging/comedi/drivers/mf6x4.c @@ -0,0 +1,354 @@ +/* + * comedi/drivers/mf6x4.c + * Driver for Humusoft MF634 and MF624 Data acquisition cards + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 2000 David A. Schleef + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +/* + * Driver: mf6x4 + * Description: Humusoft MF634 and MF624 Data acquisition card driver + * Devices: Humusoft MF634, Humusoft MF624 + * Author: Rostislav Lisovy + * Status: works + * Updated: + * Configuration Options: none + */ + +#include +#include +#include +#include "../comedidev.h" + +/* Registers present in BAR0 memory region */ +#define MF624_GPIOC_R 0x54 + +#define MF6X4_GPIOC_EOLC /* End Of Last Conversion */ (1 << 17) +#define MF6X4_GPIOC_LDAC /* Load DACs */ (1 << 23) +#define MF6X4_GPIOC_DACEN (1 << 26) + +/* BAR1 registers */ +#define MF6X4_DIN_R0x10 +#define MF6X4_DIN_M0xff +#define MF6X4_DOUT_R 0x10 +#define MF6X4_DOUT_M 0xff + +#define MF6X4_ADSTART_R0x20 +#define MF6X4_ADDATA_R 0x00 +#define MF6X4_ADCTRL_R 0x00 +#define MF6X4_ADCTRL_M 0xff + +#define MF6X4_DA0_R0x20 +#define MF6X4_DA1_R0x22 +#define MF6X4_DA2_R0x24 +#define MF6X4_DA3_R0x26 +#define MF6X4_DA4_R0x28 +#define MF6X4_DA5_R0x2a +#define MF6X4_DA6_R0x2c +#define MF6X4_DA7_R0x2e +/* Map DAC cahnnel id to real HW-dependent offset value */ +#define MF6X4_DAC_R(x) (0x20 + ((x) * 2)) +#de
Re: [PATCH] Staging: comedi: fix spacing coding style issue in 8255.c.
On 2014-01-10 03:59, Chase Southwood wrote: This patch for 8255.c fixes a spacing warning found by checkpatch.pl. Signed-off-by: Chase Southwood --- drivers/staging/comedi/drivers/8255.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/8255.c b/drivers/staging/comedi/drivers/8255.c index b4009e8..48817f0 100644 --- a/drivers/staging/comedi/drivers/8255.c +++ b/drivers/staging/comedi/drivers/8255.c @@ -94,7 +94,7 @@ I/O port base address can be found in the output of 'lspci -v'. struct subdev_8255_private { unsigned long iobase; - int (*io) (int, int, int, unsigned long); + int (*io)(int, int, int, unsigned long); }; static int subdev_8255_io(int dir, int port, int data, unsigned long iobase) @@ -262,7 +262,7 @@ static int subdev_8255_cancel(struct comedi_device *dev, } int subdev_8255_init(struct comedi_device *dev, struct comedi_subdevice *s, -int (*io) (int, int, int, unsigned long), +int (*io)(int, int, int, unsigned long), unsigned long iobase) { struct subdev_8255_private *spriv; @@ -289,7 +289,7 @@ int subdev_8255_init(struct comedi_device *dev, struct comedi_subdevice *s, EXPORT_SYMBOL_GPL(subdev_8255_init); int subdev_8255_init_irq(struct comedi_device *dev, struct comedi_subdevice *s, -int (*io) (int, int, int, unsigned long), +int (*io)(int, int, int, unsigned long), unsigned long iobase) { int ret; Harmless. (Good!) Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/3] mfd: Add realtek USB card reader driver
On Mon, 2013-12-23 at 17:52 +0800, rogera...@realtek.com wrote: > From: Roger Tseng > > Realtek USB card reader provides a channel to transfer command or data to > flash > memory cards. This driver exports host instances for mmc and memstick > subsystems > and handles basic works. Thank you for writing this driver. A few remarks about the code and sorry for the delay in reviewing. > Signed-off-by: Roger Tseng > +static void rtsx_usb_sg_timed_out(unsigned long data) > +{ > + struct rtsx_ucr *ucr = (struct rtsx_ucr *)data; > + > + dev_dbg(&ucr->pusb_intf->dev, "%s: sg transfer timed out", __func__); > + usb_sg_cancel(&ucr->current_sg); > + > + /* we know the cancellation is caused by time-out */ How do you know? You know it won't complete here, but it may have completed for another reason. > + ucr->current_sg.status = -ETIMEDOUT; > +} > +static int rtsx_usb_seq_write_register(struct rtsx_ucr *ucr, > + u16 addr, u16 len, u8 *data) > +{ > + u16 cmd_len = len + 12; > + > + if (data == NULL) > + return -EINVAL; > + > + cmd_len = (cmd_len <= CMD_BUF_LEN) ? cmd_len : CMD_BUF_LEN; > + > + if (cmd_len % 4) > + cmd_len += (4 - cmd_len % 4); > + > + > + ucr->cmd_buf[0] = 'R'; > + ucr->cmd_buf[1] = 'T'; > + ucr->cmd_buf[2] = 'C'; > + ucr->cmd_buf[3] = 'R'; > + ucr->cmd_buf[PACKET_TYPE] = SEQ_WRITE; > + ucr->cmd_buf[5] = (u8)(len >> 8); > + ucr->cmd_buf[6] = (u8)len; Please use the macros the kernel provides. > + ucr->cmd_buf[STAGE_FLAG] = 0; > + ucr->cmd_buf[8] = (u8)(addr >> 8); > + ucr->cmd_buf[9] = (u8)addr; Likewise. > + > + memcpy(ucr->cmd_buf + 12, data, len); > + > + return rtsx_usb_transfer_data(ucr, > + usb_sndbulkpipe(ucr->pusb_dev, EP_BULK_OUT), > + ucr->cmd_buf, cmd_len, 0, NULL, 100); > +} > +int rtsx_usb_send_cmd(struct rtsx_ucr *ucr, u8 flag, int timeout) > +{ > + int ret; > + > + ucr->cmd_buf[CNT_H] = (u8)(ucr->cmd_idx >> 8); > + ucr->cmd_buf[CNT_L] = (u8)(ucr->cmd_idx); > + ucr->cmd_buf[STAGE_FLAG] = flag; > + > + ret = rtsx_usb_transfer_data(ucr, > + usb_sndbulkpipe(ucr->pusb_dev, EP_BULK_OUT), > + ucr->cmd_buf, ucr->cmd_idx * 4 + CMD_OFFSET, > + 0, NULL, timeout); > + if (ret) { Even for fatal errors? > + /* clear HW error*/ > + rtsx_usb_ep0_write_register(ucr, SFSM_ED, 0xf8, 0xf8); > + return ret; > + } > + > + return 0; > +} > +EXPORT_SYMBOL_GPL(rtsx_usb_send_cmd); > +#ifdef CONFIG_PM > +static int rtsx_usb_suspend(struct usb_interface *intf, pm_message_t message) > +{ > + struct rtsx_ucr *ucr = > + (struct rtsx_ucr *)usb_get_intfdata(intf); > + > + dev_dbg(&intf->dev, "%s called with pm message 0x%04u\n", > + __func__, message.event); > + > + mutex_lock(&ucr->dev_mutex); > + rtsx_usb_turn_off_led(ucr); > + mutex_unlock(&ucr->dev_mutex); > + return 0; > +} > + > +static int rtsx_usb_resume(struct usb_interface *intf) > +{ > + return 0; Don't you want to turn the LED back on? > +} > +static struct usb_driver rtsx_usb_driver = { > + .name = DRV_NAME_RTSX_USB, > + .probe =rtsx_usb_probe, > + .disconnect = rtsx_usb_disconnect, > + .suspend = rtsx_usb_suspend, > + .resume = rtsx_usb_resume, > + .reset_resume = rtsx_usb_reset_resume, > + .pre_reset =rtsx_usb_pre_reset, > + .post_reset = rtsx_usb_post_reset, > + .id_table = rtsx_usb_usb_ids, > + .supports_autosuspend = 1, This is good, but what do you need remote wakeup for? > + .soft_unbind = 1, > +}; > + ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/3] mmc: Add realtek USB sdmmc host driver
On Mon, 2013-12-23 at 17:52 +0800, rogera...@realtek.com wrote: > From: Roger Tseng > > Realtek USB SD/MMC host driver provides mmc host support based on the Realtek > USB card reader MFD driver. > > Signed-off-by: Roger Tseng > +#ifdef DEBUG Dynamic debugging would be nice. > +static void sd_print_debug_regs(struct rtsx_usb_sdmmc *host) > +{ > + struct rtsx_ucr *ucr = host->ucr; > + u8 val = 0; > + > + rtsx_usb_ep0_read_register(ucr, SD_STAT1, &val); > + dev_dbg(sdmmc_dev(host), "SD_STAT1: 0x%x\n", val); > + rtsx_usb_ep0_read_register(ucr, SD_STAT2, &val); > + dev_dbg(sdmmc_dev(host), "SD_STAT2: 0x%x\n", val); > + rtsx_usb_ep0_read_register(ucr, SD_BUS_STAT, &val); > + dev_dbg(sdmmc_dev(host), "SD_BUS_STAT: 0x%x\n", val); > +} > +#else > +#define sd_print_debug_regs(host) > +#endif /* DEBUG */ > + Regards Oliver ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RFC PATCH v2] staging: imx-hdmi: use rx sense status for plug detection if hpd is unreliable
Due to the voltage divider on the HPD line, the HDMI connector on imx6q-sabrelite doesn't reliably detect connected DVI monitors. This patch allows to use the RX_SENSE0 signal as a workaround when enabled by a boolean device tree property 'hpd-unreliable'. Signed-off-by: Philipp Zabel --- This patch is based on Russell's recent 46-patch imx-drm cleanup series. Changes since v1: - Store the status and polarity bits in struct imx_hdmi --- drivers/staging/imx-drm/imx-hdmi.c | 36 ++-- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/staging/imx-drm/imx-hdmi.c index fb3177d..62cb531 100644 --- a/drivers/staging/imx-drm/imx-hdmi.c +++ b/drivers/staging/imx-drm/imx-hdmi.c @@ -140,6 +140,9 @@ struct imx_hdmi { struct regmap *regmap; struct i2c_adapter *ddc; void __iomem *regs; + u8 sink_detect_polarity; + u8 sink_detect_status; + u8 sink_detect_mask; unsigned int sample_rate; int ratio; @@ -1317,10 +1320,10 @@ static int imx_hdmi_fb_registered(struct imx_hdmi *hdmi) HDMI_PHY_I2CM_CTLINT_ADDR); /* enable cable hot plug irq */ - hdmi_writeb(hdmi, (u8)~HDMI_PHY_HPD, HDMI_PHY_MASK0); + hdmi_writeb(hdmi, hdmi->sink_detect_mask, HDMI_PHY_MASK0); /* Clear Hotplug interrupts */ - hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD, HDMI_IH_PHY_STAT0); + hdmi_writeb(hdmi, hdmi->sink_detect_status, HDMI_IH_PHY_STAT0); return 0; } @@ -1392,6 +1395,7 @@ static enum drm_connector_status imx_hdmi_connector_detect(struct drm_connector { struct imx_hdmi *hdmi = container_of(connector, struct imx_hdmi, connector); + return hdmi->connector_status; } @@ -1530,18 +1534,20 @@ static irqreturn_t imx_hdmi_irq(int irq, void *dev_id) phy_int_pol = hdmi_readb(hdmi, HDMI_PHY_POL0); - if (intr_stat & HDMI_IH_PHY_STAT0_HPD) { - if (phy_int_pol & HDMI_PHY_HPD) { + if (intr_stat & hdmi->sink_detect_status) { + int pol_bit = hdmi->sink_detect_polarity; + + if (phy_int_pol & pol_bit) { dev_dbg(hdmi->dev, "EVENT=plugin\n"); - hdmi_modb(hdmi, 0, HDMI_PHY_HPD, HDMI_PHY_POL0); + hdmi_modb(hdmi, 0, pol_bit, HDMI_PHY_POL0); hdmi->connector_status = connector_status_connected; imx_hdmi_poweron(hdmi); } else { dev_dbg(hdmi->dev, "EVENT=plugout\n"); - hdmi_modb(hdmi, HDMI_PHY_HPD, HDMI_PHY_HPD, HDMI_PHY_POL0); + hdmi_modb(hdmi, pol_bit, pol_bit, HDMI_PHY_POL0); hdmi->connector_status = connector_status_disconnected; imx_hdmi_poweroff(hdmi); @@ -1550,7 +1556,7 @@ static irqreturn_t imx_hdmi_irq(int irq, void *dev_id) } hdmi_writeb(hdmi, intr_stat, HDMI_IH_PHY_STAT0); - hdmi_writeb(hdmi, ~HDMI_IH_PHY_STAT0_HPD, HDMI_IH_MUTE_PHY_STAT0); + hdmi_writeb(hdmi, ~hdmi->sink_detect_status, HDMI_IH_MUTE_PHY_STAT0); return IRQ_HANDLED; } @@ -1702,14 +1708,24 @@ static int imx_hdmi_bind(struct device *dev, struct device *master, void *data) */ hdmi_init_clk_regenerator(hdmi); + hdmi->sink_detect_status = HDMI_IH_PHY_STAT0_HPD; + hdmi->sink_detect_polarity = HDMI_PHY_HPD; + hdmi->sink_detect_mask = ~HDMI_PHY_HPD; + + if (of_property_read_bool(np, "hpd-unreliable")) { + hdmi->sink_detect_status = HDMI_IH_PHY_STAT0_RX_SENSE0; + hdmi->sink_detect_polarity = HDMI_PHY_RX_SENSE0; + hdmi->sink_detect_mask = ~HDMI_PHY_RX_SENSE0; + } + /* * Configure registers related to HDMI interrupt * generation before registering IRQ. */ - hdmi_writeb(hdmi, HDMI_PHY_HPD, HDMI_PHY_POL0); + hdmi_writeb(hdmi, hdmi->sink_detect_polarity, HDMI_PHY_POL0); /* Clear Hotplug interrupts */ - hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD, HDMI_IH_PHY_STAT0); + hdmi_writeb(hdmi, hdmi->sink_detect_status, HDMI_IH_PHY_STAT0); ret = imx_hdmi_fb_registered(hdmi); if (ret) @@ -1720,7 +1736,7 @@ static int imx_hdmi_bind(struct device *dev, struct device *master, void *data) goto err_iahb; /* Unmute interrupts */ - hdmi_writeb(hdmi, ~HDMI_IH_PHY_STAT0_HPD, HDMI_IH_MUTE_PHY_STAT0); + hdmi_writeb(hdmi, ~hdmi->sink_detect_status, HDMI_IH_MUTE_PHY_STAT0); ret = snd_dw_hdmi_probe(&hdmi->audio, dev, hdmi->regs, irq, hdmi); if (ret) -- 1.8.5.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC PATCH v2] staging: imx-hdmi: use rx sense status for plug detection if hpd is unreliable
On Fri, Jan 10, 2014 at 03:22:24PM +0100, Philipp Zabel wrote: > Due to the voltage divider on the HPD line, the HDMI connector on > imx6q-sabrelite doesn't reliably detect connected DVI monitors. > This patch allows to use the RX_SENSE0 signal as a workaround when > enabled by a boolean device tree property 'hpd-unreliable'. Yay, much nicer, easier to read, and smaller, thanks. I'll add it to the series. I don't think we've had David Airlie's eyes on the series yet (but then I think he's rather Rob Clark looked at non-x86 DRM stuff). Also I've yet to hear back from Greg wrt the component stuff, so I suspect this series won't be making this merge window. -- FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up. Estimation in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad. Estimate before purchase was "up to 13.2Mbit". ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RFC 26/46] drivers/base: provide an infrastructure for componentised subsystems
On Thu, Jan 02, 2014 at 07:10:55PM -0800, Greg Kroah-Hartman wrote: > On Thu, Jan 02, 2014 at 09:27:58PM +, Russell King wrote: > > Subsystems such as ALSA, DRM and others require a single card-level > > device structure to represent a subsystem. However, firmware tends to > > describe the individual devices and the connections between them. > > > > Therefore, we need a way to gather up the individual component devices > > together, and indicate when we have all the component devices. > > > > We do this in DT by providing a "superdevice" node which specifies > > the components, eg: > > > > imx-drm { > > compatible = "fsl,drm"; > > crtcs = <&ipu1>; > > connectors = <&hdmi>; > > }; > > > > The superdevice is declared into the component support, along with the > > subcomponents. The superdevice receives callbacks to locate the > > subcomponents, and identify when all components are present. At this > > point, we bind the superdevice, which causes the appropriate subsystem > > to be initialised in the conventional way. > > > > When any of the components or superdevice are removed from the system, > > we unbind the superdevice, thereby taking the subsystem down. > > This sounds a lot like the "containers" code that Rafael just submitted > and I acked for 3.14. Look at the lkml post: > Subject: [PATCH 2/2] ACPI / hotplug / driver core: Handle containers in > a special way > Message-ID: <1991202.gilw172...@vostro.rjw.lan> > > And see if that could possibly be used instead? Greg, Not sure if you saw the outcome to your comment above. My conclusion was: "Yes, I'm coming to that conclusion as well. It looks like your "containers" aren't about collecting up several individual component devices into one super-device and probing the appropriate subsystem when all components are known. "Confused why Greg is pointing me at your patches." Does this mean you're happy with the patch? Thanks. -- FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up. Estimation in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad. Estimate before purchase was "up to 13.2Mbit". ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RFC 26/46] drivers/base: provide an infrastructure for componentised subsystems
On Fri, Jan 10, 2014 at 07:07:02AM -0800, Greg Kroah-Hartman wrote: > On Fri, Jan 10, 2014 at 02:54:44PM +, Russell King - ARM Linux wrote: > > Greg, > > > > Not sure if you saw the outcome to your comment above. My conclusion > > was: > > > > "Yes, I'm coming to that conclusion as well. It looks like your > > "containers" > > aren't about collecting up several individual component devices into one > > super-device and probing the appropriate subsystem when all components are > > known. > > > > "Confused why Greg is pointing me at your patches." > > Ah, sorry, I missed that in my "catch up on 2 weeks of email" flood. > > > Does this mean you're happy with the patch? > > Well, I will not object to it on the grounds of it being a duplicate of > Rafael's work now :) > > I'll be glad to consider it on its own, when you feel the series is > ready to be submitted. I'll sort out a new set of patches today, along with a branch to pull if you wish to take them that way. Thanks. -- FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up. Estimation in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad. Estimate before purchase was "up to 13.2Mbit". ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RFC 26/46] drivers/base: provide an infrastructure for componentised subsystems
On Fri, Jan 10, 2014 at 02:54:44PM +, Russell King - ARM Linux wrote: > On Thu, Jan 02, 2014 at 07:10:55PM -0800, Greg Kroah-Hartman wrote: > > On Thu, Jan 02, 2014 at 09:27:58PM +, Russell King wrote: > > > Subsystems such as ALSA, DRM and others require a single card-level > > > device structure to represent a subsystem. However, firmware tends to > > > describe the individual devices and the connections between them. > > > > > > Therefore, we need a way to gather up the individual component devices > > > together, and indicate when we have all the component devices. > > > > > > We do this in DT by providing a "superdevice" node which specifies > > > the components, eg: > > > > > > imx-drm { > > > compatible = "fsl,drm"; > > > crtcs = <&ipu1>; > > > connectors = <&hdmi>; > > > }; > > > > > > The superdevice is declared into the component support, along with the > > > subcomponents. The superdevice receives callbacks to locate the > > > subcomponents, and identify when all components are present. At this > > > point, we bind the superdevice, which causes the appropriate subsystem > > > to be initialised in the conventional way. > > > > > > When any of the components or superdevice are removed from the system, > > > we unbind the superdevice, thereby taking the subsystem down. > > > > This sounds a lot like the "containers" code that Rafael just submitted > > and I acked for 3.14. Look at the lkml post: > > Subject: [PATCH 2/2] ACPI / hotplug / driver core: Handle containers in > > a special way > > Message-ID: <1991202.gilw172...@vostro.rjw.lan> > > > > And see if that could possibly be used instead? > > Greg, > > Not sure if you saw the outcome to your comment above. My conclusion > was: > > "Yes, I'm coming to that conclusion as well. It looks like your "containers" > aren't about collecting up several individual component devices into one > super-device and probing the appropriate subsystem when all components are > known. > > "Confused why Greg is pointing me at your patches." Ah, sorry, I missed that in my "catch up on 2 weeks of email" flood. > Does this mean you're happy with the patch? Well, I will not object to it on the grounds of it being a duplicate of Rafael's work now :) I'll be glad to consider it on its own, when you feel the series is ready to be submitted. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/3] staging: drm/imx: set second plane base address
From: Philipp Zabel Even though we do not enable the hardware double buffering feature right now, set the second base address pointer (EBA1) as well to increase robustness. Signed-off-by: Philipp Zabel Signed-off-by: Lucas Stach --- drivers/staging/imx-drm/ipuv3-plane.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/imx-drm/ipuv3-plane.c b/drivers/staging/imx-drm/ipuv3-plane.c index d97454a0dffd..685411ce6e39 100644 --- a/drivers/staging/imx-drm/ipuv3-plane.c +++ b/drivers/staging/imx-drm/ipuv3-plane.c @@ -64,6 +64,7 @@ int ipu_plane_set_base(struct ipu_plane *ipu_plane, struct drm_framebuffer *fb, { struct ipu_ch_param __iomem *cpmem; struct drm_gem_cma_object *cma_obj; + unsigned long eba; cma_obj = drm_fb_cma_get_gem_obj(fb, 0); if (!cma_obj) { @@ -76,8 +77,10 @@ int ipu_plane_set_base(struct ipu_plane *ipu_plane, struct drm_framebuffer *fb, cpmem = ipu_get_cpmem(ipu_plane->ipu_ch); ipu_cpmem_set_stride(cpmem, fb->pitches[0]); - ipu_cpmem_set_buffer(cpmem, 0, cma_obj->paddr + fb->offsets[0] + -fb->pitches[0] * y + x); + + eba = cma_obj->paddr + fb->offsets[0] + fb->pitches[0] * y + x; + ipu_cpmem_set_buffer(cpmem, 0, eba); + ipu_cpmem_set_buffer(cpmem, 1, eba); return 0; } -- 1.8.5.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/3] imx-drm crtc/plane offset fixes
These patches fix the issue of frame buffer offsets being forgotten during crtc pageflip. Also we set the second buffer address. v2: proper changelogs, no functional change Lucas Stach (2): staging: drm/imx: handle framebuffer offsets correctly staging: drm/imx: don't drop crtc offsets when doing pageflip Philipp Zabel (1): staging: drm/imx: set second plane base address drivers/staging/imx-drm/ipuv3-crtc.c | 3 ++- drivers/staging/imx-drm/ipuv3-plane.c | 12 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) -- 1.8.5.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/3] staging: drm/imx: don't drop crtc offsets when doing pageflip
CRTC offsets are only set with the initial modeset, any subseqent pageflips assume them to be kept the same, so we need to remember the current state until another modeset changes it. Signed-off-by: Philipp Zabel Signed-off-by: Lucas Stach --- drivers/staging/imx-drm/ipuv3-crtc.c | 3 ++- drivers/staging/imx-drm/ipuv3-plane.c | 4 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/staging/imx-drm/ipuv3-crtc.c b/drivers/staging/imx-drm/ipuv3-crtc.c index ce6ba987ec91..22be104fbda9 100644 --- a/drivers/staging/imx-drm/ipuv3-crtc.c +++ b/drivers/staging/imx-drm/ipuv3-crtc.c @@ -218,7 +218,8 @@ static irqreturn_t ipu_irq_handler(int irq, void *dev_id) if (ipu_crtc->newfb) { ipu_crtc->newfb = NULL; - ipu_plane_set_base(ipu_crtc->plane[0], ipu_crtc->base.fb, 0, 0); + ipu_plane_set_base(ipu_crtc->plane[0], ipu_crtc->base.fb, + ipu_crtc->plane[0]->x, ipu_crtc->plane[0]->y); ipu_crtc_handle_pageflip(ipu_crtc); } diff --git a/drivers/staging/imx-drm/ipuv3-plane.c b/drivers/staging/imx-drm/ipuv3-plane.c index 2ef95162b3e9..34b642a12f8b 100644 --- a/drivers/staging/imx-drm/ipuv3-plane.c +++ b/drivers/staging/imx-drm/ipuv3-plane.c @@ -83,6 +83,10 @@ int ipu_plane_set_base(struct ipu_plane *ipu_plane, struct drm_framebuffer *fb, ipu_cpmem_set_buffer(cpmem, 0, eba); ipu_cpmem_set_buffer(cpmem, 1, eba); + /* cache offsets for subsequent pageflips */ + ipu_plane->x = x; + ipu_plane->y = y; + return 0; } -- 1.8.5.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/3] staging: drm/imx: handle framebuffer offsets correctly
We didn't take the pixel format into account, so x-direction offsets were off by a factor of 2 or 4 for 16bpp and 32bpp framebuffers. Signed-off-by: Philipp Zabel Signed-off-by: Lucas Stach --- drivers/staging/imx-drm/ipuv3-plane.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/imx-drm/ipuv3-plane.c b/drivers/staging/imx-drm/ipuv3-plane.c index 685411ce6e39..2ef95162b3e9 100644 --- a/drivers/staging/imx-drm/ipuv3-plane.c +++ b/drivers/staging/imx-drm/ipuv3-plane.c @@ -78,7 +78,8 @@ int ipu_plane_set_base(struct ipu_plane *ipu_plane, struct drm_framebuffer *fb, cpmem = ipu_get_cpmem(ipu_plane->ipu_ch); ipu_cpmem_set_stride(cpmem, fb->pitches[0]); - eba = cma_obj->paddr + fb->offsets[0] + fb->pitches[0] * y + x; + eba = cma_obj->paddr + fb->offsets[0] + + fb->pitches[0] * y + (fb->bits_per_pixel >> 3) * x; ipu_cpmem_set_buffer(cpmem, 0, eba); ipu_cpmem_set_buffer(cpmem, 1, eba); -- 1.8.5.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RFC 26/46] drivers/base: provide an infrastructure for componentised subsystems
On Fri, Jan 10, 2014 at 03:11:23PM +, Russell King - ARM Linux wrote: > On Fri, Jan 10, 2014 at 07:07:02AM -0800, Greg Kroah-Hartman wrote: > > On Fri, Jan 10, 2014 at 02:54:44PM +, Russell King - ARM Linux wrote: > > > Greg, > > > > > > Not sure if you saw the outcome to your comment above. My conclusion > > > was: > > > > > > "Yes, I'm coming to that conclusion as well. It looks like your > > > "containers" > > > aren't about collecting up several individual component devices into one > > > super-device and probing the appropriate subsystem when all components are > > > known. > > > > > > "Confused why Greg is pointing me at your patches." > > > > Ah, sorry, I missed that in my "catch up on 2 weeks of email" flood. > > > > > Does this mean you're happy with the patch? > > > > Well, I will not object to it on the grounds of it being a duplicate of > > Rafael's work now :) > > > > I'll be glad to consider it on its own, when you feel the series is > > ready to be submitted. > > I'll sort out a new set of patches today, along with a branch to pull if > you wish to take them that way. It's too late for 3.14, as my tree is now closed for that because 3.13 should be out this weekend. But I'll be glad to queue them up after 3.14-rc1 is out. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RFC 26/46] drivers/base: provide an infrastructure for componentised subsystems
On Fri, Jan 10, 2014 at 07:35:30AM -0800, Greg Kroah-Hartman wrote: > On Fri, Jan 10, 2014 at 03:11:23PM +, Russell King - ARM Linux wrote: > > On Fri, Jan 10, 2014 at 07:07:02AM -0800, Greg Kroah-Hartman wrote: > > > On Fri, Jan 10, 2014 at 02:54:44PM +, Russell King - ARM Linux wrote: > > > > Greg, > > > > > > > > Not sure if you saw the outcome to your comment above. My conclusion > > > > was: > > > > > > > > "Yes, I'm coming to that conclusion as well. It looks like your > > > > "containers" > > > > aren't about collecting up several individual component devices into one > > > > super-device and probing the appropriate subsystem when all components > > > > are > > > > known. > > > > > > > > "Confused why Greg is pointing me at your patches." > > > > > > Ah, sorry, I missed that in my "catch up on 2 weeks of email" flood. > > > > > > > Does this mean you're happy with the patch? > > > > > > Well, I will not object to it on the grounds of it being a duplicate of > > > Rafael's work now :) > > > > > > I'll be glad to consider it on its own, when you feel the series is > > > ready to be submitted. > > > > I'll sort out a new set of patches today, along with a branch to pull if > > you wish to take them that way. > > It's too late for 3.14, as my tree is now closed for that because 3.13 > should be out this weekend. But I'll be glad to queue them up after > 3.14-rc1 is out. That's rather annoying... I'll not put effort into this for a few months then. -- FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up. Estimation in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad. Estimate before purchase was "up to 13.2Mbit". ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RFC 26/46] drivers/base: provide an infrastructure for componentised subsystems
On Fri, Jan 10, 2014 at 07:35:30AM -0800, Greg Kroah-Hartman wrote: > > I'll sort out a new set of patches today, along with a branch to pull if > > you wish to take them that way. > > It's too late for 3.14, as my tree is now closed for that because 3.13 > should be out this weekend. But I'll be glad to queue them up after > 3.14-rc1 is out. Didnt' Linus say there would be an -rc8? However - there is a devicetree issue to be discussed anyway (see Sascha's comment). Although we'd personally like to see this series being merged sooner than later, it should be sorted out first. Devicetree issues are ugly to change once they are in mainline. rsc -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RFC 26/46] drivers/base: provide an infrastructure for componentised subsystems
On Fri, Jan 10, 2014 at 07:30:21PM +0100, Robert Schwebel wrote: > On Fri, Jan 10, 2014 at 07:35:30AM -0800, Greg Kroah-Hartman wrote: > > > I'll sort out a new set of patches today, along with a branch to pull if > > > you wish to take them that way. > > > > It's too late for 3.14, as my tree is now closed for that because 3.13 > > should be out this weekend. But I'll be glad to queue them up after > > 3.14-rc1 is out. > > Didnt' Linus say there would be an -rc8? Ah, you are right, nevermind then :) Russell, if you want to send me just the driver core patch, I can take that now and get that into 3.14 so that you don't have any cross-tree dependancies on the rest of this patch series. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wlan-ng: fix leaks on failure paths in prism2sta_probe_usb()
There are leaks of resources allocated by wlan_setup() and usb_dev refcnt on failure paths in prism2sta_probe_usb(). The patch adds appropriate deallocations and removes invalid code from hfa384x_corereset() failure handling. unregister_wlandev() is wrong because it is not registered yet. hfa384x_destroy() is just noop in init state. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/staging/wlan-ng/prism2usb.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wlan-ng/prism2usb.c b/drivers/staging/wlan-ng/prism2usb.c index b401974fb282..4739c14d8359 100644 --- a/drivers/staging/wlan-ng/prism2usb.c +++ b/drivers/staging/wlan-ng/prism2usb.c @@ -140,11 +140,9 @@ static int prism2sta_probe_usb(struct usb_interface *interface, prism2_reset_holdtime, prism2_reset_settletime, 0); if (result != 0) { - unregister_wlandev(wlandev); - hfa384x_destroy(hw); result = -EIO; dev_err(&interface->dev, "hfa384x_corereset() failed.\n"); - goto failed; + goto failed_reset; } } @@ -159,11 +157,15 @@ static int prism2sta_probe_usb(struct usb_interface *interface, if (register_wlandev(wlandev) != 0) { dev_err(&interface->dev, "register_wlandev() failed.\n"); result = -EIO; - goto failed; + goto failed_register; } goto done; +failed_register: + usb_put_dev(dev); +failed_reset: + wlan_unsetup(wlandev); failed: kfree(wlandev); kfree(hw); -- 1.8.3.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RFC 26/46] drivers/base: provide an infrastructure for componentised subsystems
On Fri, Jan 10, 2014 at 12:42:59PM -0800, Greg Kroah-Hartman wrote: > On Fri, Jan 10, 2014 at 07:30:21PM +0100, Robert Schwebel wrote: > > On Fri, Jan 10, 2014 at 07:35:30AM -0800, Greg Kroah-Hartman wrote: > > > > I'll sort out a new set of patches today, along with a branch to pull if > > > > you wish to take them that way. > > > > > > It's too late for 3.14, as my tree is now closed for that because 3.13 > > > should be out this weekend. But I'll be glad to queue them up after > > > 3.14-rc1 is out. > > > > Didnt' Linus say there would be an -rc8? > > Ah, you are right, nevermind then :) > > Russell, if you want to send me just the driver core patch, I can take > that now and get that into 3.14 so that you don't have any cross-tree > dependancies on the rest of this patch series. Thanks, here it is. Only change from the previously posted one is a few checkpatch cleanups. 8<=== From: Russell King Cc: Greg Kroah-Hartman Subject: [PATCH] drivers/base: provide an infrastructure for componentised subsystems Subsystems such as ALSA, DRM and others require a single card-level device structure to represent a subsystem. However, firmware tends to describe the individual devices and the connections between them. Therefore, we need a way to gather up the individual component devices together, and indicate when we have all the component devices. We do this in DT by providing a "superdevice" node which specifies the components, eg: imx-drm { compatible = "fsl,drm"; crtcs = <&ipu1>; connectors = <&hdmi>; }; The superdevice is declared into the component support, along with the subcomponents. The superdevice receives callbacks to locate the subcomponents, and identify when all components are present. At this point, we bind the superdevice, which causes the appropriate subsystem to be initialised in the conventional way. When any of the components or superdevice are removed from the system, we unbind the superdevice, thereby taking the subsystem down. Signed-off-by: Russell King --- drivers/base/Makefile | 2 +- drivers/base/component.c | 382 ++ include/linux/component.h | 32 3 files changed, 415 insertions(+), 1 deletion(-) create mode 100644 drivers/base/component.c create mode 100644 include/linux/component.h diff --git a/drivers/base/Makefile b/drivers/base/Makefile index 94e8a80e87f8..870ecfd503af 100644 --- a/drivers/base/Makefile +++ b/drivers/base/Makefile @@ -1,6 +1,6 @@ # Makefile for the Linux device tree -obj-y := core.o bus.o dd.o syscore.o \ +obj-y := component.o core.o bus.o dd.o syscore.o \ driver.o class.o platform.o \ cpu.o firmware.o init.o map.o devres.o \ attribute_container.o transport_class.o \ diff --git a/drivers/base/component.c b/drivers/base/component.c new file mode 100644 index ..c53efe6c6d8e --- /dev/null +++ b/drivers/base/component.c @@ -0,0 +1,382 @@ +/* + * Componentized device handling. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This is work in progress. We gather up the component devices into a list, + * and bind them when instructed. At the moment, we're specific to the DRM + * subsystem, and only handles one master device, but this doesn't have to be + * the case. + */ +#include +#include +#include +#include +#include +#include +#include + +struct master { + struct list_head node; + struct list_head components; + bool bound; + + const struct component_master_ops *ops; + struct device *dev; +}; + +struct component { + struct list_head node; + struct list_head master_node; + struct master *master; + bool bound; + + const struct component_ops *ops; + struct device *dev; +}; + +static DEFINE_MUTEX(component_mutex); +static LIST_HEAD(component_list); +static LIST_HEAD(masters); + +static struct master *__master_find(struct device *dev, + const struct component_master_ops *ops) +{ + struct master *m; + + list_for_each_entry(m, &masters, node) + if (m->dev == dev && (!ops || m->ops == ops)) + return m; + + return NULL; +} + +/* Attach an unattached component to a master. */ +static void component_attach_master(struct master *master, struct component *c) +{ + c->master = master; + + list_add_tail(&c->master_node, &master->components); +} + +/* Detach a component from a master. */ +static void component_detach_master(struct master *master, struct component *c) +{ + list_del(&c->master_node); + + c->master = NULL; +} + +int component_master_add_child(struct master *master, + int (*compare)(struct de
[PATCH] Staging: rtl8188eu: Fixed whitespace related coding style issues
This patch fixes two spaces at the start of the line aswell as all space after opening parenthesis and space before closeing parenthesis checkpatch.pl warnings in rtw_mlme.h Signed-off-by: Tim Jester-Pfadt --- drivers/staging/rtl8188eu/include/rtw_mlme.h | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h index 33965ca..144f79c 100644 --- a/drivers/staging/rtl8188eu/include/rtw_mlme.h +++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h @@ -129,17 +129,17 @@ struct rt_link_detect { struct profile_info { u8 ssidlen; - u8 ssid[ WLAN_SSID_MAXLEN ]; - u8 peermac[ ETH_ALEN ]; + u8 ssid[WLAN_SSID_MAXLEN]; + u8 peermac[ETH_ALEN]; }; struct tx_invite_req_info { u8 token; u8 benable; - u8 go_ssid[ WLAN_SSID_MAXLEN ]; + u8 go_ssid[WLAN_SSID_MAXLEN]; u8 ssidlen; - u8 go_bssid[ ETH_ALEN ]; - u8 peer_macaddr[ ETH_ALEN ]; + u8 go_bssid[ETH_ALEN]; + u8 peer_macaddr[ETH_ALEN]; u8 operating_ch; /* This information will be set by using the * p2p_set op_ch=x */ u8 peer_ch;/* The listen channel for peer P2P device */ @@ -182,9 +182,9 @@ struct tx_nego_req_info { }; struct group_id_info { - u8 go_device_addr[ ETH_ALEN ]; /* The GO's device address of + u8 go_device_addr[ETH_ALEN]; /* The GO's device address of * this P2P group */ - u8 ssid[ WLAN_SSID_MAXLEN ]; /* The SSID of this P2P group */ + u8 ssid[WLAN_SSID_MAXLEN]; /* The SSID of this P2P group */ }; struct scan_limit_info { @@ -388,7 +388,7 @@ struct mlme_priv { u8 *assoc_rsp; u32 assoc_rsp_len; -#if defined (CONFIG_88EU_AP_MODE) +#if defined(CONFIG_88EU_AP_MODE) /* Number of associated Non-ERP stations (i.e., stations using 802.11b * in 802.11g BSS) */ int num_sta_non_erp; @@ -472,7 +472,7 @@ void rtw_join_timeout_handler(void *FunctionContext); void _rtw_scan_timeout_handler(void *FunctionContext); void rtw_free_network_queue(struct adapter *adapter, u8 isfreeall); int rtw_init_mlme_priv(struct adapter *adapter); -void rtw_free_mlme_priv (struct mlme_priv *pmlmepriv); +void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv); int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv); int rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, int keyid, u8 set_tx); @@ -572,7 +572,7 @@ struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue); void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue); void rtw_indicate_disconnect(struct adapter *adapter); void rtw_indicate_connect(struct adapter *adapter); -void rtw_indicate_scan_done( struct adapter *padapter, bool aborted); +void rtw_indicate_scan_done(struct adapter *padapter, bool aborted); void rtw_scan_abort(struct adapter *adapter); int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, @@ -588,7 +588,7 @@ void rtw_get_encrypt_decrypt_from_registrypriv(struct adapter *adapter); void _rtw_join_timeout_handler(struct adapter *adapter); void rtw_scan_timeout_handler(struct adapter *adapter); - void rtw_dynamic_check_timer_handlder(struct adapter *adapter); +void rtw_dynamic_check_timer_handlder(struct adapter *adapter); #define rtw_is_scan_deny(adapter) false #define rtw_clear_scan_deny(adapter) do {} while (0) #define rtw_set_scan_deny_timer_hdl(adapter) do {} while (0) @@ -605,7 +605,7 @@ int _rtw_enqueue_network(struct __queue *queue, struct wlan_network *pnetwork); struct wlan_network *_rtw_dequeue_network(struct __queue *queue); - struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv); +struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv); void _rtw_free_network(struct mlme_priv *pmlmepriv, -- 1.8.5.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: bcm : Fix typo in staging/bcm
This patch fixed spelling typo in comment and printks withing staging/bcm. Signed-off-by: Masanari Iida --- drivers/staging/bcm/Adapter.h | 2 +- drivers/staging/bcm/Bcmchar.c | 6 +++--- drivers/staging/bcm/PHSModule.c | 4 ++-- drivers/staging/bcm/nvm.c | 10 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/bcm/Adapter.h b/drivers/staging/bcm/Adapter.h index 9cd5987..f0d6f0c 100644 --- a/drivers/staging/bcm/Adapter.h +++ b/drivers/staging/bcm/Adapter.h @@ -378,7 +378,7 @@ struct bcm_mini_adapter { UINTuiFlashLayoutMinorVersion; boolbAllDSDWriteAllow; boolbSigCorrupted; - /* this should be set who so ever want to change the Headers. after Wrtie it should be reset immediately. */ + /* this should be set who so ever want to change the Headers. after Write it should be reset immediately. */ boolbHeaderChangeAllowed; int SelectedChip; boolbEndPointHalted; diff --git a/drivers/staging/bcm/Bcmchar.c b/drivers/staging/bcm/Bcmchar.c index 6241534..f1b6de0 100644 --- a/drivers/staging/bcm/Bcmchar.c +++ b/drivers/staging/bcm/Bcmchar.c @@ -1770,12 +1770,12 @@ cntrlEnd: BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "NOB :%x", sCopySectStrut.numOfBytes); if (IsSectionExistInFlash(Adapter, sCopySectStrut.SrcSection) == false) { - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Source Section<%x> does not exixt in Flash ", sCopySectStrut.SrcSection); + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Source Section<%x> does not exist in Flash ", sCopySectStrut.SrcSection); return -EINVAL; } if (IsSectionExistInFlash(Adapter, sCopySectStrut.DstSection) == false) { - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Destinatio Section<%x> does not exixt in Flash ", sCopySectStrut.DstSection); + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Destinatio Section<%x> does not exist in Flash ", sCopySectStrut.DstSection); return -EINVAL; } @@ -1880,7 +1880,7 @@ cntrlEnd: SectOfset = BcmGetSectionValStartOffset(Adapter, eFlash2xSectionVal); if (SectOfset == INVALID_OFFSET) { - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Provided Section val <%d> does not exixt in Flash 2.x", eFlash2xSectionVal); + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Provided Section val <%d> does not exist in Flash 2.x", eFlash2xSectionVal); return -EINVAL; } diff --git a/drivers/staging/bcm/PHSModule.c b/drivers/staging/bcm/PHSModule.c index 892ebc6..afc7bcc 100644 --- a/drivers/staging/bcm/PHSModule.c +++ b/drivers/staging/bcm/PHSModule.c @@ -1280,11 +1280,11 @@ static int phs_decompress(unsigned char *in_buf, if (bit == SUPPRESS) { *out_buf = *phsf; - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_RECEIVE, DBG_LVL_ALL, "\nDECOMP:In phss %d phsf %d ouput %d", + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_RECEIVE, DBG_LVL_ALL, "\nDECOMP:In phss %d phsf %d output %d", phss, *phsf, *out_buf); } else { *out_buf = *in_buf; - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_RECEIVE, DBG_LVL_ALL, "\nDECOMP:In phss %d input %d ouput %d", + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_RECEIVE, DBG_LVL_ALL, "\nDECOMP:In phss %d input %d output %d", phss, *in_buf, *out_buf); in_buf++; size++; diff --git a/drivers/staging/bcm/nvm.c b/drivers/staging/bcm/nvm.c index 1128abf8..fca164f 100644 --- a/drivers/staging/bcm/nvm.c +++ b/drivers/staging/bcm/nvm.c @@ -2812,7 +2812,7 @@ int BcmFlash2xBulkRead(struct bcm_mini_adapter *Adapter, SectionStartOffset = BcmGetSectionValStartOffset(Adapter, eFlash2xSectionVal); if (SectionStartOffset == STATUS_FAILURE) { - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "This Section<%d> does not exixt in Flash 2.x Map ", eFlash2xSectionVal); + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "This Section<%d> does not exist in Flash 2.x Map ", eFlash2xSectionVal); return -EINVAL; } @@ -2875,7 +2875,7 @@ int BcmFlash2xBulkWrite(struct bcm_mini_adapter *Adapter, FlashSectValStartOffset = BcmGetSectionValStartOffset(Adapter, eFlash2xSectVal); if (FlashSectValStartOffset == STATUS_FAILURE) { - BCM_DEBUG_P
Re: [RFC PATCH v2] staging: imx-hdmi: use rx sense status for plug detection if hpd is unreliable
On Fri, Jan 10, 2014 at 03:22:24PM +0100, Philipp Zabel wrote: > Due to the voltage divider on the HPD line, the HDMI connector on > imx6q-sabrelite doesn't reliably detect connected DVI monitors. > This patch allows to use the RX_SENSE0 signal as a workaround when > enabled by a boolean device tree property 'hpd-unreliable'. If it's a fsl/imx specific property, it should have a 'fsl,' prefix. It should be added into binding doc. Oh, we do not even have a binding doc for this imx-hdmi yet. Shawn > > Signed-off-by: Philipp Zabel > --- > This patch is based on Russell's recent 46-patch imx-drm cleanup series. > Changes since v1: > - Store the status and polarity bits in struct imx_hdmi > --- > drivers/staging/imx-drm/imx-hdmi.c | 36 ++-- > 1 file changed, 26 insertions(+), 10 deletions(-) > > diff --git a/drivers/staging/imx-drm/imx-hdmi.c > b/drivers/staging/imx-drm/imx-hdmi.c > index fb3177d..62cb531 100644 > --- a/drivers/staging/imx-drm/imx-hdmi.c > +++ b/drivers/staging/imx-drm/imx-hdmi.c > @@ -140,6 +140,9 @@ struct imx_hdmi { > struct regmap *regmap; > struct i2c_adapter *ddc; > void __iomem *regs; > + u8 sink_detect_polarity; > + u8 sink_detect_status; > + u8 sink_detect_mask; > > unsigned int sample_rate; > int ratio; > @@ -1317,10 +1320,10 @@ static int imx_hdmi_fb_registered(struct imx_hdmi > *hdmi) > HDMI_PHY_I2CM_CTLINT_ADDR); > > /* enable cable hot plug irq */ > - hdmi_writeb(hdmi, (u8)~HDMI_PHY_HPD, HDMI_PHY_MASK0); > + hdmi_writeb(hdmi, hdmi->sink_detect_mask, HDMI_PHY_MASK0); > > /* Clear Hotplug interrupts */ > - hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD, HDMI_IH_PHY_STAT0); > + hdmi_writeb(hdmi, hdmi->sink_detect_status, HDMI_IH_PHY_STAT0); > > return 0; > } > @@ -1392,6 +1395,7 @@ static enum drm_connector_status > imx_hdmi_connector_detect(struct drm_connector > { > struct imx_hdmi *hdmi = container_of(connector, struct imx_hdmi, >connector); > + > return hdmi->connector_status; > } > > @@ -1530,18 +1534,20 @@ static irqreturn_t imx_hdmi_irq(int irq, void *dev_id) > > phy_int_pol = hdmi_readb(hdmi, HDMI_PHY_POL0); > > - if (intr_stat & HDMI_IH_PHY_STAT0_HPD) { > - if (phy_int_pol & HDMI_PHY_HPD) { > + if (intr_stat & hdmi->sink_detect_status) { > + int pol_bit = hdmi->sink_detect_polarity; > + > + if (phy_int_pol & pol_bit) { > dev_dbg(hdmi->dev, "EVENT=plugin\n"); > > - hdmi_modb(hdmi, 0, HDMI_PHY_HPD, HDMI_PHY_POL0); > + hdmi_modb(hdmi, 0, pol_bit, HDMI_PHY_POL0); > > hdmi->connector_status = connector_status_connected; > imx_hdmi_poweron(hdmi); > } else { > dev_dbg(hdmi->dev, "EVENT=plugout\n"); > > - hdmi_modb(hdmi, HDMI_PHY_HPD, HDMI_PHY_HPD, > HDMI_PHY_POL0); > + hdmi_modb(hdmi, pol_bit, pol_bit, HDMI_PHY_POL0); > > hdmi->connector_status = connector_status_disconnected; > imx_hdmi_poweroff(hdmi); > @@ -1550,7 +1556,7 @@ static irqreturn_t imx_hdmi_irq(int irq, void *dev_id) > } > > hdmi_writeb(hdmi, intr_stat, HDMI_IH_PHY_STAT0); > - hdmi_writeb(hdmi, ~HDMI_IH_PHY_STAT0_HPD, HDMI_IH_MUTE_PHY_STAT0); > + hdmi_writeb(hdmi, ~hdmi->sink_detect_status, HDMI_IH_MUTE_PHY_STAT0); > > return IRQ_HANDLED; > } > @@ -1702,14 +1708,24 @@ static int imx_hdmi_bind(struct device *dev, struct > device *master, void *data) >*/ > hdmi_init_clk_regenerator(hdmi); > > + hdmi->sink_detect_status = HDMI_IH_PHY_STAT0_HPD; > + hdmi->sink_detect_polarity = HDMI_PHY_HPD; > + hdmi->sink_detect_mask = ~HDMI_PHY_HPD; > + > + if (of_property_read_bool(np, "hpd-unreliable")) { > + hdmi->sink_detect_status = HDMI_IH_PHY_STAT0_RX_SENSE0; > + hdmi->sink_detect_polarity = HDMI_PHY_RX_SENSE0; > + hdmi->sink_detect_mask = ~HDMI_PHY_RX_SENSE0; > + } > + > /* >* Configure registers related to HDMI interrupt >* generation before registering IRQ. >*/ > - hdmi_writeb(hdmi, HDMI_PHY_HPD, HDMI_PHY_POL0); > + hdmi_writeb(hdmi, hdmi->sink_detect_polarity, HDMI_PHY_POL0); > > /* Clear Hotplug interrupts */ > - hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD, HDMI_IH_PHY_STAT0); > + hdmi_writeb(hdmi, hdmi->sink_detect_status, HDMI_IH_PHY_STAT0); > > ret = imx_hdmi_fb_registered(hdmi); > if (ret) > @@ -1720,7 +1736,7 @@ static int imx_hdmi_bind(struct device *dev, struct > device *master, void *data) > goto err_iahb; > > /* Unmute interrupts */ > - hdmi_writeb(hdmi, ~HDMI_IH_PHY_STAT0_HPD, HDMI_IH_MUTE_PHY_STAT0); > + hdmi_writeb(hdmi, ~hdmi->sink_dete
[PATCH 3/3] Staging: comedi: fix extra whitespace style issues in ni_mio_common.c.
This patch for ni_mio_common.c removes extra whitespace causing checkpatch.pl warnings. Signed-off-by: Chase Southwood --- drivers/staging/comedi/drivers/ni_mio_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 95f4e37..457b884 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -992,7 +992,7 @@ static void ack_a_interrupt(struct comedi_device *dev, unsigned short a_status) ack |= AI_START_Interrupt_Ack; if (a_status & AI_STOP_St) /* not sure why we used to ack the START here also, instead of doing it independently. Frank Hess 2007-07-06 */ - ack |= AI_STOP_Interrupt_Ack /*| AI_START_Interrupt_Ack */ ; + ack |= AI_STOP_Interrupt_Ack /*| AI_START_Interrupt_Ack */; if (ack) devpriv->stc_writew(dev, ack, Interrupt_A_Ack_Register); } @@ -4262,7 +4262,7 @@ static int ni_E_init(struct comedi_device *dev) s->n_chan = board->num_p0_dio_channels; if (board->reg_type & ni_reg_m_series_mask) { s->subdev_flags |= - SDF_LSAMPL | SDF_CMD_WRITE /* | SDF_CMD_READ */ ; + SDF_LSAMPL | SDF_CMD_WRITE /* | SDF_CMD_READ */; s->insn_bits = &ni_m_series_dio_insn_bits; s->insn_config = &ni_m_series_dio_insn_config; s->do_cmd = &ni_cdio_cmd; @@ -4731,7 +4731,7 @@ static int pack_ad8842(int addr, int val, int *bitstring); struct caldac_struct { int n_chans; int n_bits; - int (*packbits) (int, int, int *); + int (*packbits)(int, int, int *); }; static struct caldac_struct caldacs[] = { -- 1.8.4.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] Staging: comedi: fix indentation coding style issue in ni_mio_common.c.
This patch for ni_mio_common.c fixes several indentation warnings from checkpatch.pl. Signed-off-by: Chase Southwood --- drivers/staging/comedi/drivers/ni_mio_common.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 116174a..95f4e37 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -3652,15 +3652,15 @@ static void handle_cdio_interrupt(struct comedi_device *dev) cdio_status = ni_readl(M_Offset_CDIO_Status); if (cdio_status & (CDO_Overrun_Bit | CDO_Underflow_Bit)) { -/* printk("cdio error: statux=0x%x\n", cdio_status); */ + /* printk("cdio error: statux=0x%x\n", cdio_status); */ ni_writel(CDO_Error_Interrupt_Confirm_Bit, M_Offset_CDIO_Command); /* XXX just guessing this is needed and does something useful */ s->async->events |= COMEDI_CB_OVERFLOW; } if (cdio_status & CDO_FIFO_Empty_Bit) { -/* printk("cdio fifo empty\n"); */ + /* printk("cdio fifo empty\n"); */ ni_writel(CDO_Empty_FIFO_Interrupt_Enable_Clear_Bit, M_Offset_CDIO_Command); -/* s->async->events |= COMEDI_CB_EOA; */ + /* s->async->events |= COMEDI_CB_EOA; */ } ni_event(dev, s); } @@ -3845,7 +3845,7 @@ static int ni_serial_sw_readwrite8(struct comedi_device *dev, /* Input current bit */ if (devpriv->stc_readw(dev, DIO_Parallel_Input_Register) & DIO_SDIN) { -/* printk("DIO_P_I_R: 0x%x\n", devpriv->stc_readw(dev, DIO_Parallel_Input_Register)); */ + /* printk("DIO_P_I_R: 0x%x\n", devpriv->stc_readw(dev, DIO_Parallel_Input_Register)); */ input |= mask; } } -- 1.8.4.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] Staging: comedi: fix numerous brace coding style issues in ni_mio_common.c.
This patch for ni_mio_common.c removes many unneccesary braces to fix checkpatch.pl warnings. Signed-off-by: Chase Southwood --- drivers/staging/comedi/drivers/ni_mio_common.c | 124 + 1 file changed, 43 insertions(+), 81 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index eb9f517..116174a 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -451,11 +451,10 @@ static inline void ni_set_gpct_dma_channel(struct comedi_device *dev, { unsigned bitfield; - if (mite_channel >= 0) { + if (mite_channel >= 0) bitfield = GPCT_DMA_Select_Bits(gpct_index, mite_channel); - } else { + else bitfield = 0; - } ni_set_bitfield(dev, G0_G1_Select, GPCT_DMA_Select_Mask(gpct_index), bitfield); } @@ -871,9 +870,8 @@ static void mite_handle_b_linkc(struct mite_struct *mite, unsigned long flags; spin_lock_irqsave(&devpriv->mite_channel_lock, flags); - if (devpriv->ao_mite_chan) { + if (devpriv->ao_mite_chan) mite_sync_output_dma(devpriv->ao_mite_chan, s->async); - } spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); } @@ -921,9 +919,8 @@ static void ni_handle_eos(struct comedi_device *dev, struct comedi_subdevice *s) #endif } /* handle special case of single scan using AI_End_On_End_Of_Scan */ - if ((devpriv->ai_cmd2 & AI_End_On_End_Of_Scan)) { + if ((devpriv->ai_cmd2 & AI_End_On_End_Of_Scan)) shutdown_ai_command(dev); - } } static void shutdown_ai_command(struct comedi_device *dev) @@ -987,19 +984,15 @@ static void ack_a_interrupt(struct comedi_device *dev, unsigned short a_status) struct ni_private *devpriv = dev->private; unsigned short ack = 0; - if (a_status & AI_SC_TC_St) { + if (a_status & AI_SC_TC_St) ack |= AI_SC_TC_Interrupt_Ack; - } - if (a_status & AI_START1_St) { + if (a_status & AI_START1_St) ack |= AI_START1_Interrupt_Ack; - } - if (a_status & AI_START_St) { + if (a_status & AI_START_St) ack |= AI_START_Interrupt_Ack; - } - if (a_status & AI_STOP_St) { + if (a_status & AI_STOP_St) /* not sure why we used to ack the START here also, instead of doing it independently. Frank Hess 2007-07-06 */ ack |= AI_STOP_Interrupt_Ack /*| AI_START_Interrupt_Ack */ ; - } if (ack) devpriv->stc_writew(dev, ack, Interrupt_A_Ack_Register); } @@ -1015,9 +1008,8 @@ static void handle_a_interrupt(struct comedi_device *dev, unsigned short status, return; #ifdef PCIDMA - if (ai_mite_status & CHSR_LINKC) { + if (ai_mite_status & CHSR_LINKC) ni_sync_ai_dma(dev); - } if (ai_mite_status & ~(CHSR_INT | CHSR_LINKC | CHSR_DONE | CHSR_MRDY | CHSR_DRDY | CHSR_DRQ1 | CHSR_DRQ0 | CHSR_ERROR | @@ -1061,9 +1053,8 @@ static void handle_a_interrupt(struct comedi_device *dev, unsigned short status, return; } if (status & AI_SC_TC_St) { - if (!devpriv->ai_continuous) { + if (!devpriv->ai_continuous) shutdown_ai_command(dev); - } } } #ifndef PCIDMA @@ -1082,9 +1073,8 @@ static void handle_a_interrupt(struct comedi_device *dev, unsigned short status, } #endif /* !PCIDMA */ - if ((status & AI_STOP_St)) { + if ((status & AI_STOP_St)) ni_handle_eos(dev, s); - } ni_event(dev, s); } @@ -1094,27 +1084,20 @@ static void ack_b_interrupt(struct comedi_device *dev, unsigned short b_status) struct ni_private *devpriv = dev->private; unsigned short ack = 0; - if (b_status & AO_BC_TC_St) { + if (b_status & AO_BC_TC_St) ack |= AO_BC_TC_Interrupt_Ack; - } - if (b_status & AO_Overrun_St) { + if (b_status & AO_Overrun_St) ack |= AO_Error_Interrupt_Ack; - } - if (b_status & AO_START_St) { + if (b_status & AO_START_St) ack |= AO_START_Interrupt_Ack; - } - if (b_status & AO_START1_St) { + if (b_status & AO_START1_St) ack |= AO_START1_Interrupt_Ack; - } - if (b_status & AO_UC_TC_St) { + if (b_status & AO_UC_TC_St) ack |= AO_UC_TC_Interrupt_Ack; - } - if (b_status & AO_UI2_TC_St) { + if (b_status & AO_UI2_TC_St) ack |= AO_UI2_TC_Interrupt_Ack; - } - if (b_status & AO_UPDATE_St) { + if (b_status & AO_UPDATE_St) ack |= AO_