summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips
AgeCommit message (Expand)Author
2008-08-13USB: isp1301: fix compilationDmitry Baryshkov
2008-08-10i2c: correct some size_t printk formatsDavid Brownell
2008-08-07[ARM] Move include/asm-arm/arch-* to arch/arm/*/include/machRussell King
2008-08-07[ARM] Eliminate useless includes of asm/mach-types.hRussell King
2008-07-25gpiolib: allow user-selectionMichael Buesch
2008-07-25gpio: sysfs interfaceDavid Brownell
2008-07-16i2c: Convert the max6875 driver to a new-style i2c driverJean Delvare
2008-07-16i2c: Convert the pca9539 driver to a new-style i2c driverJean Delvare
2008-07-16i2c: Convert the pcf8575 driver to a new-style i2c driverJean Delvare
2008-07-16i2c: Convert the pcf8574 driver to a new-style i2c driverJean Delvare
2008-07-16i2c: Convert the pcf8591 driver to a new-style i2c driverJean Delvare
2008-07-16i2c: Convert the eeprom driver to a new-style i2c driverJean Delvare
2008-07-15Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6Linus Torvalds
2008-07-14i2c: Clean up old chip driversJean Delvare
2008-07-14i2c: New-style EEPROM driver using device IDsWolfram Sang
2008-07-14i2c: Drop stray references to lm_sensorsJean Delvare
2008-07-14i2c: Deprecate the legacy gpio driversDavid Brownell
2008-07-14i2c/eeprom: Fall back to SMBus read word transactionsJean Delvare
2008-07-14i2c/eeprom: Only probe buses with DDC or SPD classJean Delvare
2008-07-03ARM: OMAP: USB: Change omap USB code to use omap_read/write instead of __REGTony Lindgren
2008-05-18i2c/max6875: Really prevent 24RF08 corruptionJean Delvare
2008-04-29i2c: Convert most new-style drivers to use module aliasingJean Delvare
2008-04-29i2c: Add support for device alias namesJean Delvare
2008-04-29i2c/tps65010: Add missing intialization of client dataJean Delvare
2008-04-22i2c: Replace remaining __FUNCTION__ occurrencesHarvey Harrison
2008-04-14ARM: OMAP: I2C: tps65010 driver converts to gpiolibDavid Brownell
2008-03-12i2c: chips subdirectory is deprecatedJean Delvare
2008-02-07hwmon: Discard useless I2C driver IDsJean Delvare
2008-02-05deprecate obsolete pca9539 drivereric miao
2008-01-27i2c/tps65010: move header to <linux/i2c/...>David Brownell
2008-01-27i2c: normal_i2c can be made const (remaining drivers)Jean Delvare
2008-01-27i2c: the scheduled I2C RTC driver removalAdrian Bunk
2008-01-27i2c/tsl2550: Add power management addedRodolfo Giometti
2008-01-27i2c: Add support for the PCF8575 chipBart Van Assche
2008-01-24driver core: Make the dev_*() family of macros in device.h completeEmil Medve
2007-12-12i2c/isp1301_omap: Build fixDavid Brownell
2007-11-15i2c/eeprom: Recognize VGN as a valid Sony Vaio name prefixJean Delvare
2007-11-15i2c/eeprom: Hide Sony Vaio serial numbersJean Delvare
2007-10-18Add missing newlines to some uses of dev_<level> messagesJoe Perches
2007-10-17Make the pr_*() family of macros in kernel.h completeEmil Medve
2007-10-13i2c/pcf8574: No arbitrary initializationJean Delvare
2007-10-13i2c/tps65010: New-style driver updates, part 2David Brownell
2007-10-13i2c/tps65010: New-style driver updates, part 1David Brownell
2007-08-14i2c/menelaus: Build fixDavid Brownell
2007-08-14i2c/isp1301_omap: Build fixes, whitespaceDavid Brownell
2007-07-29Replace CONFIG_SOFTWARE_SUSPEND with CONFIG_HIBERNATIONRafael J. Wysocki
2007-07-26i2c: ds1682 warning fixAndrew Morton
2007-07-17OMAP: add TI TWL92330/Menelaus Power Management chip driverTony Lindgren
2007-07-15missing argument in bin_attribute ->read()/->write()Al Viro
2007-07-12Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6Linus Torvalds
n><linux/kernel.h> #include <linux/module.h> #include <linux/scatterlist.h> #include <linux/slab.h> struct crypto_ecb_ctx { struct crypto_cipher *child; }; static int crypto_ecb_setkey(struct crypto_tfm *parent, const u8 *key, unsigned int keylen) { struct crypto_ecb_ctx *ctx = crypto_tfm_ctx(parent); struct crypto_cipher *child = ctx->child; int err; crypto_cipher_clear_flags(child, CRYPTO_TFM_REQ_MASK); crypto_cipher_set_flags(child, crypto_tfm_get_flags(parent) & CRYPTO_TFM_REQ_MASK); err = crypto_cipher_setkey(child, key, keylen); crypto_tfm_set_flags(parent, crypto_cipher_get_flags(child) & CRYPTO_TFM_RES_MASK); return err; } static int crypto_ecb_crypt(struct blkcipher_desc *desc, struct blkcipher_walk *walk, struct crypto_cipher *tfm, void (*fn)(struct crypto_tfm *, u8 *, const u8 *)) { int bsize = crypto_cipher_blocksize(tfm); unsigned int nbytes; int err; err = blkcipher_walk_virt(desc, walk); while ((nbytes = walk->nbytes)) { u8 *wsrc = walk->src.virt.addr; u8 *wdst = walk->dst.virt.addr; do { fn(crypto_cipher_tfm(tfm), wdst, wsrc); wsrc += bsize; wdst += bsize; } while ((nbytes -= bsize) >= bsize); err = blkcipher_walk_done(desc, walk, nbytes); } return err; } static int crypto_ecb_encrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { struct blkcipher_walk walk; struct crypto_blkcipher *tfm = desc->tfm; struct crypto_ecb_ctx *ctx = crypto_blkcipher_ctx(tfm); struct crypto_cipher *child = ctx->child; blkcipher_walk_init(&walk, dst, src, nbytes); return crypto_ecb_crypt(desc, &walk, child, crypto_cipher_alg(child)->cia_encrypt); } static int crypto_ecb_decrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { struct blkcipher_walk walk; struct crypto_blkcipher *tfm = desc->tfm; struct crypto_ecb_ctx *ctx = crypto_blkcipher_ctx(tfm); struct crypto_cipher *child = ctx->child; blkcipher_walk_init(&walk, dst, src, nbytes); return crypto_ecb_crypt(desc, &walk, child, crypto_cipher_alg(child)->cia_decrypt); } static int crypto_ecb_init_tfm(struct crypto_tfm *tfm) { struct crypto_instance *inst = (void *)tfm->__crt_alg; struct crypto_spawn *spawn = crypto_instance_ctx(inst); struct crypto_ecb_ctx *ctx = crypto_tfm_ctx(tfm); struct crypto_cipher *cipher; cipher = crypto_spawn_cipher(spawn); if (IS_ERR(cipher)) return PTR_ERR(cipher); ctx->child = cipher; return 0; } static void crypto_ecb_exit_tfm(struct crypto_tfm *tfm) { struct crypto_ecb_ctx *ctx = crypto_tfm_ctx(tfm); crypto_free_cipher(ctx->child); } static struct crypto_instance *crypto_ecb_alloc(struct rtattr **tb) { struct crypto_instance *inst; struct crypto_alg *alg; int err; err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_BLKCIPHER); if (err) return ERR_PTR(err); alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, CRYPTO_ALG_TYPE_MASK); if (IS_ERR(alg)) return ERR_CAST(alg); inst = crypto_alloc_instance("ecb", alg); if (IS_ERR(inst)) goto out_put_alg; inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; inst->alg.cra_priority = alg->cra_priority; inst->alg.cra_blocksize = alg->cra_blocksize; inst->alg.cra_alignmask = alg->cra_alignmask; inst->alg.cra_type = &crypto_blkcipher_type; inst->alg.cra_blkcipher.min_keysize = alg->cra_cipher.cia_min_keysize; inst->alg.cra_blkcipher.max_keysize = alg->cra_cipher.cia_max_keysize; inst->alg.cra_ctxsize = sizeof(struct crypto_ecb_ctx); inst->alg.cra_init = crypto_ecb_init_tfm; inst->alg.cra_exit = crypto_ecb_exit_tfm; inst->alg.cra_blkcipher.setkey = crypto_ecb_setkey; inst->alg.cra_blkcipher.encrypt = crypto_ecb_encrypt; inst->alg.cra_blkcipher.decrypt = crypto_ecb_decrypt; out_put_alg: crypto_mod_put(alg); return inst; } static void crypto_ecb_free(struct crypto_instance *inst) { crypto_drop_spawn(crypto_instance_ctx(inst)); kfree(inst); } static struct crypto_template crypto_ecb_tmpl = { .name = "ecb", .alloc = crypto_ecb_alloc, .free = crypto_ecb_free, .module = THIS_MODULE, }; static int __init crypto_ecb_module_init(void) { return crypto_register_template(&crypto_ecb_tmpl); } static void __exit crypto_ecb_module_exit(void) { crypto_unregister_template(&crypto_ecb_tmpl); } module_init(crypto_ecb_module_init); module_exit(crypto_ecb_module_exit); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("ECB block cipher algorithm");