Cash deposits can rarely be used for any loan application purpose. This includes cash received from friends, family or the sale of items you had, or cash you have kept at home and plan to deposit back into your account.
You can however take the cash you have on hand and pay bills by money orders, and pay cash for items you would normally deplete your checking account with. For example, if you had $300 in cash from a birthday gift, you could buy your weekly groceries and pay cash, get your haircut and pay cash, and get a money order to pay your car insurance instead of using the money in your checking account. This would allow your checking account to accumulate $300 in acceptable funds from your payroll because you used the cash for something other than your down payment.
Occasionally, they will accept small deposits for cash if you have an occupation that receives tips, but not every lender will allow this. Its better not to use this as a source of funds for closing.