aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pmbus/lm25066.c
Commit message (Collapse)AuthorAge
* hwmon: (pmbus/lm25066) Add support for LM25063Guenter Roeck2013-10-18
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Add support for LM25056Guenter Roeck2013-04-08
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Refactor device specific coefficientsGuenter Roeck2013-04-08
| | | | | | | Initialize device specific coefficients from table instead of hard-coding it to simplify adding additional chips. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Clamp limit attributesGuenter Roeck2013-04-08
| | | | | | | | | | Limits on all supported sensors and chips have to be within 0..0x0fff, and limits are always positive. Clamp written values in chip driver. Also clear value cache to ensure that the actually written value is read back and reported correctly. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus/lm25066) Report VAUX as vmonGuenter Roeck2013-04-08
| | | | | | | | | So far the driver reported the voltage on VAUX as "vout2". This was not entirely appropriate as it is not an output voltage, and complicates the code. Use the new virtual "VMON" register set and report the voltage as "vmon" instead. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Simplify remove functionsGuenter Roeck2012-03-18
| | | | | | | | | Since devm_kzalloc() is now used to allocate driver memory, the client driver remove function has no purpose other than to call pmbus_do_remove(). This means we can get rid of it by redefining pmbus_do_remove() to use the same prototype, and pointing to it directly. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (pmbus) Convert pmbus drivers to use devm_kzallocGuenter Roeck2012-03-18
| | | | | | Marginally less code and eliminate the possibility of memory leaks. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: convert drivers/hwmon/* to use module_i2c_driver()Axel Lin2012-03-18
| | | | | | | | | | | | | | | | | | This patch converts the drivers in drivers/hwmon/* to use the module_i2c_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Corentin Labbe <corentin.labbe@geomatys.fr> Cc: Dirk Eibach <eibach@gdsys.de> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Steve Glendinning <steve.glendinning@smsc.com> Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Guillaume Ligneul <guillaume.ligneul@gmail.com> Cc: David George <david.george@ska.ac.za> Cc: "Hans J. Koch" <hjk@hansjkoch.de> Cc: Marc Hulsman <m.hulsman@tudelft.nl> Cc: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (pmbus) Always call _pmbus_read_byte in core driverGuenter Roeck2011-10-24
| | | | | | | | | | | | | Always call _pmbus_read_byte() instead of pmbus_read_byte() in PMBus core driver. With this change, device specific read functions can be implemented for all registers. Since the device specific read_byte function is now always called, we need to be more careful with page validations. Only fail if the passed page number is larger than 0, since -1 means "current page". Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* hwmon: (pmbus) Replace EINVAL return codes with more appropriate errorsGuenter Roeck2011-10-24
| | | | | | | EINVAL was over-used in the code. Replace it with more appropriate errors. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* hwmon: (pmbus) Don't return errors from driver remove functionsGuenter Roeck2011-10-24
| | | | | | | | | | | | | | | | | | | | | Driver remove functions have an error return value, but rarely return an error in practice. If a driver does return an error from its remove function, the driver won't be unloaded and is expected to stay alive. pmbus_do_remove() is defined as returning an int, but always returns 0 (no error). Calling code passes that return value on to high level driver remove functions, but does not evaluate it and removes driver data even if pmbus_do_remove() returned an error (which it in practice never does). Even if this code could never cause a real problem, it is nevertheless conceptually wrong. To reduce confusion and simplify the code, change pmbus_do_remove() to be a void function, and have PMBus client drivers always return zero in their driver remove functions. Reported-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (pmbus/lm25066) Ignore byte writes to non-zero pagesGuenter Roeck2011-08-11
| | | | | | | | | | | | | | pmbus_clear_faults() attempts to clear faults on non-existing real pages. As a result, the command error bit in the status register is set, and faults are not really cleared. All byte writes to non-zero pages are requests to clear the status register on that page. Since non-zero pages are virtual and do not exist on the chip, there is nothing to do, and such requests have to be ignored. This fixes above problem. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* hwmon: (pmbus) Add client driver for LM25066, LM5064, and LM5066Guenter Roeck2011-07-28
PMBus client driver supporting National Semiconductor LM25066, LM5064, and LM5066. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
"hl ppc"> #define VDE_I_DMA1TDEN 0x00800000 /* DMA 1 trans done enable */ #define VDE_I_C1AVEN 0x01000000 /* cap 1 act vid end enable */ #define VDE_I_HQV0EN 0x02000000 /* First hqv engine enable */ #define VDE_I_C1VBIEN 0x04000000 /* Cap 1 VBI end enable */ #define VDE_I_LVDSSI 0x08000000 /* LVDS sense interrupt */ #define VDE_I_C0AVEN 0x10000000 /* Cap 0 act vid end enable */ #define VDE_I_C0VBIEN 0x20000000 /* Cap 0 VBI end enable */ #define VDE_I_LVDSSIEN 0x40000000 /* LVDS Sense enable */ #define VDE_I_ENABLE 0x80000000 /* Global interrupt enable */ #if defined(CONFIG_VIDEO_VIA_CAMERA) || defined(CONFIG_VIDEO_VIA_CAMERA_MODULE) /* * DMA management. */ int viafb_request_dma(void); void viafb_release_dma(void); /* void viafb_dma_copy_out(unsigned int offset, dma_addr_t paddr, int len); */ int viafb_dma_copy_out_sg(unsigned int offset, struct scatterlist *sg, int nsg); /* * DMA Controller registers. */ #define VDMA_MR0 0xe00 /* Mod reg 0 */ #define VDMA_MR_CHAIN 0x01 /* Chaining mode */ #define VDMA_MR_TDIE 0x02 /* Transfer done int enable */ #define VDMA_CSR0 0xe04 /* Control/status */ #define VDMA_C_ENABLE 0x01 /* DMA Enable */ #define VDMA_C_START 0x02 /* Start a transfer */ #define VDMA_C_ABORT 0x04 /* Abort a transfer */ #define VDMA_C_DONE 0x08 /* Transfer is done */ #define VDMA_MARL0 0xe20 /* Mem addr low */ #define VDMA_MARH0 0xe24 /* Mem addr high */ #define VDMA_DAR0 0xe28 /* Device address */ #define VDMA_DQWCR0 0xe2c /* Count (16-byte) */ #define VDMA_TMR0 0xe30 /* Tile mode reg */ #define VDMA_DPRL0 0xe34 /* Not sure */ #define VDMA_DPR_IN 0x08 /* Inbound transfer to FB */ #define VDMA_DPRH0 0xe38 #define VDMA_PMR0 (0xe00 + 0x134) /* Pitch mode */ /* * Useful stuff that probably belongs somewhere global. */ #define VGA_WIDTH 640 #define VGA_HEIGHT 480 #endif /* CONFIG_VIDEO_VIA_CAMERA */ /* * Indexed port operations. Note that these are all multi-op * functions; every invocation will be racy if you're not holding * reg_lock. */ #define VIAStatus 0x3DA /* Non-indexed port */ #define VIACR 0x3D4 #define VIASR 0x3C4 #define VIAGR 0x3CE #define VIAAR 0x3C0 static inline u8 via_read_reg(u16 port, u8 index) { outb(index, port); return inb(port + 1); } static inline void via_write_reg(u16 port, u8 index, u8 data) { outb(index, port); outb(data, port + 1); } static inline void via_write_reg_mask(u16 port, u8 index, u8 data, u8 mask) { u8 old; outb(index, port); old = inb(port + 1); outb((data & mask) | (old & ~mask), port + 1); } #define VIA_MISC_REG_READ 0x03CC #define VIA_MISC_REG_WRITE 0x03C2 static inline void via_write_misc_reg_mask(u8 data, u8 mask) { u8 old = inb(VIA_MISC_REG_READ); outb((data & mask) | (old & ~mask), VIA_MISC_REG_WRITE); } #endif /* __VIA_CORE_H__ */